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_CIDR} 71.1.1.0/24 72.1.1.0/24 73.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
35 ${PING_PASS} , 0% packet loss
39 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
40 OpenStackOperations.Create Network @{NETWORKS}[0]
41 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] ${SUBNET_CIDR[0]}
42 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[0]} sg=${SECURITY_GROUP}
43 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[1]} sg=${SECURITY_GROUP}
44 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_1_PORTS}
45 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_COMPUTE_1_IP} sg=${SECURITY_GROUP}
46 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[1]} ${NET_1_VMS[1]} ${OS_COMPUTE_2_IP} sg=${SECURITY_GROUP}
47 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
48 Builtin.Set Suite Variable @{NET_1_VM_IPS}
49 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
50 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
51 @{NET_1_MACS} = BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_1_PORTS}
52 Builtin.Set Suite Variable @{NET_1_MACS}
54 Verify Datapath for Single ELAN with Multiple DPN
55 [Documentation] Verify Flow Table and Datapath
56 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
57 ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1]
58 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
59 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${NET_1_MACS}
60 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
61 BuiltIn.Should Contain ${output} ${PING_PASS}
62 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
63 BuiltIn.Should Contain ${output} ${PING_PASS}
65 Verify Datapath After OVS Restart
66 [Documentation] Verify datapath after OVS restart
67 OVSDB.Restart OVSDB ${OS_COMPUTE_1_IP}
68 OVSDB.Restart OVSDB ${OS_COMPUTE_2_IP}
69 BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${OS_COMPUTE_1_IP}
70 BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${OS_COMPUTE_2_IP}
71 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
72 ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1]
73 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
74 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${NET_1_MACS}
75 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
76 BuiltIn.Should Contain ${output} ${PING_PASS}
77 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
78 BuiltIn.Should Contain ${output} ${PING_PASS}
80 Verify Datapath After Recreate VM Instance
81 [Documentation] Verify datapath after recreating Vm instance
82 OpenStackOperations.Delete Vm Instance ${NET_1_VMS[0]}
83 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
84 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1}
85 OpenStackOperations.Remove RSA Key From KnownHosts @{NET_1_VM_IPS}[0]
86 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_COMPUTE_1_IP}
87 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
88 Builtin.Set Suite Variable @{NET_1_VM_IPS}
89 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
90 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
91 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
92 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
93 BuiltIn.Should Contain ${output} ${PING_PASS}
94 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
95 BuiltIn.Should Contain ${output} ${PING_PASS}
97 Delete All elan_net_1 VM And Verify Flow Table Updated
98 [Documentation] Verify Flow table after all VM instance deleted
99 : FOR ${vm} IN @{NET_1_VMS}
100 \ OpenStackOperations.Delete Vm Instance ${vm}
101 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_1_IP} ${NET_1_MACS}
102 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_2_IP} ${NET_1_MACS}
104 Verify Datapath for Multiple ELAN with Multiple DPN
105 [Documentation] Verify Flow Table and Data path for Multiple ELAN with Multiple DPN
106 [Setup] BuiltIn.Run Keywords SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
107 ... AND MultipleElan Testsuite Setup
108 ${smac_cn1} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[0] @{VM_MACAddr_elan_net_3}[0]
109 ${smac_cn2} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[1] @{VM_MACAddr_elan_net_3}[1]
110 ${MAC_LIST} = BuiltIn.Create List @{VM_MACAddr_elan_net_2} @{VM_MACAddr_elan_net_3}
111 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${MAC_LIST}
112 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${MAC_LIST}
113 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_2_VM_IPS[1]}
114 BuiltIn.Should Contain ${output} ${PING_PASS}
115 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_3_VM_IPS[0]}
116 BuiltIn.Should Contain ${output} ${PING_PASS}
117 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_3_VM_IPS[0]}
118 BuiltIn.Should Not Contain ${output} ${PING_PASS}
119 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_2_VM_IPS[1]}
120 BuiltIn.Should Not Contain ${output} ${PING_PASS}
121 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
122 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
123 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
124 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${MAC_LIST}
125 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPS[1]} ping -c 3 @{NET_2_VM_IPS}[0]
126 BuiltIn.Should Contain ${output} ${PING_PASS}
127 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Get Test Teardown Debugs
128 ... AND MultipleElan Testsuite Cleanup
132 [Documentation] Elan suite setup
133 SetupUtils.Setup_Utils_For_Setup_And_Teardown
134 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set DEBUG org.opendaylight.genius.mdsalutil.internal.MDSALManager
135 DevstackUtils.Devstack Suite Setup
138 [Documentation] Elan suite teardown
139 OpenStackOperations.Get OvsDebugInfo
140 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set INFO org.opendaylight.genius.mdsalutil.internal.MDSALManager
141 SingleElan SuiteTeardown
142 SSHLibrary.Close All Connections
144 SingleElan SuiteTeardown
145 [Documentation] Delete network,subnet and port
146 BuiltIn.Log Delete Neutron Ports, Subnet and network
147 : FOR ${Port} IN @{NET_1_PORTS}
148 \ OpenStackOperations.Delete Port ${Port}
149 OpenStackOperations.Delete SubNet @{SUBNETS}[0]
150 OpenStackOperations.Delete Network @{NETWORKS}[0]
151 OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
153 SingleElan SuiteSetup
154 [Documentation] Create single ELAN with Multiple DPN
156 MultipleElan Testsuite Setup
157 [Documentation] Create additional ELAN for multipleElan with Multiple DPN test
158 OpenStackOperations.Create Network @{NETWORKS}[1]
159 OpenStackOperations.Create Network @{NETWORKS}[2]
160 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] ${SUBNET_CIDR[1]}
161 OpenStackOperations.Create SubNet @{NETWORKS}[2] @{SUBNETS}[2] ${SUBNET_CIDR[2]}
162 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[0]} sg=${SECURITY_GROUP}
163 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[1]} sg=${SECURITY_GROUP}
164 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[0]} sg=${SECURITY_GROUP}
165 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[1]} sg=${SECURITY_GROUP}
166 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_3_PORTS}
167 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[0]} ${NET_2_VMS[0]} ${OS_COMPUTE_1_IP} sg=${SECURITY_GROUP}
168 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[1]} ${NET_2_VMS[1]} ${OS_COMPUTE_2_IP} sg=${SECURITY_GROUP}
169 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[0]} ${NET_3_VMS[0]} ${OS_COMPUTE_1_IP} sg=${SECURITY_GROUP}
170 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[1]} ${NET_3_VMS[1]} ${OS_COMPUTE_2_IP} sg=${SECURITY_GROUP}
171 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
172 @{NET_3_VM_IPS} ${NET_3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
173 Builtin.Set Suite Variable @{NET_2_VM_IPS}
174 Builtin.Set Suite Variable @{NET_3_VM_IPS}
175 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
176 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
177 BuiltIn.Should Not Contain ${NET_3_VM_IPS} None
178 BuiltIn.Should Not Contain ${NET_3_DHCP_IP} None
179 @{VM_MACAddr_elan_net_2} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_2_PORTS}
180 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_2}
181 @{VM_MACAddr_elan_net_3} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_3_PORTS}
182 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_3}
184 MultipleElan Testsuite Cleanup
185 [Documentation] Delete elan_net_2 network,subnet and port
186 OpenStackOperations.Get Test Teardown Debugs
187 : FOR ${vm} IN @{NET_2_VMS} @{NET_3_VMS}
188 \ OpenStackOperations.Delete Vm Instance ${vm}
189 : FOR ${Port} IN @{NET_2_PORTS} @{NET_3_PORTS}
190 \ OpenStackOperations.Delete Port ${Port}
191 OpenStackOperations.Delete SubNet @{SUBNETS}[1]
192 OpenStackOperations.Delete SubNet @{SUBNETS}[2]
193 OpenStackOperations.Delete Network @{NETWORKS}[1]
194 OpenStackOperations.Delete Network @{NETWORKS}[2]
196 Verify Flows Are Present For ELAN Service
197 [Arguments] ${ip} ${smacs} ${dmacs}
198 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
199 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
200 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
201 Builtin.Log ${smac_output}
202 : FOR ${smac} IN @{smacs}
203 \ ${resp} = BuiltIn.Should Contain ${smac_output} ${smac}
204 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
205 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
206 Builtin.Log ${dmac_output}
207 : FOR ${dmac} IN @{dmacs}
208 \ ${resp} = BuiltIn.Should Contain ${dmac_output} ${dmac}
209 BuiltIn.Should Contain ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
210 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
211 Builtin.Log ${smac_output}
213 Verify Flows Are Removed For ELAN Service
214 [Arguments] ${ip} ${smacs}
215 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
216 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
217 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
218 Builtin.Log ${smac_output}
219 : FOR ${smac} IN @{smacs}
220 \ ${resp} = BuiltIn.Should Not Contain ${smac_output} ${smac}
221 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
222 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
223 Builtin.Log ${dmac_output}
224 : FOR ${dmac} IN @{smacs}
225 \ ${resp} = BuiltIn.Should Not Contain ${dmac_output} ${dmac}