16e396fd0f2e7bdec5dcfc26ee1db65e1c84d927
[functest.git] / testcases / Controllers / ODL / custom_tests / 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 Variables         ../../../variables/Variables.py
7
8 *** Variables ***
9 ${ODLREST}       /controller/nb/v2/neutron/subnets
10 ${OSREST}        /v2.0/subnets/${SUBNETID}
11 ${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"}]}}
12
13 *** Test Cases ***
14 Delete New subnet
15     [Documentation]    Delete previously created subnet in OpenStack
16     [Tags]    Delete Subnet 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 New subnet deleted
24     [Documentation]    Check subnet deleted in OpenDaylight
25     [Tags]    Check subnet 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     Set Suite Variable    ${ODLResult}
30     Log    ${ODLResult}
31     ${resp}    get request    ODLSession    ${ODLREST}/${SUBNETID}
32     Should be Equal As Strings    ${resp.status_code}    404
33
34 *** Keywords ***
35 Check Subnet Exists
36     [Arguments]    ${subnetid}
37     ${resp}    get request    ODLSession    ${ODLREST}/${subnetid}
38     Should be Equal As Strings    ${resp.status_code}    200
39
40 Start Suite
41     Create Session    OSSession    http://${NEUTRON}:9696    headers=${X-AUTH}
42     Create Session    ODLSession    http://${CONTROLLER}:${PORT}    headers=${HEADERS}    auth=${AUTH}
43     Check Subnet Exists    ${SUBNETID}