2 Documentation Checking Subnets created in OpenStack are pushed to OpenDaylight
3 Suite Setup Create Session OSSession http://${NEUTRON}:9696 headers=${X-AUTH}
4 Suite Teardown Delete All Sessions
6 Library RequestsLibrary
7 Variables ../../../variables/Variables.py
10 ${ODLREST} /controller/nb/v2/neutron/subnets
11 ${OSREST} /v2.0/subnets
12 ${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"}]}}
15 Check OpenStack Subnets
16 [Documentation] Checking OpenStack Neutron for known subnets
17 [Tags] Subnets Neutron OpenStack
19 ${resp} get request OSSession ${OSREST}
20 Should be Equal As Strings ${resp.status_code} 200
21 ${OSResult} To Json ${resp.content}
22 Set Suite Variable ${OSResult}
25 Check OpenDaylight subnets
26 [Documentation] Checking OpenDaylight Neutron API for known subnets
27 [Tags] Subnets Neutron OpenDaylight
28 Create Session ODLSession http://${CONTROLLER}:${PORT} headers=${HEADERS} auth=${AUTH}
29 ${resp} get request ODLSession ${ODLREST}
30 Should be Equal As Strings ${resp.status_code} 200
31 ${ODLResult} To Json ${resp.content}
32 Set Suite Variable ${ODLResult}
36 [Documentation] Create new subnet in OpenStack
37 [Tags] Create Subnet OpenStack Neutron
39 ${resp} post request OSSession ${OSREST} data=${data}
40 Should be Equal As Strings ${resp.status_code} 201
41 ${result} To JSON ${resp.content}
42 ${result} Get From Dictionary ${result} subnet
43 ${SUBNETID} Get From Dictionary ${result} id
46 Set Global Variable ${SUBNETID}
50 [Documentation] Check new subnet created in OpenDaylight
51 [Tags] Check subnet OpenDaylight
52 ${resp} get request ODLSession ${ODLREST}/${SUBNETID}
53 Should be Equal As Strings ${resp.status_code} 200