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} 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
52 Add property to node OF 00:00:00:00:00:00:00:02 description Switch2
53 Node property should exist OF 00:00:00:00:00:00:00:02 description Switch2
54 #Remove property from node
55 # [Documentation] Remove a property from node
56 # Remove property from node OF 00:00:00:00:00:00:00:02 description
57 # Node property should not exist OF 00:00:00:00:00:00:00:02 description Switch2
58 Add property to nodeconnector
59 [Documentation] Add a property to nodeconnector
61 Add property to nodeconnector OF 00:00:00:00:00:00:00:02 OF 2 bandwidth 1000
62 Nodeconnector property should exist OF 00:00:00:00:00:00:00:02 OF 2 bandwidth ${1000}
64 Remove property from nodeconnector
65 [Documentation] Remove a property from nodeconnector
67 Remove property from nodeconnector OF 00:00:00:00:00:00:00:02 OF 2 bandwidth
68 Nodeconnector property should not exist OF 00:00:00:00:00:00:00:02 OF 2 bandwidth ${1000}
72 [Arguments] ${node_id} ${node_type}
73 [Documentation] Get a specific node
74 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
75 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
76 ${result} TO JSON ${resp.content}
77 ${node} Create Dictionary id ${node_id} type ${node_type}
78 ${content} Extract All Nodes ${result}
80 List Should Contain Value ${content} ${node}
83 [Arguments] ${node_type} ${node_id} ${property} ${value}
84 [Documentation] Add property to node
85 ${resp} Put ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}/${value}
86 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
88 Remove property from node
89 [Arguments] ${node_type} ${node_id} ${property}
90 [Documentation] Remove property from node
91 ${resp} Delete ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}
92 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
94 Add property to nodeconnector
95 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
96 [Documentation] Add property to nodeconnector
97 ${resp} Put ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}/${value}
98 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
100 Remove property from nodeconnector
101 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property}
102 [Documentation] Remove property from nodeconnector
103 ${resp} Delete ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}
104 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
106 Node property should exist
107 [Arguments] ${node_type} ${node_id} ${property} ${value}
108 [Documentation] Property of node should exist
109 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
110 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
111 ${result} TO JSON ${resp.content}
113 ${nodes} Extract All Nodes ${result}
114 ${property_values} Extract Node Property Values ${result} ${property}
115 ${node} Create Dictionary id ${node_id} type ${node_type}
116 ${property_value} Create Dictionary value ${value}
117 Log ${property_value}
118 List Should Contain Value ${nodes} ${node}
119 List Should Contain Value ${property_values} ${property_value}
121 Node property should not exist
122 [Arguments] ${node_type} ${node_id} ${property} ${value}
123 [Documentation] Property of node should not exist
124 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
125 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
126 ${result} TO JSON ${resp.content}
128 ${nodes} Extract All Nodes ${result}
129 ${properties} Extract Node Property Values ${result} ${property}
130 ${node} Create Dictionary id ${node_id} type ${node_type}
131 ${property} Create Dictionary value ${value}
133 List Should Contain Value ${nodes} ${node}
134 List Should Not Contain Value ${properties} ${property}
136 Nodeconnector property should exist
137 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
138 [Documentation] Property of nodeconnector should exist
139 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
140 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
141 ${result} TO JSON ${resp.content}
143 ${property_values} Extract Nodeconnector Property Values ${result} ${property}
144 Log ${property_values}
145 ${property_value} Create Dictionary value ${value}
146 List Should Contain Value ${property_values} ${property_value}
148 Nodeconnector property should not exist
149 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
150 [Documentation] Property of nodeconnector should not exist
151 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
152 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
153 ${result} TO JSON ${resp.content}
155 ${property_values} Extract Nodeconnector Property Values ${result} ${property}
156 Log ${property_values}
157 ${property_value} Create Dictionary value ${value}
158 List Should not Contain Value ${property_values} ${property_value}
160 List all nodeconnectors of node
161 [Arguments] ${node_type} ${node_id}
162 [Documentation] List all nodeconnectors and properties of node