2 Documentation Checking Subnets created in OpenStack are pushed to OpenDaylight
3 Suite Setup Create Session OSSession ${NEUTRONURL} headers=${X-AUTH}
4 Suite Teardown Delete All Sessions
6 Library RequestsLibrary
7 Resource ../../../variables/Variables.robot
10 ${OSREST} /v2.0/subnets
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"}]}}
14 Check OpenStack Subnets
15 [Documentation] Checking OpenStack Neutron for known subnets
16 [Tags] Subnets Neutron OpenStack
18 ${resp} get request OSSession ${OSREST}
19 Should be Equal As Strings ${resp.status_code} 200
20 ${OSResult} To Json ${resp.content}
23 Check OpenDaylight subnets
24 [Documentation] Checking OpenDaylight Neutron API for known subnets
25 [Tags] Subnets Neutron OpenDaylight
26 Create Session ODLSession http://${ODL_SYSTEM_IP}:${PORT} headers=${HEADERS} auth=${AUTH}
27 ${resp} get request ODLSession ${NEUTRON_SUBNETS_API}
28 Should be Equal As Strings ${resp.status_code} 200
29 ${ODLResult} To Json ${resp.content}
33 [Documentation] Create new subnet in OpenStack
34 [Tags] Create Subnet OpenStack Neutron
36 ${resp} post request OSSession ${OSREST} data=${data}
37 Should be Equal As Strings ${resp.status_code} 201
38 ${result} To JSON ${resp.content}
39 ${result} Get From Dictionary ${result} subnet
40 ${SUBNETID} Get From Dictionary ${result} id
43 Set Global Variable ${SUBNETID}
47 [Documentation] Check new subnet created in OpenDaylight
48 [Tags] Check subnet OpenDaylight
49 ${resp} get request ODLSession ${NEUTRON_SUBNETS_API}/${SUBNETID}
50 Should be Equal As Strings ${resp.status_code} 200