2 Documentation Test suite for RESTCONF inventory
3 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
4 Suite Teardown Delete All Sessions
6 Library RequestsLibrary
7 Library ../../../libraries/Common.py
8 Variables ../../../variables/Variables.py
9 Resource ../../../libraries/Utils.robot
12 ${VENDOR} Nicira, Inc.
13 ${HARDWARE} Open vSwitch
14 @{node_list} openflow:1 openflow:2 openflow:3
15 ${SW_IPADDRESS} "flow-node-inventory:ip-address":"${TOOLS_SYSTEM_IP}"
16 ${SW_VENDOR} "flow-node-inventory:manufacturer":"${VENDOR}"
17 ${SW_HARDWARE} "flow-node-inventory:hardware":"${HARDWARE}"
18 @{SW_CAPABILITIES} "flow-node-inventory:flow-feature-capability-flow-stats" "flow-node-inventory:flow-feature-capability-table-stats" "flow-node-inventory:flow-feature-capability-port-stats" "flow-node-inventory:flow-feature-capability-queue-stats"
22 [Documentation] Get the inventory
23 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${node_list}
26 [Documentation] Check there is no link down. We have 8 ports in total: s1=2, s2=3, s3=3.
27 Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} "link-down":false 8
28 [Teardown] Report_Failure_Due_To_Bug 6595
31 [Documentation] Get the inventory for a node
32 ${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:1:1
34 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1 ${list}
37 [Documentation] Get the inventory for a node
38 ${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:2:1
39 ... openflow:2:2 openflow:2:3
40 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2 ${list}
43 [Documentation] Get the inventory for a node
44 ${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:3:1
45 ... openflow:3:2 openflow:3:3
46 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:3 ${list}
49 [Documentation] Take link s1-s2 down
52 @{list} Create List "link-down":true
53 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
54 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3 ${list}
57 [Documentation] Take link s1-s2 up
60 @{list} Create List "link-down":false
61 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
62 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3 ${list}
65 [Documentation] Remove port s2-eth1
66 Write sh ovs-vsctl del-port s2 s2-eth1
68 @{list} Create List openflow:2:1
69 Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_NODES_API} ${list}
72 [Documentation] Add port s2-eth1, new id 4
73 Write sh ovs-vsctl add-port s2 s2-eth1
75 @{list} Create List openflow:2:4
76 Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${list}