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 Suite Setup
6 Suite Teardown OpenStackOperations.OpenStack 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 ../../../variables/Variables.robot
19 Resource ../../../variables/netvirt/Variables.robot
22 ${SECURITY_GROUP} elan_sg
23 @{NETWORKS} elan_net_1 elan_net_2 elan_net_3
24 @{SUBNETS} elan_sub_1 elan_sub_2 elan_sub_3
25 @{SUBNET_CIDRS} 81.1.1.0/24 82.1.1.0/24 83.1.1.0/24
26 @{NET_1_PORTS} elan_net_1_port_1 elan_net_1_port_2
27 @{NET_2_PORTS} elan_net_2_port_1 elan_net_2_port_2
28 @{NET_3_PORTS} elan_net_3_port_1 elan_net_3_port_2
29 @{NET_1_VMS} elan_net_1_vm_1 elan_net_1_vm_2
30 @{NET_2_VMS} elan_net_2_vm_1 elan_net_2_vm_2
31 @{NET_3_VMS} elan_net_3_vm_1 elan_net_3_vm_2
34 Verify Datapath for Single ELAN with Multiple DPN
35 [Documentation] Verify Flow Table and Datapath
36 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
37 ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1]
38 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${NET_1_MACS}
39 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP2_IP} ${smac_cn2} ${NET_1_MACS}
40 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
41 BuiltIn.Should Contain ${output} ${PING_REGEXP}
42 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
43 BuiltIn.Should Contain ${output} ${PING_REGEXP}
45 Verify Datapath After OVS Restart
46 [Documentation] Verify datapath after OVS restart
47 FOR ${ip} IN @{OS_CMP_IPS}
48 OVSDB.Restart OVSDB ${ip}
50 FOR ${ip} IN @{OS_CMP_IPS}
51 BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${ip}
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 60s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${NET_1_MACS}
56 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_CMP2_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 Recreate VM Instance
63 [Documentation] Verify datapath after recreating Vm instance
64 OpenStackOperations.Delete Vm Instance ${NET_1_VMS[0]}
65 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
66 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_CMP1_IP} ${smac_cn1}
67 OpenStackOperations.Remove RSA Key From KnownHosts @{NET_1_VM_IPS}[0]
68 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
69 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
70 Builtin.Set Suite Variable @{NET_1_VM_IPS}
71 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
72 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
73 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${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 Delete All elan_net_1 VM And Verify Flow Table Updated
80 [Documentation] Verify Flow table after all VM instance deleted
81 FOR ${vm} IN @{NET_1_VMS}
82 OpenStackOperations.Delete Vm Instance ${vm}
84 Verify Flows Are Removed For ELAN Service On All compute Nodes ${NET_1_MACS}
86 Verify Datapath for Multiple ELAN with Multiple DPN
87 [Documentation] Verify Flow Table and Data path for Multiple ELAN with Multiple DPN
88 [Setup] BuiltIn.Run Keywords SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
89 ... AND MultipleElan Testsuite Setup
90 ${smac_cn1} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[0] @{VM_MACAddr_elan_net_3}[0]
91 ${smac_cn2} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[1] @{VM_MACAddr_elan_net_3}[1]
92 ${MAC_LIST} = BuiltIn.Create List @{VM_MACAddr_elan_net_2} @{VM_MACAddr_elan_net_3}
93 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${MAC_LIST}
94 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP2_IP} ${smac_cn2} ${MAC_LIST}
95 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_2_VM_IPS[1]}
96 BuiltIn.Should Contain ${output} ${PING_REGEXP}
97 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_3_VM_IPS[0]}
98 BuiltIn.Should Contain ${output} ${PING_REGEXP}
99 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_3_VM_IPS[0]}
100 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
101 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_2_VM_IPS[1]}
102 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
103 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
104 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
105 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
106 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${MAC_LIST}
107 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPS[1]} ping -c 3 @{NET_2_VM_IPS}[0]
108 BuiltIn.Should Contain ${output} ${PING_REGEXP}
112 OpenStackOperations.OpenStack Suite Setup
114 OpenStackOperations.Show Debugs @{NET_1_VMS}
115 OpenStackOperations.Get Suite Debugs
118 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
119 OpenStackOperations.Create Network @{NETWORKS}[0]
120 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] ${SUBNET_CIDRS[0]}
121 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[0]} sg=${SECURITY_GROUP}
122 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[1]} sg=${SECURITY_GROUP}
123 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_1_PORTS}
124 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
125 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[1]} ${NET_1_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
126 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
127 Builtin.Set Suite Variable @{NET_1_VM_IPS}
128 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
129 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
130 @{NET_1_MACS} = BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_1_PORTS}
131 Builtin.Set Suite Variable @{NET_1_MACS}
133 MultipleElan Testsuite Setup
134 [Documentation] Create additional ELAN for multipleElan with Multiple DPN test
135 OpenStackOperations.Create Network @{NETWORKS}[1]
136 OpenStackOperations.Create Network @{NETWORKS}[2]
137 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] ${SUBNET_CIDRS[1]}
138 OpenStackOperations.Create SubNet @{NETWORKS}[2] @{SUBNETS}[2] ${SUBNET_CIDRS[2]}
139 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[0]} sg=${SECURITY_GROUP}
140 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[1]} sg=${SECURITY_GROUP}
141 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[0]} sg=${SECURITY_GROUP}
142 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[1]} sg=${SECURITY_GROUP}
143 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_3_PORTS}
144 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[0]} ${NET_2_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
145 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[1]} ${NET_2_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
146 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[0]} ${NET_3_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
147 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[1]} ${NET_3_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
148 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
149 @{NET_3_VM_IPS} ${NET_3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
150 Builtin.Set Suite Variable @{NET_2_VM_IPS}
151 Builtin.Set Suite Variable @{NET_3_VM_IPS}
152 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
153 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
154 BuiltIn.Should Not Contain ${NET_3_VM_IPS} None
155 BuiltIn.Should Not Contain ${NET_3_DHCP_IP} None
156 @{VM_MACAddr_elan_net_2} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_2_PORTS}
157 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_2}
158 @{VM_MACAddr_elan_net_3} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_3_PORTS}
159 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_3}
160 OpenStackOperations.Show Debugs @{NET_2_VMS} @{NET_3_VMS}
161 OpenStackOperations.Get Suite Debugs
163 Verify Flows Are Present For ELAN Service
164 [Arguments] ${ip} ${smacs} ${dmacs}
165 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
166 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
167 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
168 Builtin.Log ${smac_output}
169 FOR ${smac} IN @{smacs}
170 ${resp} = BuiltIn.Should Contain ${smac_output} ${smac}
172 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
173 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
174 Builtin.Log ${dmac_output}
175 FOR ${dmac} IN @{dmacs}
176 ${resp} = BuiltIn.Should Contain ${dmac_output} ${dmac}
178 BuiltIn.Should Contain ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
179 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
180 Builtin.Log ${smac_output}
182 Verify Flows Are Removed For ELAN Service
183 [Arguments] ${ip} ${smacs}
184 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
185 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
186 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
187 Builtin.Log ${smac_output}
188 FOR ${smac} IN @{smacs}
189 ${resp} = BuiltIn.Should Not Contain ${smac_output} ${smac}
191 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
192 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
193 Builtin.Log ${dmac_output}
194 FOR ${dmac} IN @{smacs}
195 ${resp} = BuiltIn.Should Not Contain ${dmac_output} ${dmac}
198 Verify Flows Are Removed For ELAN Service On All compute Nodes
200 FOR ${ip} IN @{OS_CMP_IPS}
201 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${ip} ${smacs}