2 Documentation Test suite for Connection Manager
3 Suite Setup OVSDB.Suite Setup
4 Suite Teardown Suite Teardown
5 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
7 Library RequestsLibrary
8 Resource ../../../libraries/MininetKeywords.robot
9 Resource ../../../libraries/OVSDB.robot
10 Resource ../../../libraries/SetupUtils.robot
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../variables/Variables.robot
15 @{NODE_LIST} ${OVSDB_NODE_PORT} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} ${TOOLS_SYSTEM_IP} ${OVSDB_NODE_PORT} ovsdb://${TOOLS_SYSTEM_2_IP}:${OVSDB_NODE_PORT} ${TOOLS_SYSTEM_2_IP}
16 ${MN_OPTS_S1} --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,1
17 ${MN_OPTS_S2} --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,2
20 Make the OVS instance to listen for connection
21 Utils.Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
22 Utils.Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
23 Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo ovs-vsctl del-manager
24 Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
26 Connect controller to OVSDB Node1
27 [Documentation] Initiate the connection to OVSDB node from controller
28 OVSDB.Connect To Ovsdb Node ${TOOLS_SYSTEM_IP}
30 Connect controller to OVSDB Node2
31 [Documentation] Initiate the connection to OVSDB node from controller
32 OVSDB.Connect To Ovsdb Node ${TOOLS_SYSTEM_2_IP}
34 Get Operational Topology from OVSDB Node1 and OVSDB Node2
35 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
36 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements At URI ${OPERATIONAL_TOPO_API} ${NODE_LIST} pretty_print_json=True
38 Start the Mininet and create custom topology
39 [Documentation] This will start mininet with custom topology on both the Virtual Machines
40 ${conn_id1} = MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_IP} ${ODL_SYSTEM_IP} ${MN_OPTS_S1} ${OVSDB_CONFIG_DIR}/ovsdb.py
41 ${conn_id2} = MininetKeywords.Start Mininet Single Controller ${TOOLS_SYSTEM_2_IP} ${ODL_SYSTEM_IP} ${MN_OPTS_S2} ${OVSDB_CONFIG_DIR}/ovsdb.py
43 Get Operational Topology with custom topology
44 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to make sure the mininet created custom topology
45 @{list} = BuiltIn.Create List s1 s2
46 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list} pretty_print_json=True
48 Add the bridge s1 in the config datastore of OVSDB Node1
49 [Documentation] This request will add already operational bridge to the config data store of the OVSDB node.
50 OVSDB.Add Bridge To Ovsdb Node ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} ${TOOLS_SYSTEM_IP} s1 0000000000000051
52 Add the bridge s2 in the config datastore of OVSDB Node2
53 [Documentation] This request will add already operational bridge to the config data store of the OVSDB node.
54 OVSDB.Add Bridge To Ovsdb Node ${TOOLS_SYSTEM2_IP}:${OVSDB_NODE_PORT} ${TOOLS_SYSTEM_2_IP} s2 0000000000000052
56 Get Config Topology with s1 and s2 Bridges
57 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the config data store
58 @{list} = BuiltIn.Create List s1 s2
59 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements At URI ${CONFIG_TOPO_API} ${list} pretty_print_json=True
61 Create Vxlan Port and attach to s1 Bridge
62 [Documentation] This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s1 of OVSDB node 1
63 OVSDB.Add Vxlan To Bridge ${TOOLS_SYSTEM_IP} s1 s1-s2 ${TOOLS_SYSTEM_2_IP}
65 Create Vxlan Port and attach to s2 Bridge
66 [Documentation] This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s2 of OVSDB node 2
67 OVSDB.Add Vxlan To Bridge ${TOOLS_SYSTEM_2_IP} s2 s2-s1 ${TOOLS_SYSTEM_IP}
69 Get Operational Topology with vxlan tunnel
70 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify that the vxlan tunnel is created
71 @{list} = BuiltIn.Create List s1-s2 s2-s1 ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP}
72 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list} pretty_print_json=True
74 Delete Bridges from config datastore
75 [Documentation] This request will delete the bridges from config data store.
77 OVSDB.Delete Bridge From Ovsdb Node ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} s1
78 OVSDB.Delete Bridge From Ovsdb Node ${TOOLS_SYSTEM_2_IP}:${OVSDB_NODE_PORT} s2
80 Disconnect controller connection from the connected OVSDBs nodes
81 [Documentation] This request will disconnect the controller from the connected OVSDB node for clean startup for next suite.
83 OVSDB.Disconnect From Ovsdb Node ${TOOLS_SYSTEM_IP}
84 OVSDB.Disconnect From Ovsdb Node ${TOOLS_SYSTEM_2_IP}
86 Verify that the operational topology is clean
87 [Documentation] This request will verify the operational toplogy after the mininet is cleaned.
89 @{list} = BuiltIn.Create List ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} s1 s2
90 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list} pretty_print_json=True
93 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
95 Utils.Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} SimpleShardDataTreeCohort.*Unexpected failure in validation phase
96 [Teardown] Utils.Report_Failure_Due_To_Bug 4756
99 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
101 Utils.Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} Shard.*shard-topology-operational An exception occurred while preCommitting transaction
102 [Teardown] Utils.Report_Failure_Due_To_Bug 4794
106 [Documentation] Cleans up test environment, close existing sessions.
107 OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
108 OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_2_IP}
109 ${resp} = RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
110 OVSDB.Log Config And Operational Topology
111 RequestsLibrary.Delete All Sessions