2 Documentation Test suite for the switch manager bundle.
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/Topologynew.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}
27 [Documentation] Get a node
28 Get node openflow:2 MD_SAL
30 [Documentation] Add a property to node
31 Add property to node MD_SAL openflow:2 description Switch2
32 Node property should exist MD_SAL openflow:2 description Switch2
34 #Remove property from node
35 # [Documentation] Remove a property from node
36 # Remove property from node MD_SAL openflow:2 description
37 # Node property should not exist MD_SAL openflow:2 description Switch2
38 Add property to nodeconnector
39 [Documentation] Add a property to nodeconnector
40 Add property to nodeconnector MD_SAL openflow:2 MD_SAL openflow:2:2 bandwidth 1000
41 Nodeconnector property should exist MD_SAL openflow:2 MD_SAL openflow:2:2 bandwidth ${1000}
42 Remove property from nodeconnector
43 [Documentation] Remove a property from nodeconnector
44 Remove property from nodeconnector MD_SAL openflow:2 MD_SAL openflow:2:2 bandwidth
45 Nodeconnector property should not exist MD_SAL openflow:2 MD_SAL openflow:2:2 bandwidth ${1000}
49 [Arguments] ${node_id} ${node_type}
50 [Documentation] Get a specific node
51 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/default/nodes
52 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
53 ${result} TO JSON ${resp.content}
54 ${node} Create Dictionary id ${node_id} type ${node_type}
55 ${content} Extract All Nodes ${result}
57 List Should Contain Value ${content} ${node}
60 [Arguments] ${node_type} ${node_id} ${property} ${value}
61 [Documentation] Add property to node
62 ${resp} Put ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}/${value}
63 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
65 Remove property from node
66 [Arguments] ${node_type} ${node_id} ${property}
67 [Documentation] Remove property from node
68 ${resp} Delete ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}/property/${property}
69 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
71 Add property to nodeconnector
72 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
73 [Documentation] Add property to nodeconnector
74 ${resp} Put ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}/${value}
75 Should Be Equal As Strings ${resp.status_code} 201 Response status code error
77 Remove property from nodeconnector
78 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property}
79 [Documentation] Remove property from nodeconnector
80 ${resp} Delete ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodeconnector/${node_type}/${node_id}/${nc_type}/${nc_id}/property/${property}
81 Should Be Equal As Strings ${resp.status_code} 204 Response status code error
83 Node property should exist
84 [Arguments] ${node_type} ${node_id} ${property} ${value}
85 [Documentation] Property of node should exist
86 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
87 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
88 ${result} TO JSON ${resp.content}
90 ${nodes} Extract All Nodes ${result}
91 ${property_values} Extract Node Property Values ${result} ${property}
92 ${node} Create Dictionary id ${node_id} type ${node_type}
93 ${property_value} Create Dictionary value ${value}
95 List Should Contain Value ${nodes} ${node}
96 List Should Contain Value ${property_values} ${property_value}
98 Node property should not exist
99 [Arguments] ${node_type} ${node_id} ${property} ${value}
100 [Documentation] Property of node should not exist
101 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/nodes
102 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
103 ${result} TO JSON ${resp.content}
105 ${nodes} Extract All Nodes ${result}
106 ${properties} Extract Node Property Values ${result} ${property}
107 ${node} Create Dictionary id ${node_id} type ${node_type}
108 ${property} Create Dictionary value ${value}
110 List Should Contain Value ${nodes} ${node}
111 List Should Not Contain Value ${properties} ${property}
113 Nodeconnector property should exist
114 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
115 [Documentation] Property of nodeconnector should exist
116 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
117 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
118 ${result} TO JSON ${resp.content}
120 ${property_values} Extract Nodeconnector Property Values ${result} ${property}
121 Log ${property_values}
122 ${property_value} Create Dictionary value ${value}
123 List Should Contain Value ${property_values} ${property_value}
125 Nodeconnector property should not exist
126 [Arguments] ${node_type} ${node_id} ${nc_type} ${nc_id} ${property} ${value}
127 [Documentation] Property of nodeconnector should not exist
128 ${resp} Get ${ODL_CONTROLLER_SESSION} ${REST_CONTEXT}/${CONTAINER}/node/${node_type}/${node_id}
129 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
130 ${result} TO JSON ${resp.content}
132 ${property_values} Extract Nodeconnector Property Values ${result} ${property}
133 Log ${property_values}
134 ${property_value} Create Dictionary value ${value}
135 List Should not Contain Value ${property_values} ${property_value}
137 List all nodeconnectors of node
138 [Arguments] ${node_type} ${node_id}
139 [Documentation] List all nodeconnectors and properties of node