2 Documentation Test suite for RESTCONF inventory
5 Library RequestsLibrary
6 Library ../../../libraries/Common.py
7 Variables ../../../variables/Variables.py
8 Resource ../../../libraries/Utils.robot
9 Resource ../../../variables/openflowplugin/Variables.robot
11 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
12 Suite Teardown Delete All Sessions
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}"
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"
31 [Documentation] Get the inventory
32 Wait Until Keyword Succeeds
35 ... Check For Elements At URI
36 ... ${RFC8040_OPERATIONAL_NODES_API}
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
44 ... Check For Specific Number Of Elements At URI
45 ... ${RFC8040_OPERATIONAL_NODES_API}
48 [Teardown] Report_Failure_Due_To_Bug 6595
51 [Documentation] Get the inventory for a node
52 ${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:1:1
54 Wait Until Keyword Succeeds
57 ... Check For Elements At URI
58 ... ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
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
68 ... Check For Elements At URI
69 ... ${RFC8040_NODES_API}/node=openflow%3A2?${RFC8040_OPERATIONAL_CONTENT}
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
79 ... Check For Elements At URI
80 ... ${RFC8040_NODES_API}/node=openflow%3A3?${RFC8040_OPERATIONAL_CONTENT}
84 [Documentation] Take link s1-s2 down
87 @{list} Create List "link-down":true
88 Wait Until Keyword Succeeds
91 ... Check For Elements At URI
92 ... ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}
94 Wait Until Keyword Succeeds
97 ... Check For Elements At URI
98 ... ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}
102 [Documentation] Take link s1-s2 up
105 @{list} Create List "link-down":false
106 Wait Until Keyword Succeeds
109 ... Check For Elements At URI
110 ... ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}
112 Wait Until Keyword Succeeds
115 ... Check For Elements At URI
116 ... ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}
120 [Documentation] Remove port s2-eth1
122 Write sh ovs-vsctl del-port s2 s2-eth1
124 @{list} Create List openflow:2:1
125 Wait Until Keyword Succeeds
128 ... Check For Elements Not At URI
129 ... ${RFC8040_OPERATIONAL_NODES_API}
133 [Documentation] Add port s2-eth1, new id 4
135 Write sh ovs-vsctl add-port s2 s2-eth1
137 @{list} Create List openflow:2:4
138 Wait Until Keyword Succeeds
141 ... Check For Elements At URI
142 ... ${RFC8040_OPERATIONAL_NODES_API}