2 Documentation Checking Subnets created in OpenStack are pushed to OpenDaylight
5 Library RequestsLibrary
6 Resource ../../../variables/Variables.robot
8 Suite Setup Create Session OSSession ${NEUTRONURL} headers=${X-AUTH}
9 Suite Teardown Delete All Sessions
13 ${OSREST} /v2.0/subnets
15 ... {"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"}]}}
19 Check OpenStack Subnets
20 [Documentation] Checking OpenStack Neutron for known subnets
21 [Tags] subnets neutron openstack
23 ${resp} get request OSSession ${OSREST}
24 Should be Equal As Strings ${resp.status_code} 200
25 ${OSResult} To Json ${resp.text}
28 Check OpenDaylight subnets
29 [Documentation] Checking OpenDaylight Neutron API for known subnets
30 [Tags] subnets neutron opendaylight
31 Create Session ODLSession http://${ODL_SYSTEM_IP}:${PORT} headers=${HEADERS} auth=${AUTH}
32 ${resp} get request ODLSession ${NEUTRON_SUBNETS_API}
33 Should be Equal As Strings ${resp.status_code} 200
34 ${ODLResult} To Json ${resp.text}
38 [Documentation] Create new subnet in OpenStack
39 [Tags] create subnet openstack neutron
41 ${resp} post request OSSession ${OSREST} data=${data}
42 Should be Equal As Strings ${resp.status_code} 201
43 ${result} To JSON ${resp.text}
44 ${result} Get From Dictionary ${result} subnet
45 ${SUBNETID} Get From Dictionary ${result} id
48 Set Global Variable ${SUBNETID}
52 [Documentation] Check new subnet created in OpenDaylight
53 [Tags] check subnet opendaylight
54 ${resp} get request ODLSession ${NEUTRON_SUBNETS_API}/${SUBNETID}
55 Should be Equal As Strings ${resp.status_code} 200