Update Robot Framework format - step 13
[integration/test.git] / csit / suites / openstack / neutron / 010__networks.robot
1 *** Settings ***
2 Documentation       Checking Network created in OpenStack are pushed to OpenDaylight
3
4 Library             Collections
5 Library             RequestsLibrary
6 Resource            ../../../variables/Variables.robot
7
8 Suite Setup         Create Session    OSSession    ${NEUTRONURL}    headers=${X-AUTH}
9 Suite Teardown      Delete All Sessions
10
11
12 *** Variables ***
13 ${OSREST}       /v2.0/networks
14 ${postNet}      {"network":{"name":"odl_network","admin_state_up":true}}
15
16
17 *** Test Cases ***
18 Check OpenStack Networks
19     [Documentation]    Checking OpenStack Neutron for known networks
20     [Tags]    network neutron openstack
21     Log    ${X-AUTH}
22     ${resp}    get request    OSSession    ${OSREST}
23     Should be Equal As Strings    ${resp.status_code}    200
24     ${OSResult}    To Json    ${resp.text}
25     Log    ${OSResult}
26
27 Check OpenDaylight Networks
28     [Documentation]    Checking OpenDaylight Neutron API for known networks
29     [Tags]    network neutron opendaylight
30     Create Session    ODLSession    http://${ODL_SYSTEM_IP}:${PORT}    headers=${HEADERS}    auth=${AUTH}
31     ${resp}    get request    ODLSession    ${NEUTRON_NETWORKS_API}
32     Should be Equal As Strings    ${resp.status_code}    200
33     ${ODLResult}    To Json    ${resp.text}
34     Log    ${ODLResult}
35
36 Create Network
37     [Documentation]    Create new network in OpenStack
38     [Tags]    create network openstack neutron
39     Log    ${postNet}
40     ${resp}    post request    OSSession    ${OSREST}    data=${postNet}
41     Should be Equal As Strings    ${resp.status_code}    201
42     ${result}    To JSON    ${resp.text}
43     ${result}    Get From Dictionary    ${result}    network
44     ${NETID}    Get From Dictionary    ${result}    id
45     Log    ${result}
46     Log    ${NETID}
47     Set Global Variable    ${NETID}
48     sleep    2
49
50 Check Network
51     [Documentation]    Check network created in OpenDaylight
52     [Tags]    check    network opendaylight
53     ${resp}    get request    ODLSession    ${NEUTRON_NETWORKS_API}/${NetID}
54     Should be Equal As Strings    ${resp.status_code}    200