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}
50 [Documentation] Get the inventory for a node
51 ${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:1:1
53 Wait Until Keyword Succeeds
56 ... Check For Elements At URI
57 ... ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
61 [Documentation] Get the inventory for a node
62 ${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:2:1
63 ... openflow:2:2 openflow:2:3
64 Wait Until Keyword Succeeds
67 ... Check For Elements At URI
68 ... ${RFC8040_NODES_API}/node=openflow%3A2?${RFC8040_OPERATIONAL_CONTENT}
72 [Documentation] Get the inventory for a node
73 ${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:3:1
74 ... openflow:3:2 openflow:3:3
75 Wait Until Keyword Succeeds
78 ... Check For Elements At URI
79 ... ${RFC8040_NODES_API}/node=openflow%3A3?${RFC8040_OPERATIONAL_CONTENT}
83 [Documentation] Take link s1-s2 down
86 @{list} Create List "link-down":true
87 Wait Until Keyword Succeeds
90 ... Check For Elements At URI
91 ... ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}
93 Wait Until Keyword Succeeds
96 ... Check For Elements At URI
97 ... ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}
101 [Documentation] Take link s1-s2 up
104 @{list} Create List "link-down":false
105 Wait Until Keyword Succeeds
108 ... Check For Elements At URI
109 ... ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}
111 Wait Until Keyword Succeeds
114 ... Check For Elements At URI
115 ... ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT}
119 [Documentation] Remove port s2-eth1
121 Write sh ovs-vsctl del-port s2 s2-eth1
123 @{list} Create List openflow:2:1
124 Wait Until Keyword Succeeds
127 ... Check For Elements Not At URI
128 ... ${RFC8040_OPERATIONAL_NODES_API}
132 [Documentation] Add port s2-eth1, new id 4
134 Write sh ovs-vsctl add-port s2 s2-eth1
136 @{list} Create List openflow:2:4
137 Wait Until Keyword Succeeds
140 ... Check For Elements At URI
141 ... ${RFC8040_OPERATIONAL_NODES_API}