dad6a85245d1ed9f1d09dfb7628d0423d03bef78
[integration/test.git] / csit / suites / openstack / neutron / 050__delete_subnets.robot
1 *** Settings ***
2 Documentation       Checking Subnets 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/subnets/${SUBNETID}
13 ${data}
14 ...             {"subnet":{"network_id":"${NETID}","ip_version":4,"cidr":"172.16.64.0/24","allocation_pools":[{"start":"172.16.64.20","end":"172.16.64.120"}]}}
15
16
17 *** Test Cases ***
18 Delete New subnet
19     [Documentation]    Delete previously created subnet in OpenStack
20     [Tags]    delete subnet openstack neutron
21     Log    ${data}
22     ${resp}    delete request    OSSession    ${OSREST}
23     Should be Equal As Strings    ${resp.status_code}    204
24     Log    ${resp.text}
25     sleep    2
26
27 Check New subnet deleted
28     [Documentation]    Check subnet deleted in OpenDaylight
29     [Tags]    check subnet deleted opendaylight
30     ${resp}    get request    ODLSession    ${NEUTRON_SUBNETS_API}
31     Should be Equal As Strings    ${resp.status_code}    200
32     ${ODLResult}    To Json    ${resp.text}
33     Log    ${ODLResult}
34     ${resp}    get request    ODLSession    ${NEUTRON_SUBNETS_API}/${SUBNETID}
35     Should be Equal As Strings    ${resp.status_code}    404
36
37
38 *** Keywords ***
39 Check Subnet Exists
40     [Arguments]    ${subnetid}
41     ${resp}    get request    ODLSession    ${NEUTRON_SUBNETS_API}/${subnetid}
42     Should be Equal As Strings    ${resp.status_code}    200
43
44 Start Suite
45     Create Session    OSSession    ${NEUTRONURL}    headers=${X-AUTH-NOCONTENT}
46     Create Session    ODLSession    http://${ODL_SYSTEM_IP}:${PORT}    headers=${HEADERS}    auth=${AUTH}
47     Check Subnet Exists    ${SUBNETID}