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
7 Library OperatingSystem
8 Library RequestsLibrary
9 Library ../../../libraries/Common.py
10 Variables ../../../variables/Variables.py
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"}]}}
18 Check OpenStack Subnets
19 [Documentation] Checking OpenStack Neutron for known subnets
20 [Tags] Subnets Neutron OpenStack
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}
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}
39 [Documentation] Create new subnet in OpenStack
40 [Tags] Create Subnet OpenStack Neutron
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
49 Set Global Variable ${SUBNETID}
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