2 Documentation Test suite for Switch Manager
3 Suite Setup Create Session ${ODL_CONTROLLER_SESSION} http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
6 Library RequestsLibrary
7 Library ../../../libraries/Common.py
8 Library ../../../libraries/SwitchManager.py
9 Variables ../../../variables/Variables.py
10 Library ../../../libraries/Topology.py
13 ${REST_CONTEXT} /controller/nb/v2/switchmanager
17 [Documentation] List all nodes and their properties in the network.
19 Log ${TOPO_TREE_LEVEL}
20 ${topo_nodes} Get Nodes From Topology ${TOPO_TREE_LEVEL}
21 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/nodes
22 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
23 ${jsondata}= To JSON ${resp.content}
24 ${nodes} Extract All Nodes ${jsondata}
25 List Should Contain Sublist ${nodes} ${topo_nodes}
27 Check node 1 connectors
28 [Documentation] List node connectors and verify all connectors are there
30 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
31 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
32 Should Contain ${resp.content} s1-eth1
33 Should Contain ${resp.content} s1-eth2
35 Check node 2 connectors
36 [Documentation] List node connectors and verify all connectors are there
38 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:02
39 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
40 Should Contain ${resp.content} s2-eth1
41 Should Contain ${resp.content} s2-eth2
42 Should Contain ${resp.content} s2-eth3
44 Check node 3 connectors
45 [Documentation] List node connectors and verify all connectors are there
47 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:03
48 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
49 Should Contain ${resp.content} s3-eth1
50 Should Contain ${resp.content} s3-eth2
51 Should Contain ${resp.content} s3-eth3
54 [Documentation] Add a property to node
56 Add property to node OF 00:00:00:00:00:00:00:02 description Switch2
57 Node property should exist OF 00:00:00:00:00:00:00:02 description Switch2
58 #Remove property from node
59 # [Documentation] Remove a property from node
60 # Remove property from node OF 00:00:00:00:00:00:00:02 description
61 # Node property should not exist OF 00:00:00:00:00:00:00:02 description Switch2
63 Add property to nodeconnector
64 [Documentation] Add a property to nodeconnector
66 Add property to nodeconnector OF 00:00:00:00:00:00:00:02 OF 2 bandwidth 1000
67 Nodeconnector property should exist OF 00:00:00:00:00:00:00:02 OF 2 bandwidth ${1000}
69 Remove property from nodeconnector
70 [Documentation] Remove a property from nodeconnector
72 Remove property from nodeconnector OF 00:00:00:00:00:00:00:02 OF 2 bandwidth
73 Nodeconnector property should not exist OF 00:00:00:00:00:00:00:02 OF 2 bandwidth ${1000}
77 [Arguments] ${node_id} ${node_type}
78 [Documentation] Get a specific node
79 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
80 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
81 ${result} TO JSON ${resp.content}
82 ${node} Create Dictionary id ${node_id} type ${node_type}
83 ${content} Extract All Nodes ${result}
85 List Should Contain Value ${content} ${node}
88 [Arguments] ${node_type} ${node_id} ${property} ${value}
89 [Documentation] Add property to node
90 ${resp} RequestsLibrary.Put ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}/${value}
91 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
93 Remove property from node
94 [Arguments] ${node_type} ${node_id} ${property}
95 [Documentation] Remove property from node
96 ${resp} RequestsLibrary.Delete ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}
97 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
99 Add property to nodeconnector
100 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
101 [Documentation] Add property to nodeconnector
102 ${resp} RequestsLibrary.Put ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}/${value}
103 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
105 Remove property from nodeconnector
106 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property}
107 [Documentation] Remove property from nodeconnector
108 ${resp} RequestsLibrary.Delete ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}
109 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
111 Node property should exist
112 [Arguments] ${node_type} ${node_id} ${property} ${value}
113 [Documentation] Property of node should exist
114 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
115 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
116 ${result} TO JSON ${resp.content}
118 ${nodes} Extract All Nodes ${result}
119 ${property_values} Extract Node Property Values ${result} ${property}
120 ${node} Create Dictionary id ${node_id} type ${node_type}
121 ${property_value} Create Dictionary value ${value}
122 Log ${property_value}
123 List Should Contain Value ${nodes} ${node}
124 List Should Contain Value ${property_values} ${property_value}
126 Node property should not exist
127 [Arguments] ${node_type} ${node_id} ${property} ${value}
128 [Documentation] Property of node should not exist
129 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
130 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
131 ${result} TO JSON ${resp.content}
133 ${nodes} Extract All Nodes ${result}
134 ${properties} Extract Node Property Values ${result} ${property}
135 ${node} Create Dictionary id ${node_id} type ${node_type}
136 ${property} Create Dictionary value ${value}
138 List Should Contain Value ${nodes} ${node}
139 List Should Not Contain Value ${properties} ${property}
141 Nodeconnector property should exist
142 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
143 [Documentation] Property of nodeconnector should exist
144 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
145 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
146 ${result} TO JSON ${resp.content}
148 ${property_values} Extract Nodeconnector Property Values ${result} ${property}
149 Log ${property_values}
150 ${property_value} Create Dictionary value ${value}
151 List Should Contain Value ${property_values} ${property_value}
153 Nodeconnector property should not exist
154 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
155 [Documentation] Property of nodeconnector should not exist
156 ${resp} RequestsLibrary.Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
157 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
158 ${result} TO JSON ${resp.content}
160 ${property_values} Extract Nodeconnector Property Values ${result} ${property}
161 Log ${property_values}
162 ${property_value} Create Dictionary value ${value}
163 List Should not Contain Value ${property_values} ${property_value}
165 List all nodeconnectors of node
166 [Arguments] ${node_type} ${node_id}
167 [Documentation] List all nodeconnectors and properties of node