cbeacdf2c135d438ee0a98c7c0ea4c270eec8e11
[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 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/subnets/${SUBNETID}
10 ${data}           {"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"}]}}
11
12 *** Test Cases ***
13 Delete New subnet
14     [Documentation]    Delete previously created subnet in OpenStack
15     [Tags]    Delete Subnet 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 New subnet deleted
23     [Documentation]    Check subnet deleted in OpenDaylight
24     [Tags]    Check subnet deleted OpenDaylight
25     ${resp}    get request    ODLSession    ${NEUTRON_SUBNETS_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_SUBNETS_API}/${SUBNETID}
30     Should be Equal As Strings    ${resp.status_code}    404
31
32 *** Keywords ***
33 Check Subnet Exists
34     [Arguments]    ${subnetid}
35     ${resp}    get request    ODLSession    ${NEUTRON_SUBNETS_API}/${subnetid}
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 Subnet Exists    ${SUBNETID}