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}
49 : FOR ${ip} IN @{OS_CMP_IPS}
50 \ BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${ip}
51 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
52 ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1]
53 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${NET_1_MACS}
54 BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_CMP2_IP} ${smac_cn2} ${NET_1_MACS}
55 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ping -c 3 @{NET_1_VM_IPS}[1]
56 BuiltIn.Should Contain ${output} ${PING_REGEXP}
57 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ping -c 3 @{NET_1_VM_IPS}[0]
58 BuiltIn.Should Contain ${output} ${PING_REGEXP}
60 Verify Datapath After Recreate VM Instance
61 [Documentation] Verify datapath after recreating Vm instance
62 OpenStackOperations.Delete Vm Instance ${NET_1_VMS[0]}
63 ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0]
64 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${OS_CMP1_IP} ${smac_cn1}
65 OpenStackOperations.Remove RSA Key From KnownHosts @{NET_1_VM_IPS}[0]
66 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
67 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
68 Builtin.Set Suite Variable @{NET_1_VM_IPS}
69 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
70 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
71 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${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 Delete All elan_net_1 VM And Verify Flow Table Updated
78 [Documentation] Verify Flow table after all VM instance deleted
79 : FOR ${vm} IN @{NET_1_VMS}
80 \ OpenStackOperations.Delete Vm Instance ${vm}
81 Verify Flows Are Removed For ELAN Service On All compute Nodes ${NET_1_MACS}
83 Verify Datapath for Multiple ELAN with Multiple DPN
84 [Documentation] Verify Flow Table and Data path for Multiple ELAN with Multiple DPN
85 [Setup] BuiltIn.Run Keywords SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
86 ... AND MultipleElan Testsuite Setup
87 ${smac_cn1} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[0] @{VM_MACAddr_elan_net_3}[0]
88 ${smac_cn2} = BuiltIn.Create List @{VM_MACAddr_elan_net_2}[1] @{VM_MACAddr_elan_net_3}[1]
89 ${MAC_LIST} = BuiltIn.Create List @{VM_MACAddr_elan_net_2} @{VM_MACAddr_elan_net_3}
90 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${MAC_LIST}
91 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP2_IP} ${smac_cn2} ${MAC_LIST}
92 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_2_VM_IPS[1]}
93 BuiltIn.Should Contain ${output} ${PING_REGEXP}
94 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_3_VM_IPS[0]}
95 BuiltIn.Should Contain ${output} ${PING_REGEXP}
96 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ping -c 3 ${NET_3_VM_IPS[0]}
97 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
98 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[2] @{NET_3_VM_IPS}[1] ping -c 3 ${NET_2_VM_IPS[1]}
99 BuiltIn.Should Not Contain ${output} ${PING_REGEXP}
100 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
101 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
102 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
103 BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${MAC_LIST}
104 ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPS[1]} ping -c 3 @{NET_2_VM_IPS}[0]
105 BuiltIn.Should Contain ${output} ${PING_REGEXP}
109 OpenStackOperations.OpenStack Suite Setup
111 OpenStackOperations.Show Debugs @{NET_1_VMS}
112 OpenStackOperations.Get Suite Debugs
115 OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP}
116 OpenStackOperations.Create Network @{NETWORKS}[0]
117 OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] ${SUBNET_CIDRS[0]}
118 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[0]} sg=${SECURITY_GROUP}
119 OpenStackOperations.Create Port @{NETWORKS}[0] ${NET_1_PORTS[1]} sg=${SECURITY_GROUP}
120 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_1_PORTS}
121 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[0]} ${NET_1_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
122 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_1_PORTS[1]} ${NET_1_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
123 @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS}
124 Builtin.Set Suite Variable @{NET_1_VM_IPS}
125 BuiltIn.Should Not Contain ${NET_1_VM_IPS} None
126 BuiltIn.Should Not Contain ${NET_1_DHCP_IP} None
127 @{NET_1_MACS} = BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_1_PORTS}
128 Builtin.Set Suite Variable @{NET_1_MACS}
130 MultipleElan Testsuite Setup
131 [Documentation] Create additional ELAN for multipleElan with Multiple DPN test
132 OpenStackOperations.Create Network @{NETWORKS}[1]
133 OpenStackOperations.Create Network @{NETWORKS}[2]
134 OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] ${SUBNET_CIDRS[1]}
135 OpenStackOperations.Create SubNet @{NETWORKS}[2] @{SUBNETS}[2] ${SUBNET_CIDRS[2]}
136 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[0]} sg=${SECURITY_GROUP}
137 OpenStackOperations.Create Port @{NETWORKS}[1] ${NET_2_PORTS[1]} sg=${SECURITY_GROUP}
138 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[0]} sg=${SECURITY_GROUP}
139 OpenStackOperations.Create Port @{NETWORKS}[2] ${NET_3_PORTS[1]} sg=${SECURITY_GROUP}
140 BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${NET_3_PORTS}
141 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[0]} ${NET_2_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
142 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_2_PORTS[1]} ${NET_2_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
143 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[0]} ${NET_3_VMS[0]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP}
144 OpenStackOperations.Create Vm Instance With Port On Compute Node ${NET_3_PORTS[1]} ${NET_3_VMS[1]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP}
145 @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS}
146 @{NET_3_VM_IPS} ${NET_3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS}
147 Builtin.Set Suite Variable @{NET_2_VM_IPS}
148 Builtin.Set Suite Variable @{NET_3_VM_IPS}
149 BuiltIn.Should Not Contain ${NET_2_VM_IPS} None
150 BuiltIn.Should Not Contain ${NET_2_DHCP_IP} None
151 BuiltIn.Should Not Contain ${NET_3_VM_IPS} None
152 BuiltIn.Should Not Contain ${NET_3_DHCP_IP} None
153 @{VM_MACAddr_elan_net_2} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_2_PORTS}
154 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_2}
155 @{VM_MACAddr_elan_net_3} BuiltIn.Wait Until Keyword Succeeds 30s 10s OpenStackOperations.Get Ports MacAddr ${NET_3_PORTS}
156 Builtin.Set Suite Variable @{VM_MACAddr_elan_net_3}
157 OpenStackOperations.Show Debugs @{NET_2_VMS} @{NET_3_VMS}
158 OpenStackOperations.Get Suite Debugs
160 Verify Flows Are Present For ELAN Service
161 [Arguments] ${ip} ${smacs} ${dmacs}
162 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
163 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
164 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
165 Builtin.Log ${smac_output}
166 : FOR ${smac} IN @{smacs}
167 \ ${resp} = BuiltIn.Should Contain ${smac_output} ${smac}
168 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
169 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
170 Builtin.Log ${dmac_output}
171 : FOR ${dmac} IN @{dmacs}
172 \ ${resp} = BuiltIn.Should Contain ${dmac_output} ${dmac}
173 BuiltIn.Should Contain ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
174 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
175 Builtin.Log ${smac_output}
177 Verify Flows Are Removed For ELAN Service
178 [Arguments] ${ip} ${smacs}
179 ${flow_output} = Utils.Run Command On Remote System And Log ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}
180 BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE}
181 ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
182 Builtin.Log ${smac_output}
183 : FOR ${smac} IN @{smacs}
184 \ ${resp} = BuiltIn.Should Not Contain ${smac_output} ${smac}
185 BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE}
186 ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
187 Builtin.Log ${dmac_output}
188 : FOR ${dmac} IN @{smacs}
189 \ ${resp} = BuiltIn.Should Not Contain ${dmac_output} ${dmac}
191 Verify Flows Are Removed For ELAN Service On All compute Nodes
193 : FOR ${ip} IN @{OS_CMP_IPS}
194 \ BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${ip} ${smacs}