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 Elan Suite Setup
6 Suite Teardown Elan Suite Teardown
7 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
8 Test Teardown OpenStackOperations.Get Test Teardown Debugs
9 Library OperatingSystem
10 Library RequestsLibrary
12 Resource ../../../libraries/KarafKeywords.robot
13 Resource ../../../libraries/Utils.robot
14 Resource ../../../libraries/OVSDB.robot
15 Resource ../../../libraries/OpenStackOperations.robot
16 Resource ../../../libraries/DevstackUtils.robot
17 Resource ../../../libraries/SetupUtils.robot
18 Resource ../../../libraries/Tcpdump.robot
19 Resource ../../../variables/Variables.robot
20 Resource ../../../variables/netvirt/Variables.robot
23 ${SECURITY_GROUP} elan_sg
24 @{NETWORKS} elan_net_1 elan_net_2 elan_net_3
25 @{SUBNETS} elan_sub_1 elan_sub_2 elan_sub_3
26 @{SUBNET_CIDRS} 81.1.1.0/24 82.1.1.0/24 83.1.1.0/24
27 @{NET_1_PORTS} elan_net_1_port_1 elan_net_1_port_2
28 @{NET_2_PORTS} elan_net_2_port_1 elan_net_2_port_2
29 @{NET_3_PORTS} elan_net_3_port_1 elan_net_3_port_2
30 @{NET_1_VMS} elan_net_1_vm_1 elan_net_1_vm_2
31 @{NET_2_VMS} elan_net_2_vm_1 elan_net_2_vm_2
32 @{NET_3_VMS} elan_net_3_vm_1 elan_net_3_vm_2
36 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
37 OpenStackOperations.Create Network @{NETWORKS}[0]
38 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] ${SUBNET_CIDRS[0]}
39 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[0]} sg=${SECURITY_GROUP}
40 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[1]} sg=${SECURITY_GROUP}
41 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_1_PORTS}
42 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
43 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[1]} ${NET_1_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
44 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
45 Builtin.Set Suite Variable @{NET_1_VM_IPS}
46 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
47 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
48 @{NET_1_MACS} = BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_1_PORTS}
49 Builtin.Set Suite Variable @{NET_1_MACS}
51 Verify Datapath for Single ELAN with Multiple DPN
52 [Documentation] Verify Flow Table and Datapath
53 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
54 ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1]
55 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
56 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${NET_1_MACS}
57 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
58 BuiltIn.Should Contain ${output} ${PING_REGEXP}
59 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
60 BuiltIn.Should Contain ${output} ${PING_REGEXP}
62 Verify Datapath After OVS Restart
63 [Documentation] Verify datapath after OVS restart
64 OVSDB.Restart OVSDB ${OS_COMPUTE_1_IP}
65 OVSDB.Restart OVSDB ${OS_COMPUTE_2_IP}
66 BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${OS_COMPUTE_1_IP}
67 BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${OS_COMPUTE_2_IP}
68 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
69 ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1]
70 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
71 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${NET_1_MACS}
72 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
73 BuiltIn.Should Contain ${output} ${PING_REGEXP}
74 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
75 BuiltIn.Should Contain ${output} ${PING_REGEXP}
77 Verify Datapath After Recreate VM Instance
78 [Documentation] Verify datapath after recreating Vm instance
79 OpenStackOperations.Delete Vm Instance ${NET_1_VMS[0]}
80 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
81 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1}
82 OpenStackOperations.Remove RSA Key From KnownHosts @{NET_1_VM_IPS}[0]
83 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
84 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
85 Builtin.Set Suite Variable @{NET_1_VM_IPS}
86 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
87 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
88 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${NET_1_MACS}
89 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
90 BuiltIn.Should Contain ${output} ${PING_REGEXP}
91 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
92 BuiltIn.Should Contain ${output} ${PING_REGEXP}
94 Delete All elan_net_1 VM And Verify Flow Table Updated
95 [Documentation] Verify Flow table after all VM instance deleted
96 : FOR ${vm} IN @{NET_1_VMS}
97 \ OpenStackOperations.Delete Vm Instance ${vm}
98 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_1_IP} ${NET_1_MACS}
99 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_2_IP} ${NET_1_MACS}
101 Verify Datapath for Multiple ELAN with Multiple DPN
102 [Documentation] Verify Flow Table and Data path for Multiple ELAN with Multiple DPN
103 [Setup] BuiltIn.Run Keywords SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
104 ... AND MultipleElan Testsuite Setup
105 ${smac_cn1} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[0] @{VM_MACAddr_elan_net_3}[0]
106 ${smac_cn2} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[1] @{VM_MACAddr_elan_net_3}[1]
107 ${MAC_LIST} = BuiltIn.Create List @{VM_MACAddr_elan_net_2} @{VM_MACAddr_elan_net_3}
108 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${MAC_LIST}
109 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${smac_cn2} ${MAC_LIST}
110 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_2_VM_IPS[1]}
111 BuiltIn.Should Contain ${output} ${PING_REGEXP}
112 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_3_VM_IPS[0]}
113 BuiltIn.Should Contain ${output} ${PING_REGEXP}
114 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_3_VM_IPS[0]}
115 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
116 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_2_VM_IPS[1]}
117 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
118 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
119 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
120 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
121 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${smac_cn1} ${MAC_LIST}
122 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPS[1]} ping -c 3 @{NET_2_VM_IPS}[0]
123 BuiltIn.Should Contain ${output} ${PING_REGEXP}
124 [Teardown] BuiltIn.Run Keywords OpenStackOperations.Get Test Teardown Debugs
125 ... AND MultipleElan Testsuite Cleanup
129 [Documentation] Elan suite setup
130 OpenStackOperations.OpenStack Suite Setup
131 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set DEBUG org.opendaylight.genius.mdsalutil.internal.MDSALManager
134 [Documentation] Elan suite teardown
135 KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set INFO org.opendaylight.genius.mdsalutil.internal.MDSALManager
136 OpenStackOperations.OpenStack Suite Teardown
138 MultipleElan Testsuite Setup
139 [Documentation] Create additional ELAN for multipleElan with Multiple DPN test
140 OpenStackOperations.Create Network @{NETWORKS}[1]
141 OpenStackOperations.Create Network @{NETWORKS}[2]
142 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] ${SUBNET_CIDRS[1]}
143 OpenStackOperations.Create SubNet @{NETWORKS}[2] @{SUBNETS}[2] ${SUBNET_CIDRS[2]}
144 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[0]} sg=${SECURITY_GROUP}
145 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[1]} sg=${SECURITY_GROUP}
146 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[0]} sg=${SECURITY_GROUP}
147 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[1]} sg=${SECURITY_GROUP}
148 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_3_PORTS}
149 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[0]} ${NET_2_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
150 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[1]} ${NET_2_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
151 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[0]} ${NET_3_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
152 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[1]} ${NET_3_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
153 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
154 @{NET_3_VM_IPS} ${NET_3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
155 Builtin.Set Suite Variable @{NET_2_VM_IPS}
156 Builtin.Set Suite Variable @{NET_3_VM_IPS}
157 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
158 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
159 BuiltIn.Should Not Contain ${NET_3_VM_IPS} None
160 BuiltIn.Should Not Contain ${NET_3_DHCP_IP} None
161 @{VM_MACAddr_elan_net_2} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_2_PORTS}
162 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_2}
163 @{VM_MACAddr_elan_net_3} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_3_PORTS}
164 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_3}
166 MultipleElan Testsuite Cleanup
167 [Documentation] Delete elan_net_2 network,subnet and port
168 OpenStackOperations.Get Test Teardown Debugs
169 : FOR ${vm} IN @{NET_2_VMS} @{NET_3_VMS}
170 \ OpenStackOperations.Delete Vm Instance ${vm}
171 : FOR ${Port} IN @{NET_2_PORTS} @{NET_3_PORTS}
172 \ OpenStackOperations.Delete Port ${Port}
173 OpenStackOperations.Delete SubNet @{SUBNETS}[1]
174 OpenStackOperations.Delete SubNet @{SUBNETS}[2]
175 OpenStackOperations.Delete Network @{NETWORKS}[1]
176 OpenStackOperations.Delete Network @{NETWORKS}[2]
178 Verify Flows Are Present For ELAN Service
179 [Arguments] ${ip} ${smacs} ${dmacs}
180 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
181 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
182 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
183 Builtin.Log ${smac_output}
184 : FOR ${smac} IN @{smacs}
185 \ ${resp} = BuiltIn.Should Contain ${smac_output} ${smac}
186 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
187 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
188 Builtin.Log ${dmac_output}
189 : FOR ${dmac} IN @{dmacs}
190 \ ${resp} = BuiltIn.Should Contain ${dmac_output} ${dmac}
191 BuiltIn.Should Contain ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
192 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
193 Builtin.Log ${smac_output}
195 Verify Flows Are Removed For ELAN Service
196 [Arguments] ${ip} ${smacs}
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 Not 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 @{smacs}
207 \ ${resp} = BuiltIn.Should Not Contain ${dmac_output} ${dmac}