Update Robot Framework format - step 13
[integration/test.git] / csit / suites / openstack / neutron / 030__ports.robot
1 *** Settings ***
2 Documentation       Checking Port 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/ports
14 ${data}         {"port":{"network_id":"${NETID}","admin_state_up": true}}
15
16
17 *** Test Cases ***
18 Check OpenStack ports
19     [Documentation]    Checking OpenStack Neutron for known ports
20     [Tags]    ports 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 ports
28     [Documentation]    Checking OpenDaylight Neutron API for known ports
29     [Tags]    ports neutron opendaylight
30     Create Session    ODLSession    http://${ODL_SYSTEM_IP}:${PORT}    headers=${HEADERS}    auth=${AUTH}
31     ${resp}    get request    ODLSession    ${NEUTRON_PORTS_API}
32     Should be Equal As Strings    ${resp.status_code}    200
33     ${ODLResult}    To Json    ${resp.text}
34     Log    ${ODLResult}
35
36 Create New Port
37     [Documentation]    Create new port in OpenStack
38     [Tags]    create port openstack neutron
39     Log    ${data}
40     ${resp}    post request    OSSession    ${OSREST}    data=${data}
41     Should be Equal As Strings    ${resp.status_code}    201
42     ${result}    To JSON    ${resp.text}
43     ${result}    Get From Dictionary    ${result}    port
44     ${PORTID}    Get From Dictionary    ${result}    id
45     Log    ${result}
46     Log    ${PORTID}
47     Set Global Variable    ${PORTID}
48     sleep    2
49
50 Check New Port
51     [Documentation]    Check new port created in OpenDaylight
52     [Tags]    check port opendaylight
53     ${resp}    get request    ODLSession    ${NEUTRON_PORTS_API}/${PORTID}
54     Should be Equal As Strings    ${resp.status_code}    200