2 Documentation Checking Network 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/networks
11 ${postNet} {"network":{"name":"odl_network","admin_state_up":true}}
14 Check OpenStack Networks
15 [Documentation] Checking OpenStack Neutron for known networks
16 [Tags] Network 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 Networks
24 [Documentation] Checking OpenDaylight Neutron API for known networks
25 [Tags] Network Neutron OpenDaylight
26 Create Session ODLSession http://${ODL_SYSTEM_IP}:${PORT} headers=${HEADERS} auth=${AUTH}
27 ${resp} get request ODLSession ${NEUTRON_NETWORKS_API}
28 Should be Equal As Strings ${resp.status_code} 200
29 ${ODLResult} To Json ${resp.content}
33 [Documentation] Create new network in OpenStack
34 [Tags] Create Network OpenStack Neutron
36 ${resp} post request OSSession ${OSREST} data=${postNet}
37 Should be Equal As Strings ${resp.status_code} 201
38 ${result} To JSON ${resp.content}
39 ${result} Get From Dictionary ${result} network
40 ${NETID} Get From Dictionary ${result} id
43 Set Global Variable ${NETID}
47 [Documentation] Check network created in OpenDaylight
48 [Tags] Check Network OpenDaylight
49 ${resp} get request ODLSession ${NEUTRON_NETWORKS_API}/${NetID}
50 Should be Equal As Strings ${resp.status_code} 200