b934ca5d30700ba25e59482b645f75dbe336f342
[functest.git] / testcases / Controllers / ODL / custom_tests / neutron / 040__delete_ports.robot
1 *** Settings ***
2 Documentation     Checking Port deleted in OpenStack are deleted also in OpenDaylight
3 Suite Setup       Start Suite
4 Suite Teardown    Delete All Sessions
5 Library           RequestsLibrary
6 Variables         ../../../variables/Variables.py
7
8 *** Variables ***
9 ${ODLREST}       /controller/nb/v2/neutron/ports
10 ${OSREST}        /v2.0/ports/${PORTID}
11 ${data}          {"port":{"network_id":"${NETID}","admin_state_up": true}}
12
13 *** Test Cases ***
14 Delete New Port
15     [Documentation]    Delete previously created port in OpenStack
16     [Tags]    Delete port OpenStack Neutron
17     Log    ${data}
18     ${resp}    delete request    OSSession    ${OSREST}
19     Should be Equal As Strings    ${resp.status_code}    204
20     Log    ${resp.content}
21     sleep    2
22
23 Check Port Deleted
24     [Documentation]    Check port deleted in OpenDaylight
25     [Tags]    Check port deleted OpenDaylight
26     ${resp}    get request    ODLSession    ${ODLREST}
27     Should be Equal As Strings    ${resp.status_code}    200
28     ${ODLResult}    To Json    ${resp.content}
29     Set Suite Variable    ${ODLResult}
30     Log    ${ODLResult}
31     ${resp}    get request    ODLSession    ${ODLREST}/${PORTID}
32     Should be Equal As Strings    ${resp.status_code}    404
33
34 *** Keywords ***
35 Check Port Exists
36     [Arguments]    ${portid}
37     ${resp}    get request    ODLSession    ${ODLREST}/${portid}
38     Should be Equal As Strings    ${resp.status_code}    200
39
40 Start Suite
41     Create Session    OSSession    http://${NEUTRON}:9696    headers=${X-AUTH}
42     Create Session    ODLSession    http://${CONTROLLER}:${PORT}    headers=${HEADERS}    auth=${AUTH}
43     Check Port Exists    ${PORTID}