3f812f8a2000b49978a88255d7f932210cd0c8cf
[integration/test.git] / csit / suites / openstack / neutron / 040__delete_ports.robot
1 *** Settings ***
2 Documentation       Checking Port deleted in OpenStack are deleted also in OpenDaylight
3
4 Library             RequestsLibrary
5 Resource            ../../../variables/Variables.robot
6
7 Suite Setup         Start Suite
8 Suite Teardown      Delete All Sessions
9
10
11 *** Variables ***
12 ${OSREST}       /v2.0/ports/${PORTID}
13 ${data}         {"port":{"network_id":"${NETID}","admin_state_up": true}}
14
15
16 *** Test Cases ***
17 Delete New Port
18     [Documentation]    Delete previously created port in OpenStack
19     [Tags]    delete port openstack neutron
20     Log    ${data}
21     ${resp}    delete request    OSSession    ${OSREST}
22     Should be Equal As Strings    ${resp.status_code}    204
23     Log    ${resp.text}
24     sleep    2
25
26 Check Port Deleted
27     [Documentation]    Check port deleted in OpenDaylight
28     [Tags]    check port deleted opendaylight
29     ${resp}    get request    ODLSession    ${NEUTRON_PORTS_API}
30     Should be Equal As Strings    ${resp.status_code}    200
31     ${ODLResult}    To Json    ${resp.text}
32     Log    ${ODLResult}
33     ${resp}    get request    ODLSession    ${NEUTRON_PORTS_API}/${PORTID}
34     Should be Equal As Strings    ${resp.status_code}    404
35
36
37 *** Keywords ***
38 Check Port Exists
39     [Arguments]    ${portid}
40     ${resp}    get request    ODLSession    ${NEUTRON_PORTS_API}/${portid}
41     Should be Equal As Strings    ${resp.status_code}    200
42
43 Start Suite
44     Create Session    OSSession    ${NEUTRONURL}    headers=${X-AUTH-NOCONTENT}
45     Create Session    ODLSession    http://${ODL_SYSTEM_IP}:${PORT}    headers=${HEADERS}    auth=${AUTH}
46     Check Port Exists    ${PORTID}