Push upstream several robot files
[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 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     Log    ${ODLResult}
30     ${resp}    get request    ODLSession    ${ODLREST}/${PORTID}
31     Should be Equal As Strings    ${resp.status_code}    404
32
33 *** Keywords ***
34 Check Port Exists
35     [Arguments]    ${portid}
36     ${resp}    get request    ODLSession    ${ODLREST}/${portid}
37     Should be Equal As Strings    ${resp.status_code}    200
38
39 Start Suite
40     Create Session    OSSession    http://${NEUTRON}:9696    headers=${X-AUTH}
41     Create Session    ODLSession    http://${ODL_SYSTEM_IP}:${PORT}    headers=${HEADERS}    auth=${AUTH}
42     Check Port Exists    ${PORTID}