Update Robot Framework format - step 13
[integration/test.git] / csit / suites / openstack / neutron / 060__delete_networks.robot
1 *** Settings ***
2 Documentation       Checking Network 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/networks/${NETID}
13 ${postNet}      {"network":{"name":"odl_network","admin_state_up":true}}
14
15
16 *** Test Cases ***
17 Delete Network
18     [Documentation]    Delete network in OpenStack
19     [Tags]    delete network openstack neutron
20     Log    ${postNet}
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 Network deleted
27     [Documentation]    Check network deleted in OpenDaylight
28     [Tags]    check network opendaylight
29     ${resp}    get request    ODLSession    ${NEUTRON_NETWORKS_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_NETWORKS_API}/${NETID}
34     Should be Equal As Strings    ${resp.status_code}    404
35
36
37 *** Keywords ***
38 Check Network Exists
39     [Arguments]    ${netid}
40     ${resp}    get request    ODLSession    ${NEUTRON_NETWORKS_API}/${netid}
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 Network Exists    ${NETID}