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