Step 1: Move vm scripts to the right place
[integration/test.git] / test / csit / suites / openstack / neutron / 030__ports.robot
1 *** Settings ***
2 Documentation     Checking Port created in OpenStack are pushed to OpenDaylight
3 Suite Setup       Create Session    OSSession    http://${OPENSTACK}:9696    headers=${X-AUTH}
4 Suite Teardown    Delete All Sessions
5 Library           SSHLibrary
6 Library           Collections
7 Library           OperatingSystem
8 Library           RequestsLibrary
9 Library           ../../../libraries/Common.py
10 Variables         ../../../variables/Variables.py
11
12 *** Variables ***
13 ${ODLREST}        /controller/nb/v2/neutron/ports
14 ${OSREST}         /v2.0/ports
15 ${data}           {"port":{"network_id":"${NETID}","admin_state_up": true}}
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    OSSession    ${OSREST}
23     Should be Equal As Strings    ${resp.status_code}    200
24     ${OSResult}    To Json    ${resp.content}
25     Set Suite Variable    ${OSResult}
26     Log    ${OSResult}
27
28 Check OpenDaylight ports
29     [Documentation]    Checking OpenDaylight Neutron API for Known Ports
30     [Tags]    Ports Neutron OpenDaylight
31     Create Session    ODLSession    http://${CONTROLLER}:${PORT}    headers=${HEADERS}    auth=${AUTH}
32     ${resp}    get    ODLSession    ${ODLREST}
33     Should be Equal As Strings    ${resp.status_code}    200
34     ${ODLResult}    To Json    ${resp.content}
35     Set Suite Variable    ${ODLResult}
36     Log    ${ODLResult}
37
38 Create New Port
39     [Documentation]    Create new port in OpenStack
40     [Tags]    Create port OpenStack Neutron
41     Log    ${data}
42     ${resp}    post    OSSession    ${OSREST}    data=${data}
43     Should be Equal As Strings    ${resp.status_code}    201
44     ${result}    To JSON    ${resp.content}
45     ${result}    Get From Dictionary    ${result}    port
46     ${PORTID}    Get From Dictionary    ${result}    id
47     Log    ${result}
48     Log    ${PORTID}
49     Set Global Variable    ${PORTID}
50     sleep    2
51
52 Check New Port
53     [Documentation]    Check new subnet created in OpenDaylight
54     [Tags]    Check subnet OpenDaylight
55     ${resp}    get    ODLSession    ${ODLREST}/${PORTID}
56     Should be Equal As Strings    ${resp.status_code}    200