2 Documentation Test Suite for elan interface and service recovery
6 Resource ../../../libraries/DevstackUtils.robot
7 Resource ../../../libraries/FlowLib.robot
8 Resource ../../../libraries/KarafKeywords.robot
9 Resource ../../../libraries/OpenStackOperations.robot
10 Resource ../../../libraries/OVSDB.robot
11 Resource ../../../libraries/SetupUtils.robot
12 Resource ../../../libraries/Utils.robot
13 Resource ../../../libraries/VpnOperations.robot
14 Resource ../../../variables/netvirt/Variables.robot
15 Resource ../../../variables/Variables.robot
17 Suite Setup Suite Setup
18 Suite Teardown OpenStackOperations.OpenStack Suite Teardown
19 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
20 Test Teardown OpenStackOperations.Get Test Teardown Debugs
24 ${REQ_NETWORK} elansr_net_1
25 ${REQ_SUBNET} elansr_sub_1
26 ${REQ_SUBNET_CIDR} 85.1.0.0/16
27 ${SECURITY_GROUP} elansr_sg
28 ${SERVICE-STATUS-CLI} srm:recover service elan
29 ${INTERFACE-STATUS-CLI} srm:recover instance elan-interface
30 ${NUM_OF_PORTS_PER_HOST} 2
31 @{NET_1_VMS} elansr_net_1_vm_1 elansr_net_1_vm_2
32 @{NET_2_VMS} elansr_net_2_vm_3 elansr_net_2_vm_4
33 @{PORT_LIST} elansr_net_1_port_1 elansr_net_1_port_2 elansr_net_1_port_3 elansr_net_1_port_4
37 To Verify ELAN Service Recovery
38 [Documentation] To Verify Elan Service recovery by deleting and recovering multiple flows
39 OVSDB.Verify Dump Flows For Specific Table
41 ... ${ELAN_SMAC_TABLE}
44 ... dl_src=${PORT_MAC_ADDR}[0]
45 ... actions=goto_table:${ELAN_DMACTABLE}
46 OVSDB.Verify Dump Flows For Specific Table
48 ... ${ELAN_SMAC_TABLE}
51 ... dl_src=${PORT_MAC_ADDR}[2]
52 ... actions=goto_table:${ELAN_DMACTABLE}
53 ${flow_id} = FlowLib.Get Flow Id ${DPNID_1} ${ELAN_SMAC_TABLE} ${PORT_MAC_ADDR}[0]
54 FlowLib.Delete Flow Via Restconf ${DPNID_1} ${ELAN_SMAC_TABLE} ${flow_id}
55 ${flow_id} = FlowLib.Get Flow Id ${DPNID_2} ${ELAN_SMAC_TABLE} ${PORT_MAC_ADDR}[2]
56 FlowLib.Delete Flow Via Restconf ${DPNID_2} ${ELAN_SMAC_TABLE} ${flow_id}
57 ${mac_elements} = BuiltIn.Create List ${PORT_MAC_ADDR}[0]
58 Utils.Check For Elements Not At URI
59 ... ${CONFIG_NODES_API}/node/openflow:${DPNID_1}/table/${ELAN_SMAC_TABLE}
61 ${mac_elements} = BuiltIn.Create List ${PORT_MAC_ADDR}[2]
62 Utils.Check For Elements Not At URI
63 ... ${CONFIG_NODES_API}/node/openflow:${DPNID_2}/table/${ELAN_SMAC_TABLE}
65 BuiltIn.Wait Until Keyword Succeeds
68 ... OVSDB.Verify Dump Flows For Specific Table
70 ... ${ELAN_SMAC_TABLE}
73 ... dl_src=${PORT_MAC_ADDR}[0]
74 BuiltIn.Wait Until Keyword Succeeds
77 ... OVSDB.Verify Dump Flows For Specific Table
79 ... ${ELAN_SMAC_TABLE}
82 ... dl_src=${PORT_MAC_ADDR}[2]
83 KarafKeywords.Issue Command On Karaf Console ${SERVICE-STATUS-CLI}
84 OVSDB.Verify Dump Flows For Specific Table
86 ... ${ELAN_SMAC_TABLE}
89 ... dl_src=${PORT_MAC_ADDR}[0]
90 ... actions=goto_table:${ELAN_DMACTABLE}
91 OVSDB.Verify Dump Flows For Specific Table
93 ... ${ELAN_SMAC_TABLE}
96 ... dl_src=${PORT_MAC_ADDR}[2]
97 ... actions=goto_table:${ELAN_DMACTABLE}
98 ${mac_elements} = BuiltIn.Create List ${PORT_MAC_ADDR}[0]
99 Utils.Check For Elements At URI
100 ... ${CONFIG_NODES_API}/node/openflow:${DPNID_1}/table/${ELAN_SMAC_TABLE}
102 ${mac_elements} = BuiltIn.Create List ${PORT_MAC_ADDR}[2]
103 Utils.Check For Elements At URI
104 ... ${CONFIG_NODES_API}/node/openflow:${DPNID_2}/table/${ELAN_SMAC_TABLE}
107 To Verify Elan Interface recovery
108 [Documentation] To Verify the Elan Interface recovery by deleting single Flow
109 BuiltIn.Wait Until Keyword Succeeds
112 ... OVSDB.Verify Dump Flows For Specific Table
114 ... ${ELAN_SMAC_TABLE}
117 ... dl_src=${PORT_MAC_ADDR}[0]
118 ... actions=goto_table:${ELAN_DMACTABLE}
119 ${flow_id} = FlowLib.Get Flow Id ${DPNID_1} ${ELAN_SMAC_TABLE} ${PORT_MAC_ADDR}[0]
120 FlowLib.Delete Flow Via Restconf ${DPNID_1} ${ELAN_SMAC_TABLE} ${flow_id}
121 ${mac_elements} = BuiltIn.Create List ${PORT_MAC_ADDR}[0]
122 Utils.Check For Elements Not At URI
123 ... ${CONFIG_NODES_API}/node/openflow:${DPNID_1}/table/${ELAN_SMAC_TABLE}
125 BuiltIn.Wait Until Keyword Succeeds
128 ... OVSDB.Verify Dump Flows For Specific Table
130 ... ${ELAN_SMAC_TABLE}
133 ... dl_src=${PORT_MAC_ADDR}[0]
134 ${elan_instance_id} = Get Elan Instance ID
135 ${elan_interface_id} = Get Elan Interfaces ID ${elan_instance_id} ${PORT_MAC_ADDR}[0]
136 Recover Elan Flows ${elan_interface_id}
137 ${mac_elements} = BuiltIn.Create List ${PORT_MAC_ADDR}[0]
138 BuiltIn.Wait Until Keyword Succeeds
141 ... Utils.Check For Elements At URI
142 ... ${CONFIG_NODES_API}/node/openflow:${DPNID_1}/table/${ELAN_SMAC_TABLE}
144 OVSDB.Verify Dump Flows For Specific Table
146 ... ${ELAN_SMAC_TABLE}
149 ... dl_src=${PORT_MAC_ADDR}[0]
150 ... actions=goto_table:${ELAN_DMACTABLE}
155 [Documentation] Test Suite for Elan interface and service recovery
156 OpenStackOperations.OpenStack Suite Setup
158 OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS}
159 OpenStackOperations.Get Suite Debugs
162 [Documentation] Create required number of ports under previously created subnets
163 FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST}
164 OpenStackOperations.Create Port ${REQ_NETWORK} ${PORT_LIST}[${index}] sg=${SECURITY_GROUP}
165 OpenStackOperations.Create Port ${REQ_NETWORK} ${PORT_LIST}[${index + 2}] sg=${SECURITY_GROUP}
167 @{PORT_MAC_ADDR} = OpenStackOperations.Get Ports MacAddr ${PORT_LIST}
168 BuiltIn.Set Suite Variable @{PORT_MAC_ADDR}
171 [Documentation] Create Vm instances on compute nodes
172 [Arguments] ${num_of_vms_per_dpn}
173 FOR ${index} IN RANGE 0 ${num_of_vms_per_dpn}
174 OpenStackOperations.Create Vm Instance With Port On Compute Node
175 ... ${PORT_LIST}[${index}]
176 ... ${NET_1_VMS}[${index}]
177 ... ${OS_CMP1_HOSTNAME}
178 ... sg=${SECURITY_GROUP}
179 OpenStackOperations.Create Vm Instance With Port On Compute Node
180 ... ${PORT_LIST}[${index + 2}]
181 ... ${NET_2_VMS}[${index}]
182 ... ${OS_CMP2_HOSTNAME}
183 ... sg=${SECURITY_GROUP}
185 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
186 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
187 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
188 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
189 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
190 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
193 [Documentation] Create basic topology
194 BuiltIn.Wait Until Keyword Succeeds 60s 10s VpnOperations.Verify Tunnel Status as UP
195 OpenStackOperations.Create Network ${REQ_NETWORK}
196 OpenStackOperations.Create SubNet ${REQ_NETWORK} ${REQ_SUBNET} ${REQ_SUBNET_CIDR}
197 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
200 ${DPNID_1} = OVSDB.Get DPID ${OS_CMP1_IP}
201 ${DPNID_2} = OVSDB.Get DPID ${OS_CMP2_IP}
202 BuiltIn.Set Suite Variable ${DPNID_1}
203 BuiltIn.Set Suite Variable ${DPNID_2}
206 [Documentation] Retrieving ELAN instance ID
207 ${output} = KarafKeywords.Issue Command On Karaf Console elaninterface:show
208 ${elan_instance} = String.Split String ${output}
209 ${elan_instance_with_tag} = BuiltIn.Set Variable ${elan_instance[5]}
210 ${elan_instance_id} = String.Split String ${elan_instance_with_tag} /
211 RETURN ${elan_instance_id}[0]
213 Get Elan Interfaces ID
214 [Documentation] Getting the ELAN interface ID with corresponding mac address and returning interface ID list
215 [Arguments] ${elan_id} ${mac}
216 ${elan_output} = KarafKeywords.Issue Command On Karaf Console elanmactable:show ${elan_id}
217 ${interface_id} = String.Get Regexp Matches ${elan_output} (${REGEX_UUID})\\s*${mac} 1
218 RETURN ${interface_id}[0]
221 [Documentation] Recover ELAN flows for the given interfaces
222 [Arguments] ${interface}
223 ${recover_msg} = KarafKeywords.Issue Command On Karaf Console ${INTERFACE-STATUS-CLI} ${interface}
224 BuiltIn.Should Contain ${recover_msg} RPC call to recover was successful