2 Documentation Test suite for Connection Manager
4 Library RequestsLibrary
5 Resource ../../../libraries/MininetKeywords.robot
6 Resource ../../../libraries/OVSDB.robot
7 Resource ../../../libraries/SetupUtils.robot
8 Resource ../../../libraries/Utils.robot
9 Resource ../../../variables/Variables.robot
10 Resource ../../../variables/ovsdb/Variables.robot
12 Suite Setup OVSDB.Suite Setup
13 Suite Teardown Suite Teardown
14 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
21 ... ${OVSDB_NODE_PORT}
22 ... ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
23 ... ${TOOLS_SYSTEM_IP}
24 ... ${OVSDB_NODE_PORT}
25 ... ovsdb://${TOOLS_SYSTEM_2_IP}:${OVSDB_NODE_PORT}
26 ... ${TOOLS_SYSTEM_2_IP}
27 ${MN_OPTS_S1} --custom ovsdb.py --topo host,1
28 ${MN_OPTS_S2} --custom ovsdb.py --topo host,2
32 Make the OVS instance to listen for connection
33 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
34 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
35 Utils.Run Command On Mininet ${TOOLS_SYSTEM_2_IP} sudo ovs-vsctl del-manager
36 Utils.Run Command On Mininet ${TOOLS_SYSTEM_2_IP} sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
38 Connect controller to OVSDB Node1
39 [Documentation] Initiate the connection to OVSDB node from controller
40 OVSDB.Connect To Ovsdb Node ${TOOLS_SYSTEM_IP}
42 Connect controller to OVSDB Node2
43 [Documentation] Initiate the connection to OVSDB node from controller
44 OVSDB.Connect To Ovsdb Node ${TOOLS_SYSTEM_2_IP}
46 Get Operational Topology from OVSDB Node1 and OVSDB Node2
47 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
48 BuiltIn.Wait Until Keyword Succeeds
51 ... Utils.Check For Elements At URI
52 ... ${RFC8040_OPERATIONAL_TOPO_API}
54 ... pretty_print_json=True
56 Start the Mininet and create custom topology
57 [Documentation] This will start mininet with custom topology on both the Virtual Machines
58 ${conn_id1} = MininetKeywords.Start Mininet Single Controller
59 ... ${TOOLS_SYSTEM_IP}
62 ... ${OVSDB_CONFIG_DIR}/ovsdb.py
63 ${conn_id2} = MininetKeywords.Start Mininet Single Controller
64 ... ${TOOLS_SYSTEM_2_IP}
67 ... ${OVSDB_CONFIG_DIR}/ovsdb.py
69 Get Operational Topology with custom topology
70 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to make sure the mininet created custom topology
71 @{list} = BuiltIn.Create List s1 s2
72 BuiltIn.Wait Until Keyword Succeeds
75 ... Utils.Check For Elements At URI
76 ... ${RFC8040_OPERATIONAL_TOPO_API}
78 ... pretty_print_json=True
80 Add the bridge s1 in the config datastore of OVSDB Node1
81 [Documentation] This request will add already operational bridge to the config data store of the OVSDB node.
82 OVSDB.Add Bridge To Ovsdb Node
83 ... ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
84 ... ${TOOLS_SYSTEM_IP}
88 Add the bridge s2 in the config datastore of OVSDB Node2
89 [Documentation] This request will add already operational bridge to the config data store of the OVSDB node.
90 OVSDB.Add Bridge To Ovsdb Node
91 ... ${TOOLS_SYSTEM2_IP}:${OVSDB_NODE_PORT}
92 ... ${TOOLS_SYSTEM_2_IP}
96 Get Config Topology with s1 and s2 Bridges
97 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the config data store
98 @{list} = BuiltIn.Create List s1 s2
99 BuiltIn.Wait Until Keyword Succeeds
102 ... Utils.Check For Elements At URI
103 ... ${RFC8040_CONFIG_TOPO_API}
105 ... pretty_print_json=True
107 Create Vxlan Port and attach to s1 Bridge
108 [Documentation] This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s1 of OVSDB node 1
109 OVSDB.Add Vxlan To Bridge ${TOOLS_SYSTEM_IP} s1 s1-s2 ${TOOLS_SYSTEM_2_IP}
111 Create Vxlan Port and attach to s2 Bridge
112 [Documentation] This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s2 of OVSDB node 2
113 OVSDB.Add Vxlan To Bridge ${TOOLS_SYSTEM_2_IP} s2 s2-s1 ${TOOLS_SYSTEM_IP}
115 Get Operational Topology with vxlan tunnel
116 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify that the vxlan tunnel is created
117 @{list} = BuiltIn.Create List s1-s2 s2-s1 ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP}
118 BuiltIn.Wait Until Keyword Succeeds
121 ... Utils.Check For Elements At URI
122 ... ${RFC8040_OPERATIONAL_TOPO_API}
124 ... pretty_print_json=True
126 Delete Bridges from config datastore
127 [Documentation] This request will delete the bridges from config data store.
129 OVSDB.Delete Bridge From Ovsdb Node ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} s1
130 OVSDB.Delete Bridge From Ovsdb Node ${TOOLS_SYSTEM_2_IP}:${OVSDB_NODE_PORT} s2
132 Disconnect controller connection from the connected OVSDBs nodes
133 [Documentation] This request will disconnect the controller from the connected OVSDB node for clean startup for next suite.
135 OVSDB.Disconnect From Ovsdb Node ${TOOLS_SYSTEM_IP}
136 OVSDB.Disconnect From Ovsdb Node ${TOOLS_SYSTEM_2_IP}
138 Verify that the operational topology is clean
139 [Documentation] This request will verify the operational toplogy after the mininet is cleaned.
141 @{list} = BuiltIn.Create List ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} s1 s2
142 BuiltIn.Wait Until Keyword Succeeds
145 ... Utils.Check For Elements Not At URI
146 ... ${RFC8040_OPERATIONAL_TOPO_API}
148 ... pretty_print_json=True
151 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
153 Utils.Check Karaf Log File Does Not Have Messages
155 ... SimpleShardDataTreeCohort.*Unexpected failure in validation phase
156 [Teardown] Utils.Report_Failure_Due_To_Bug 4756
159 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
161 Utils.Check Karaf Log File Does Not Have Messages
163 ... Shard.*shard-topology-operational An exception occurred while preCommitting transaction
164 [Teardown] Utils.Report_Failure_Due_To_Bug 4794
169 [Documentation] Cleans up test environment, close existing sessions.
170 OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
171 OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_2_IP}
172 OVSDB.Log Config And Operational Topology
173 RequestsLibrary.Delete All Sessions