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 SuiteSetup
6 Suite Teardown Elan SuiteTeardown
7 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
8 Test Teardown Get Test Teardown Debugs
9 Library OperatingSystem
10 Library RequestsLibrary
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../libraries/OVSDB.robot
13 Resource ../../../libraries/OpenStackOperations.robot
14 Resource ../../../libraries/DevstackUtils.robot
15 Resource ../../../libraries/SetupUtils.robot
16 Resource ../../../variables/Variables.robot
17 Resource ../../../variables/netvirt/Variables.robot
21 @{SUBNETS} ELANSUBNET1
22 @{SUBNET_CIDR} 1.1.1.0/24
23 @{ELAN1_PORT_LIST} ELANPORT11 ELANPORT12
24 @{VM_INSTANCES_ELAN1} ELANVM11 ELANVM12
25 ${PING_PASS} , 0% packet loss
28 Verify Datapath for Single ELAN with Multiple DPN
29 [Documentation] Verify Flow Table and Datapath
30 ${SRCMAC_CN1} = Create List ${VM_MACAddr_ELAN1[0]}
31 ${SRCMAC_CN2} = Create List ${VM_MACAddr_ELAN1[1]}
32 Wait Until Keyword Succeeds 30s 5s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${SRCMAC_CN1} ${VM_MACAddr_ELAN1}
33 Wait Until Keyword Succeeds 30s 5s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${SRCMAC_CN2} ${VM_MACAddr_ELAN1}
34 Log Verify Datapath Test
35 ${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_ELAN1[0]} ping -c 3 ${VM_IP_ELAN1[1]}
36 Should Contain ${output} ${PING_PASS}
37 ${output} = Execute Command on VM Instance @{NETWORKS}[0] ${VM_IP_ELAN1[1]} ping -c 3 ${VM_IP_ELAN1[0]}
38 Should Contain ${output} ${PING_PASS}
40 Verify Datapath After OVS Restart
41 [Documentation] Verify datapath after OVS restart
42 Log Restarting OVS1 and OVS2
43 Restart OVSDB ${OS_COMPUTE_1_IP}
44 Restart OVSDB ${OS_COMPUTE_2_IP}
45 Log Checking the OVS state and Flow table after restart
46 Wait Until Keyword Succeeds 30s 10s Verify OVS Reports Connected tools_system=${OS_COMPUTE_1_IP}
47 Wait Until Keyword Succeeds 30s 10s Verify OVS Reports Connected tools_system=${OS_COMPUTE_2_IP}
48 ${SRCMAC_CN1} = Create List ${VM_MACAddr_ELAN1[0]}
49 ${SRCMAC_CN2} = Create List ${VM_MACAddr_ELAN1[1]}
50 Wait Until Keyword Succeeds 30s 5s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_1_IP} ${SRCMAC_CN1} ${VM_MACAddr_ELAN1}
51 Wait Until Keyword Succeeds 30s 5s Verify Flows Are Present For ELAN Service ${OS_COMPUTE_2_IP} ${SRCMAC_CN2} ${VM_MACAddr_ELAN1}
52 Log Verify Data path test
53 ${output} = Execute Command on VM Instance ${NETWORKS[0]} ${VM_IP_ELAN1[0]} ping -c 3 ${VM_IP_ELAN1[1]}
54 Should Contain ${output} ${PING_PASS}
55 ${output} = Execute Command on VM Instance ${NETWORKS[0]} ${VM_IP_ELAN1[1]} ping -c 3 ${VM_IP_ELAN1[0]}
56 Should Contain ${output} ${PING_PASS}
58 Delete All ELAN1 VM And Verify Flow Table Updated
59 [Documentation] Verify Flow table after all VM instance deleted
60 Log Delete VM instances
61 : FOR ${VmInstance} IN @{VM_INSTANCES_ELAN1}
62 \ Delete Vm Instance ${VmInstance}
63 Wait Until Keyword Succeeds 30s 5s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_1_IP} ${VM_MACAddr_ELAN1}
64 Wait Until Keyword Succeeds 30s 5s Verify Flows Are Removed For ELAN Service ${OS_COMPUTE_2_IP} ${VM_MACAddr_ELAN1}
68 [Documentation] Elan suite setup
69 SetupUtils.Setup_Utils_For_Setup_And_Teardown
70 DevstackUtils.Devstack Suite Setup
74 [Documentation] Elan suite teardown
75 SingleElan SuiteTeardown
78 SingleElan SuiteTeardown
79 [Documentation] Delete network,subnet and port
80 Log Delete Neutron Ports, Subnet and network
81 : FOR ${Port} IN @{ELAN1_PORT_LIST}
83 Delete SubNet ${SUBNETS[0]}
84 Delete Network ${NETWORKS[0]}
85 Delete SecurityGroup sg-elanservice
88 [Documentation] Create single ELAN with Multiple DPN
89 Log Create ELAN1 network, subnet , port and VM
90 Create SecurityGroup sg-elanservice
91 Create Network ${NETWORKS[0]}
92 Create SubNet ${NETWORKS[0]} ${SUBNETS[0]} ${SUBNET_CIDR[0]}
93 Create Port ${NETWORKS[0]} ${ELAN1_PORT_LIST[0]} sg=sg-elanservice
94 Create Port ${NETWORKS[0]} ${ELAN1_PORT_LIST[1]} sg=sg-elanservice
95 Create Vm Instance With Port On Compute Node ${ELAN1_PORT_LIST[0]} ${VM_INSTANCES_ELAN1[0]} ${OS_COMPUTE_1_IP} sg=sg-elanservice
96 Create Vm Instance With Port On Compute Node ${ELAN1_PORT_LIST[1]} ${VM_INSTANCES_ELAN1[1]} ${OS_COMPUTE_2_IP} sg=sg-elanservice
97 Log Verify ELAN1 VM active
98 : FOR ${VM} IN @{VM_INSTANCES_ELAN1}
99 \ Wait Until Keyword Succeeds 25s 5s Verify VM Is ACTIVE ${VM}
100 Log Get IP address for ELAN1
101 Wait Until Keyword Succeeds 30s 10s Collect VM IP Addresses true @{VM_INSTANCES_ELAN1}
102 ${VM_IP_ELAN1} ${DHCP_IP_ELAN1} Collect VM IP Addresses false @{VM_INSTANCES_ELAN1}
104 Set Suite Variable ${VM_IP_ELAN1}
105 Log Get MACAddr for ELAN1
106 ${VM_MACAddr_ELAN1} Wait Until Keyword Succeeds 30s 10s Get Ports MacAddr ${ELAN1_PORT_LIST}
107 Log ${VM_MACAddr_ELAN1}
108 Set Suite Variable ${VM_MACAddr_ELAN1}
110 Verify Flows Are Present For ELAN Service
111 [Arguments] ${ip} ${srcMacAddrs} ${destMacAddrs}
112 [Documentation] Verify Flows Are Present For ELAN service
113 ${flow_output} = Run Command On Remote System ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
115 Should Contain ${flow_output} table=${ELAN_SMACTABLE}
116 ${sMac_output} = Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
118 : FOR ${sMacAddr} IN @{srcMacAddrs}
119 \ ${resp}= Should Contain ${sMac_output} ${sMacAddr}
120 Should Contain ${flow_output} table=${ELAN_DMACTABLE}
121 ${dMac_output} = Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
123 : FOR ${dMacAddr} IN @{destMacAddrs}
124 \ ${resp}= Should Contain ${dMac_output} ${dMacAddr}
125 Should Contain ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
126 ${sMac_output} = Get Lines Containing String ${flow_output} table=${ELAN_UNKNOWNMACTABLE}
129 Verify Flows Are Removed For ELAN Service
130 [Arguments] ${ip} ${srcMacAddrs}
131 [Documentation] Verify Flows Are Removed For ELAN Service
132 ${flow_output} = Run Command On Remote System ${ip} sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
134 Should Contain ${flow_output} table=${ELAN_SMACTABLE}
135 ${sMac_output} = Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE}
137 : FOR ${sMacAddr} IN @{srcMacAddrs}
138 \ ${resp}= Should Not Contain ${sMac_output} ${sMacAddr}
139 Should Contain ${flow_output} table=${ELAN_DMACTABLE}
140 ${dMac_output} = Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE}
142 : FOR ${dMacAddr} IN @{srcMacAddrs}
143 \ ${resp}= Should Not Contain ${dMac_output} ${dMacAddr}
146 [Arguments] ${sg_name}
147 [Documentation] Allow all TCP/UDP/ICMP packets for this suite
148 Neutron Security Group Create ${sg_name}
149 Neutron Security Group Rule Create ${sg_name} direction=ingress port_range_max=65535 port_range_min=1 protocol=tcp remote_ip_prefix=0.0.0.0/0
150 Neutron Security Group Rule Create ${sg_name} direction=egress port_range_max=65535 port_range_min=1 protocol=tcp remote_ip_prefix=0.0.0.0/0
151 Neutron Security Group Rule Create ${sg_name} direction=ingress protocol=icmp remote_ip_prefix=0.0.0.0/0
152 Neutron Security Group Rule Create ${sg_name} direction=egress protocol=icmp remote_ip_prefix=0.0.0.0/0
153 Neutron Security Group Rule Create ${sg_name} direction=ingress port_range_max=65535 port_range_min=1 protocol=udp remote_ip_prefix=0.0.0.0/0
154 Neutron Security Group Rule Create ${sg_name} direction=egress port_range_max=65535 port_range_min=1 protocol=udp remote_ip_prefix=0.0.0.0/0