2 Documentation Test suite to test cluster connection and propagation switchover using virtual IP, this suite requires additional TOOLS_SYSTEM_2 VM.
3 ... VM is used for its assigned ip-address that will be overlayed by virtual-ip used in test suites.
4 ... Resources of this VM are not required. At suite start this node is shutted down to reduce routing conflicts.
5 Suite Setup Setup Custom SXP Cluster Session
6 Suite Teardown Clean Custom SXP Cluster Session
7 Test Teardown Clean Custom SXP Cluster
8 Library ../../../libraries/Sxp.py
9 Resource ../../../libraries/ClusterManagement.robot
10 Resource ../../../libraries/SxpClusterLib.robot
16 Isolation Of SXP Service Follower W/O Bindings Listener Test
17 [Documentation] Test SXP connection switchover only if Controller with SCS is isolated
18 Setup Nodes And Connections listener
19 ${controller_index} = SxpClusterLib.Get Owner Controller
20 Isolate SXP Controller ${controller_index} listener
22 Isolation Of SXP Service Follower W/O Bindings Speaker Test
23 [Documentation] Test SXP connection switchover only if Controller with SCS is isolated
24 Setup Nodes And Connections speaker
25 ${controller_index} = SxpClusterLib.Get Owner Controller
26 Isolate SXP Controller ${controller_index} speaker
28 Isolation Of SXP Service Follower Listener Test
29 [Documentation] Test SXP binding propagation only if Controller with SCS is isolated
30 Setup Nodes And Connections listener
31 ${controller_index} = SxpClusterLib.Get Owner Controller
32 Add Bindings To Node ${CLUSTER_NODE_ID} ClusterManagement__session_${controller_index}
33 Isolate SXP Controller With Bindings ${controller_index} ${DEVICE_NODE_ID} listener ${DEVICE_SESSION}
35 Isolation Of SXP Service Follower Speaker Test
36 [Documentation] Test SXP binding propagation only if Controller with SCS is isolated,
37 ... the same case as above but with initiator of connection between nodes in oposite mode
38 Setup Nodes And Connections speaker
39 Add Bindings To Node ${DEVICE_NODE_ID} ${DEVICE_SESSION}
40 ${controller_index} = SxpClusterLib.Get Owner Controller
41 Isolate SXP Controller With Bindings ${controller_index} ${CLUSTER_NODE_ID} speaker ClusterManagement__session_${controller_index}
44 Setup Custom SXP Cluster Session
45 [Documentation] Prepare topology for testing, creates sessions and generate Route definitions based on Cluster nodes ip
46 SxpClusterLib.Shutdown Tools Node
47 SxpClusterLib.Create Virtual Interface
48 SxpClusterLib.Setup SXP Cluster Session
49 SxpClusterLib.Setup Device Session
50 Retrieve Mac-addresses
53 Retrieve Mac-addresses
54 [Documentation] Create list of ODL nodes mac-addresses
55 ${mac_addresses} = SxpClusterLib.Map Followers To Mac Addresses
56 BuiltIn.Set Suite Variable ${MAC_ADDRESS_TABLE} ${mac_addresses}
59 [Documentation] Enable routing to cluster through virtual IP
60 ${route} = Sxp.Route Definition Xml ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE}
61 ${routes} = Sxp.Route Definitions Xml ${route}
62 SxpLib.Put Routing Configuration To Controller ${routes} ${CONTROLLER_SESSION}
64 Clean Custom SXP Cluster Session
65 [Documentation] Cleans up resources generated by test
66 SxpLib.Clean Routing Configuration To Controller ${CONTROLLER_SESSION}
67 SxpClusterLib.Clean SXP Cluster Session
68 SxpClusterLib.Delete Virtual Interface
70 Setup Nodes And Connections
71 [Arguments] ${peer_mode}
72 [Documentation] Setup and connect SXP cluster topology
73 ${cluster_mode} = Sxp.Get Opposing Mode ${peer_mode}
74 ${controller_id} = SxpClusterLib.Get Owner Controller
75 SxpLib.Add Node ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
76 SxpLib.Add Connection version4 ${peer_mode} ${VIRTUAL_IP} 64999 ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
77 SxpLib.Add Node ${CLUSTER_NODE_ID} session=ClusterManagement__session_${controller_id}
78 SxpLib.Add Connection version4 ${cluster_mode} ${DEVICE_NODE_ID} 64999 ${CLUSTER_NODE_ID} session=ClusterManagement__session_${controller_id}
79 BuiltIn.Wait Until Keyword Succeeds 20 1 SxpLib.Check Node Started ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
80 BuiltIn.Wait Until Keyword Succeeds 20 1 SxpLib.Check Node started ${CLUSTER_NODE_ID} system=${ODL_SYSTEM_${controller_id}_IP} session=ClusterManagement__session_${controller_id}
81 BuiltIn.Wait Until Keyword Succeeds 120 1 Check Device is Connected mode=${peer_mode}
82 BuiltIn.Wait Until Keyword Succeeds 120 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${controller_id}
84 Clean Custom SXP Cluster
85 [Documentation] Disconnect SXP cluster topology
86 SxpLib.Delete Node ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
87 SxpLib.Delete Node ${CLUSTER_NODE_ID} session=${CONTROLLER_SESSION}
90 [Arguments] ${node} ${session}
91 [Documentation] Setup initial bindings to SXP device
92 : FOR ${i} IN RANGE 1 ${BINDINGS}
93 \ SxpLib.Add Bindings ${i}0 ${i}.${i}.${i}.${i}/32 node=${node} session=${session}
95 Isolate SXP Controller
96 [Arguments] ${controller_index} ${peer_mode}
97 [Documentation] Isolate one of cluster nodes and perform check that Device is still connected then revert isolation (and check connection again).
98 ${cluster_mode} = Sxp.Get Opposing Mode ${peer_mode}
99 @{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
100 BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_False ${controller_index}
101 BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${controller_index}
102 ${running_member} = Collections.Get From List ${running_members} 0
103 ${active_follower} = SxpClusterLib.Get Owner Controller ${running_member}
104 BuiltIn.Wait Until Keyword Succeeds 240 1 SXpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_follower}
105 BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${active_follower}
106 BuiltIn.Wait Until Keyword Succeeds 240 1 Check Device is Connected mode=${peer_mode}
107 ClusterManagement.Flush_Iptables_From_List_Or_All
108 BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${controller_index}
109 BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${active_follower}
110 BuiltIn.Wait Until Keyword Succeeds 240 1 Check Device is Connected mode=${peer_mode}
112 Isolate SXP Controller With Bindings
113 [Arguments] ${controller_index} ${node} ${peer_mode} ${session}=${EMPTY}
114 [Documentation] Isolate one of cluster nodes and perform check that bindings were propagated then revert isolation (and check connection again).
115 ${cluster_mode} = Sxp.Get Opposing Mode ${peer_mode}
116 @{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
117 BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_False ${controller_index}
118 BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${controller_index}
119 ${running_member} = Collections.Get From List ${running_members} 0
120 ${active_follower} = SxpClusterLib.Get Owner Controller ${running_member}
121 BuiltIn.Wait Until Keyword Succeeds 240 1 SXpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_follower}
122 BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${active_follower}
123 BuiltIn.Wait Until Keyword Succeeds 240 1 Check Device is Connected mode=${peer_mode}
124 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${node} ${session}
125 ClusterManagement.Flush_Iptables_From_List_Or_All
126 BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${controller_index}
127 BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${active_follower}
128 BuiltIn.Wait Until Keyword Succeeds 240 1 Check Device is Connected mode=${peer_mode}
129 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${node} ${session}
131 Check Device is Connected
132 [Arguments] ${mode}=any ${version}=version4 ${port}=64999
133 [Documentation] Checks if SXP device is connected to the cluster. It means it has connection to ${VIRTUAL_IP} in state "on"
134 ${resp} = SxpLib.Get Connections node=${DEVICE_NODE_ID} session=${DEVICE_SESSION}
135 SxpLib.Should Contain Connection ${resp} ${VIRTUAL_IP} ${port} ${mode} ${version} on
138 [Arguments] ${node} ${session}
139 [Documentation] Checks that bindings were propagated to Peer
140 ${resp} SxpLib.Get Bindings node=${node} session=${session}
141 : FOR ${i} IN RANGE 1 ${BINDINGS}
142 \ SxpLib.Should Contain Binding ${resp} ${i}0 ${i}.${i}.${i}.${i}/32