2 Documentation Test suite to validate elan service functionality in ODL environment.
3 ... The assumption of this suite is that the environment is already configured with the proper
4 ... integration bridges and vxlan tunnels.
5 Suite Setup BuiltIn.Run Keywords OpenStackOperations.Get OvsDebugInfo
6 ... AND Elan SuiteSetup
7 ... AND OpenStackOperations.Get OvsDebugInfo
8 Suite Teardown Elan SuiteTeardown
9 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
10 Test Teardown OpenStackOperations.Get Test Teardown Debugs
11 Library OperatingSystem
12 Library RequestsLibrary
14 Resource ../../../libraries/KarafKeywords.robot
15 Resource ../../../libraries/Utils.robot
16 Resource ../../../libraries/OVSDB.robot
17 Resource ../../../libraries/OpenStackOperations.robot
18 Resource ../../../libraries/DevstackUtils.robot
19 Resource ../../../libraries/SetupUtils.robot
20 Resource ../../../libraries/Tcpdump.robot
21 Resource ../../../variables/Variables.robot
22 Resource ../../../variables/netvirt/Variables.robot
25 ${SECURITY_GROUP} elan_sg
26 @{NETWORKS} elan_net_1 elan_net_2 elan_net_3
27 @{SUBNETS} elan_sub_1 elan_sub_2 elan_sub_3
28 @{SUBNET_CIDRS} 81.1.1.0/24 82.1.1.0/24 83.1.1.0/24
29 @{NET_1_PORTS} elan_net_1_port_1 elan_net_1_port_2
30 @{NET_2_PORTS} elan_net_2_port_1 elan_net_2_port_2
31 @{NET_3_PORTS} elan_net_3_port_1 elan_net_3_port_2
32 @{NET_1_VMS} elan_net_1_vm_1 elan_net_1_vm_2
33 @{NET_2_VMS} elan_net_2_vm_1 elan_net_2_vm_2
34 @{NET_3_VMS} elan_net_3_vm_1 elan_net_3_vm_2
38 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
39 OpenStackOperations.Create Network @{NETWORKS}[0]
40 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] ${SUBNET_CIDRS[0]}
41 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[0]} sg=${SECURITY_GROUP}
42 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[1]} sg=${SECURITY_GROUP}
43 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_1_PORTS}
44 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_COMPUTE_1_IP} sg=${SECURITY_GROUP}
45 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[1]} ${NET_1_VMS[1]} ${OS_COMPUTE_2_IP} sg=${SECURITY_GROUP}
46 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
47 Builtin.Set Suite Variable @{NET_1_VM_IPS}
48 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
49 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
50 @{NET_1_MACS} = BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_1_PORTS}
51 Builtin.Set Suite Variable @{NET_1_MACS}
53 Verify Datapath for Single ELAN with Multiple DPN
54 [Documentation] Verify Flow Table and Datapath
55 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
56 ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1]
57 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
58 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${NET_1_MACS}
59 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
60 BuiltIn.Should Contain ${output} ${PING_REGEXP}
61 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
62 BuiltIn.Should Contain ${output} ${PING_REGEXP}
64 Verify Datapath After OVS Restart
65 [Documentation] Verify datapath after OVS restart
66 OVSDB.Restart OVSDB ${OS_COMPUTE_1_IP}
67 OVSDB.Restart OVSDB ${OS_COMPUTE_2_IP}
68 BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${OS_COMPUTE_1_IP}
69 BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${OS_COMPUTE_2_IP}
70 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
71 ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1]
72 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
73 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${NET_1_MACS}
74 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
75 BuiltIn.Should Contain ${output} ${PING_REGEXP}
76 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
77 BuiltIn.Should Contain ${output} ${PING_REGEXP}
79 Verify Datapath After Recreate VM Instance
80 [Documentation] Verify datapath after recreating Vm instance
81 OpenStackOperations.Delete Vm Instance ${NET_1_VMS[0]}
82 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
83 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1}
84 OpenStackOperations.Remove RSA Key From KnownHosts @{NET_1_VM_IPS}[0]
85 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_COMPUTE_1_IP}
86 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
87 Builtin.Set Suite Variable @{NET_1_VM_IPS}
88 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
89 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
90 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
91 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
92 BuiltIn.Should Contain ${output} ${PING_REGEXP}
93 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
94 BuiltIn.Should Contain ${output} ${PING_REGEXP}
96 Delete All elan_net_1 VM And Verify Flow Table Updated
97 [Documentation] Verify Flow table after all VM instance deleted
98 : FOR ${vm} IN @{NET_1_VMS}
99 \ OpenStackOperations.Delete Vm Instance ${vm}
100 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_1_IP} ${NET_1_MACS}
101 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_2_IP} ${NET_1_MACS}
103 Verify Datapath for Multiple ELAN with Multiple DPN
104 [Documentation] Verify Flow Table and Data path for Multiple ELAN with Multiple DPN
105 [Setup] BuiltIn.Run Keywords SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
106 ... AND MultipleElan Testsuite Setup
107 ${smac_cn1} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[0] @{VM_MACAddr_elan_net_3}[0]
108 ${smac_cn2} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[1] @{VM_MACAddr_elan_net_3}[1]
109 ${MAC_LIST} = BuiltIn.Create List @{VM_MACAddr_elan_net_2} @{VM_MACAddr_elan_net_3}
110 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${MAC_LIST}
111 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${MAC_LIST}
112 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_2_VM_IPS[1]}
113 BuiltIn.Should Contain ${output} ${PING_REGEXP}
114 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_3_VM_IPS[0]}
115 BuiltIn.Should Contain ${output} ${PING_REGEXP}
116 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_3_VM_IPS[0]}
117 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
118 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_2_VM_IPS[1]}
119 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
120 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
121 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
122 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
123 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${MAC_LIST}
124 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPS[1]} ping -c 3 @{NET_2_VM_IPS}[0]
125 BuiltIn.Should Contain ${output} ${PING_REGEXP}
126 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Get Test Teardown Debugs
127 ... AND MultipleElan Testsuite Cleanup
131 [Documentation] Elan suite setup
132 SetupUtils.Setup_Utils_For_Setup_And_Teardown
133 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set DEBUG org.opendaylight.genius.mdsalutil.internal.MDSALManager
134 DevstackUtils.Devstack Suite Setup
137 [Documentation] Elan suite teardown
138 OpenStackOperations.Get OvsDebugInfo
139 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set INFO org.opendaylight.genius.mdsalutil.internal.MDSALManager
140 SingleElan SuiteTeardown
141 SSHLibrary.Close All Connections
143 SingleElan SuiteTeardown
144 [Documentation] Delete network,subnet and port
145 BuiltIn.Log Delete Neutron Ports, Subnet and network
146 : FOR ${Port} IN @{NET_1_PORTS}
147 \ OpenStackOperations.Delete Port ${Port}
148 OpenStackOperations.Delete SubNet @{SUBNETS}[0]
149 OpenStackOperations.Delete Network @{NETWORKS}[0]
150 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
152 SingleElan SuiteSetup
153 [Documentation] Create single ELAN with Multiple DPN
155 MultipleElan Testsuite Setup
156 [Documentation] Create additional ELAN for multipleElan with Multiple DPN test
157 OpenStackOperations.Create Network @{NETWORKS}[1]
158 OpenStackOperations.Create Network @{NETWORKS}[2]
159 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] ${SUBNET_CIDRS[1]}
160 OpenStackOperations.Create SubNet @{NETWORKS}[2] @{SUBNETS}[2] ${SUBNET_CIDRS[2]}
161 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[0]} sg=${SECURITY_GROUP}
162 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[1]} sg=${SECURITY_GROUP}
163 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[0]} sg=${SECURITY_GROUP}
164 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[1]} sg=${SECURITY_GROUP}
165 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_3_PORTS}
166 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[0]} ${NET_2_VMS[0]} ${OS_COMPUTE_1_IP} sg=${SECURITY_GROUP}
167 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[1]} ${NET_2_VMS[1]} ${OS_COMPUTE_2_IP} sg=${SECURITY_GROUP}
168 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[0]} ${NET_3_VMS[0]} ${OS_COMPUTE_1_IP} sg=${SECURITY_GROUP}
169 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[1]} ${NET_3_VMS[1]} ${OS_COMPUTE_2_IP} sg=${SECURITY_GROUP}
170 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
171 @{NET_3_VM_IPS} ${NET_3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
172 Builtin.Set Suite Variable @{NET_2_VM_IPS}
173 Builtin.Set Suite Variable @{NET_3_VM_IPS}
174 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
175 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
176 BuiltIn.Should Not Contain ${NET_3_VM_IPS} None
177 BuiltIn.Should Not Contain ${NET_3_DHCP_IP} None
178 @{VM_MACAddr_elan_net_2} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_2_PORTS}
179 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_2}
180 @{VM_MACAddr_elan_net_3} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_3_PORTS}
181 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_3}
183 MultipleElan Testsuite Cleanup
184 [Documentation] Delete elan_net_2 network,subnet and port
185 OpenStackOperations.Get Test Teardown Debugs
186 : FOR ${vm} IN @{NET_2_VMS} @{NET_3_VMS}
187 \ OpenStackOperations.Delete Vm Instance ${vm}
188 : FOR ${Port} IN @{NET_2_PORTS} @{NET_3_PORTS}
189 \ OpenStackOperations.Delete Port ${Port}
190 OpenStackOperations.Delete SubNet @{SUBNETS}[1]
191 OpenStackOperations.Delete SubNet @{SUBNETS}[2]
192 OpenStackOperations.Delete Network @{NETWORKS}[1]
193 OpenStackOperations.Delete Network @{NETWORKS}[2]
195 Verify Flows Are Present For ELAN Service
196 [Arguments] ${ip} ${smacs} ${dmacs}
197 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
198 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
199 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
200 Builtin.Log ${smac_output}
201 : FOR ${smac} IN @{smacs}
202 \ ${resp} = BuiltIn.Should Contain ${smac_output} ${smac}
203 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
204 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
205 Builtin.Log ${dmac_output}
206 : FOR ${dmac} IN @{dmacs}
207 \ ${resp} = BuiltIn.Should Contain ${dmac_output} ${dmac}
208 BuiltIn.Should Contain ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
209 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
210 Builtin.Log ${smac_output}
212 Verify Flows Are Removed For ELAN Service
213 [Arguments] ${ip} ${smacs}
214 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
215 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
216 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
217 Builtin.Log ${smac_output}
218 : FOR ${smac} IN @{smacs}
219 \ ${resp} = BuiltIn.Should Not Contain ${smac_output} ${smac}
220 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
221 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
222 Builtin.Log ${dmac_output}
223 : FOR ${dmac} IN @{smacs}
224 \ ${resp} = BuiltIn.Should Not Contain ${dmac_output} ${dmac}