2 Documentation Test suite for Switch Manager
3 Suite Setup Create Session ${ODL_CONTROLLER_SESSION} http://${CONTROLLER}:8080 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} 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}
26 Check node 1 connectors
27 [Documentation] List node connectors and verify all connectors are there
29 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:01
30 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
31 Should Contain ${resp.content} s1-eth1
32 Should Contain ${resp.content} s1-eth2
33 Check node 2 connectors
34 [Documentation] List node connectors and verify all connectors are there
36 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:02
37 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
38 Should Contain ${resp.content} s2-eth1
39 Should Contain ${resp.content} s2-eth2
40 Should Contain ${resp.content} s2-eth3
41 Check node 3 connectors
42 [Documentation] List node connectors and verify all connectors are there
44 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/node/OF/00:00:00:00:00:00:00:03
45 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
46 Should Contain ${resp.content} s3-eth1
47 Should Contain ${resp.content} s3-eth2
48 Should Contain ${resp.content} s3-eth3
50 [Documentation] Add a property to node
51 Add property to node OF 00:00:00:00:00:00:00:02 description Switch2
52 Node property should exist OF 00:00:00:00:00:00:00:02 description Switch2
53 #Remove property from node
54 # [Documentation] Remove a property from node
55 # Remove property from node OF 00:00:00:00:00:00:00:02 description
56 # Node property should not exist OF 00:00:00:00:00:00:00:02 description Switch2
57 Add property to nodeconnector
58 [Documentation] Add a property to nodeconnector
59 Add property to nodeconnector OF 00:00:00:00:00:00:00:02 OF 2 bandwidth 1000
60 Nodeconnector property should exist OF 00:00:00:00:00:00:00:02 OF 2 bandwidth ${1000}
62 Remove property from nodeconnector
63 [Documentation] Remove a property from nodeconnector
64 Remove property from nodeconnector OF 00:00:00:00:00:00:00:02 OF 2 bandwidth
65 Nodeconnector property should not exist OF 00:00:00:00:00:00:00:02 OF 2 bandwidth ${1000}
69 [Arguments] ${node_id} ${node_type}
70 [Documentation] Get a specific node
71 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
72 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
73 ${result} TO JSON ${resp.content}
74 ${node} Create Dictionary id ${node_id} type ${node_type}
75 ${content} Extract All Nodes ${result}
77 List Should Contain Value ${content} ${node}
80 [Arguments] ${node_type} ${node_id} ${property} ${value}
81 [Documentation] Add property to node
82 ${resp} Put ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}/${value}
83 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
85 Remove property from node
86 [Arguments] ${node_type} ${node_id} ${property}
87 [Documentation] Remove property from node
88 ${resp} Delete ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}
89 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
91 Add property to nodeconnector
92 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
93 [Documentation] Add property to nodeconnector
94 ${resp} Put ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}/${value}
95 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
97 Remove property from nodeconnector
98 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property}
99 [Documentation] Remove property from nodeconnector
100 ${resp} Delete ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}
101 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
103 Node property should exist
104 [Arguments] ${node_type} ${node_id} ${property} ${value}
105 [Documentation] Property of node should exist
106 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
107 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
108 ${result} TO JSON ${resp.content}
110 ${nodes} Extract All Nodes ${result}
111 ${property_values} Extract Node Property Values ${result} ${property}
112 ${node} Create Dictionary id ${node_id} type ${node_type}
113 ${property_value} Create Dictionary value ${value}
114 Log ${property_value}
115 List Should Contain Value ${nodes} ${node}
116 List Should Contain Value ${property_values} ${property_value}
118 Node property should not exist
119 [Arguments] ${node_type} ${node_id} ${property} ${value}
120 [Documentation] Property of node should not exist
121 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
122 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
123 ${result} TO JSON ${resp.content}
125 ${nodes} Extract All Nodes ${result}
126 ${properties} Extract Node Property Values ${result} ${property}
127 ${node} Create Dictionary id ${node_id} type ${node_type}
128 ${property} Create Dictionary value ${value}
130 List Should Contain Value ${nodes} ${node}
131 List Should Not Contain Value ${properties} ${property}
133 Nodeconnector property should exist
134 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
135 [Documentation] Property of nodeconnector should exist
136 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
137 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
138 ${result} TO JSON ${resp.content}
140 ${property_values} Extract Nodeconnector Property Values ${result} ${property}
141 Log ${property_values}
142 ${property_value} Create Dictionary value ${value}
143 List Should Contain Value ${property_values} ${property_value}
145 Nodeconnector property should not exist
146 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
147 [Documentation] Property of nodeconnector should not exist
148 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
149 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
150 ${result} TO JSON ${resp.content}
152 ${property_values} Extract Nodeconnector Property Values ${result} ${property}
153 Log ${property_values}
154 ${property_value} Create Dictionary value ${value}
155 List Should not Contain Value ${property_values} ${property_value}
157 List all nodeconnectors of node
158 [Arguments] ${node_type} ${node_id}
159 [Documentation] List all nodeconnectors and properties of node