Update Robot Framework format - step 12
[integration/test.git] / csit / suites / openflowplugin / MD_SAL_NSF_OF10 / 010_restconf_inventory.robot
1 *** Settings ***
2 Documentation       Test suite for RESTCONF inventory
3
4 Library             Collections
5 Library             RequestsLibrary
6 Library             ../../../libraries/Common.py
7 Variables           ../../../variables/Variables.py
8 Resource            ../../../libraries/Utils.robot
9 Resource            ../../../variables/openflowplugin/Variables.robot
10
11 Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
12 Suite Teardown      Delete All Sessions
13
14
15 *** Variables ***
16 ${VENDOR}               Nicira, Inc.
17 ${HARDWARE}             Open vSwitch
18 @{node_list}            openflow:1    openflow:2    openflow:3
19 ${SW_IPADDRESS}         "flow-node-inventory:ip-address":"${TOOLS_SYSTEM_IP}"
20 ${SW_VENDOR}            "flow-node-inventory:manufacturer":"${VENDOR}"
21 ${SW_HARDWARE}          "flow-node-inventory:hardware":"${HARDWARE}"
22 @{SW_CAPABILITIES}
23 ...                     "flow-node-inventory:flow-feature-capability-flow-stats"
24 ...                     "flow-node-inventory:flow-feature-capability-table-stats"
25 ...                     "flow-node-inventory:flow-feature-capability-port-stats"
26 ...                     "flow-node-inventory:flow-feature-capability-queue-stats"
27
28
29 *** Test Cases ***
30 Get list of nodes
31     [Documentation]    Get the inventory
32     Wait Until Keyword Succeeds
33     ...    10s
34     ...    2s
35     ...    Check For Elements At URI
36     ...    ${RFC8040_OPERATIONAL_NODES_API}
37     ...    ${node_list}
38
39 Check No Link Down
40     [Documentation]    Check there is no link down. We have 8 ports in total: s1=2, s2=3, s3=3.
41     Wait Until Keyword Succeeds
42     ...    10s
43     ...    2s
44     ...    Check For Specific Number Of Elements At URI
45     ...    ${RFC8040_OPERATIONAL_NODES_API}
46     ...    "link-down":false
47     ...    8
48     [Teardown]    Report_Failure_Due_To_Bug    6595
49
50 Get node 1 inventory
51     [Documentation]    Get the inventory for a node
52     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:1:1
53     ...    openflow:1:2
54     Wait Until Keyword Succeeds
55     ...    10s
56     ...    2s
57     ...    Check For Elements At URI
58     ...    ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
59     ...    ${list}
60
61 Get node 2 inventory
62     [Documentation]    Get the inventory for a node
63     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:2:1
64     ...    openflow:2:2    openflow:2:3
65     Wait Until Keyword Succeeds
66     ...    10s
67     ...    2s
68     ...    Check For Elements At URI
69     ...    ${RFC8040_NODES_API}/node=openflow%3A2?${RFC8040_OPERATIONAL_CONTENT}
70     ...    ${list}
71
72 Get node 3 inventory
73     [Documentation]    Get the inventory for a node
74     ${list}    Create List    @{SW_CAPABILITIES}    ${SW_VENDOR}    ${SW_IPADDRESS}    ${SW_HARDWARE}    openflow:3:1
75     ...    openflow:3:2    openflow:3:3
76     Wait Until Keyword Succeeds
77     ...    10s
78     ...    2s
79     ...    Check For Elements At URI
80     ...    ${RFC8040_NODES_API}/node=openflow%3A3?${RFC8040_OPERATIONAL_CONTENT}
81     ...    ${list}
82
83 Link Down
84     [Documentation]    Take link s1-s2 down
85     Write    link s1 s2 down
86     Read Until    mininet>
87     @{list}    Create List    "link-down":true
88     Wait Until Keyword Succeeds
89     ...    10s
90     ...    2s
91     ...    Check For Elements At URI
92     ...    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}
93     ...    ${list}
94     Wait Until Keyword Succeeds
95     ...    10s
96     ...    2s
97     ...    Check For Elements At URI
98     ...    ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}
99     ...    ${list}
100
101 Link Up
102     [Documentation]    Take link s1-s2 up
103     Write    link s1 s2 up
104     Read Until    mininet>
105     @{list}    Create List    "link-down":false
106     Wait Until Keyword Succeeds
107     ...    10s
108     ...    2s
109     ...    Check For Elements At URI
110     ...    ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}
111     ...    ${list}
112     Wait Until Keyword Succeeds
113     ...    10s
114     ...    2s
115     ...    Check For Elements At URI
116     ...    ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}
117     ...    ${list}
118
119 Remove Port
120     [Documentation]    Remove port s2-eth1
121     [Tags]    exclude
122     Write    sh ovs-vsctl del-port s2 s2-eth1
123     Read Until    mininet>
124     @{list}    Create List    openflow:2:1
125     Wait Until Keyword Succeeds
126     ...    10s
127     ...    2s
128     ...    Check For Elements Not At URI
129     ...    ${RFC8040_OPERATIONAL_NODES_API}
130     ...    ${list}
131
132 Add Port
133     [Documentation]    Add port s2-eth1, new id 4
134     [Tags]    exclude
135     Write    sh ovs-vsctl add-port s2 s2-eth1
136     Read Until    mininet>
137     @{list}    Create List    openflow:2:4
138     Wait Until Keyword Succeeds
139     ...    10s
140     ...    2s
141     ...    Check For Elements At URI
142     ...    ${RFC8040_OPERATIONAL_NODES_API}
143     ...    ${list}