Fixing mininet reads so that we always clear mininet
[integration/test.git] / test / csit / suites / openstack / neutron / 020__subnets.txt
1 *** Settings ***
2 Documentation     Checking Subnets  created in OpenStack are pushed to OpenDaylight
3 Suite Setup       Create Session    OSSession     http://${OPENSTACK}:9696    headers=${X-AUTH}    
4 Suite Teardown    Delete All Sessions
5 Library           SSHLibrary
6 Library           Collections
7 Library           OperatingSystem
8 Library           ../../../libraries/RequestsLibrary.py
9 Library           ../../../libraries/Common.py
10 Variables         ../../../variables/Variables.py
11  
12 *** Variables ***
13 ${ODLREST}       /controller/nb/v2/neutron/subnets
14 ${OSREST}        /v2.0/subnets
15 ${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"}]}}
16  
17 *** Test Cases ***
18 Check OpenStack Subnets
19         [Documentation]     Checking OpenStack Neutron for known Subnets
20         [Tags]              Subnets Neutron OpenStack
21         Log     ${X-AUTH}
22         ${resp}         get     OSSession       ${OSREST}    
23         Should be Equal As Strings      ${resp.status_code}     200
24         ${OSResult}     To Json         ${resp.content}
25         Set Suite Variable      ${OSResult}
26         Log     ${OSResult}
27
28 Check OpenDaylight subnets
29         [Documentation]    Checking OpenDaylight Neutron API for Known Subnets
30         [Tags]             Subnets Neutron OpenDaylight
31         Create Session  ODLSession      http://${CONTROLLER}:${PORT}     headers=${HEADERS}  auth=${AUTH}
32         ${resp}         get     ODLSession      ${ODLREST}    
33         Should be Equal As Strings      ${resp.status_code}     200
34         ${ODLResult}    To Json         ${resp.content}
35         Set Suite Variable      ${ODLResult}
36         Log     ${ODLResult}
37
38 Create New subnet
39         [Documentation]    Create new subnet in OpenStack
40         [Tags]             Create Subnet OpenStack Neutron
41         Log     ${data}
42         ${resp}         post    OSSession       ${OSREST}       data=${data}  
43         Should be Equal As Strings      ${resp.status_code}     201
44         ${result}       To JSON         ${resp.content}
45         ${result}       Get From Dictionary     ${result}       subnet  
46         ${SUBNETID}     Get From Dictionary     ${result}       id
47         Log     ${result}
48         Log     ${SUBNETID}
49         Set Global Variable     ${SUBNETID}
50         sleep    2
51
52 Check New subnet
53         [Documentation]   Check new subnet created in OpenDaylight
54         [Tags]          Check  subnet OpenDaylight
55         ${resp}         get     ODLSession      ${ODLREST}/${SUBNETID}
56         Should be Equal As Strings      ${resp.status_code}     200
57
58