2 Documentation Test suite to validate vpnservice functionality in an openstack integrated 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 Basic Vpnservice Suite Setup
6 Suite Teardown Basic Vpnservice Suite Teardown
7 Test Setup Log Testcase Start To Controller Karaf
9 Library OperatingSystem
10 Library RequestsLibrary
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../libraries/OpenStackOperations.robot
13 Resource ../../../libraries/DevstackUtils.robot
14 Resource ../../../libraries/VpnOperations.robot
15 Variables ../../../variables/Variables.py
18 @{NETWORKS} NET10 NET20
19 @{SUBNETS} SUBNET1 SUBNET2
20 @{SUBNET_CIDR} 10.1.1.0/24 20.1.1.0/24
21 @{PORT_LIST} PORT11 PORT21 PORT12 PORT22
22 @{VM_INSTANCES} VM11 VM21 VM12 VM22
23 @{ROUTERS} ROUTER_1 ROUTER_2
24 # Values passed by the calling method to API
25 ${CREATE_ID} "4ae8cd92-48ca-49b5-94e1-b2921a261111"
27 ${CREATE_ROUTER_DISTINGUISHER} ["2200:2"]
28 ${CREATE_EXPORT_RT} ["3300:2","8800:2"]
29 ${CREATE_IMPORT_RT} ["3300:2","8800:2"]
30 ${CREATE_TENANT_ID} "6c53df3a-3456-11e5-a151-feff819c1111"
31 @{VPN_INSTANCE} vpn_instance_template.json
32 @{VPN_INSTANCE_NAME} 4ae8cd92-48ca-49b5-94e1-b2921a2661c7 4ae8cd92-48ca-49b5-94e1-b2921a261111
35 Verify Tunnel Creation
36 [Documentation] Checks that vxlan tunnels have been created properly.
38 Log This test case is currently a noop, but work can be added here to validate if needed. However, as the suite Documentation notes, it's already assumed that the environment has been configured properly. If we do add work in this test case, we need to remove the "exclude" tag for it to run. In fact, if this
39 ... test case is critical to run, and if it fails we would be dead in the water for the rest of the suite, we should move it to Suite Setup so that nothing else will run and waste time in a broken environment.
41 Create Neutron Networks
42 [Documentation] Create two networks
43 Create Network ${NETWORKS[0]} --provider:network_type local
44 Create Network ${NETWORKS[1]} --provider:network_type local
45 ${NET_LIST} List Networks
47 Should Contain ${NET_LIST} ${NETWORKS[0]}
48 Should Contain ${NET_LIST} ${NETWORKS[1]}
50 Create Neutron Subnets
51 [Documentation] Create two subnets for previously created networks
52 Create SubNet ${NETWORKS[0]} ${SUBNETS[0]} ${SUBNET_CIDR[0]}
53 Create SubNet ${NETWORKS[1]} ${SUBNETS[1]} ${SUBNET_CIDR[1]}
54 ${SUB_LIST} List Subnets
56 Should Contain ${SUB_LIST} ${SUBNETS[0]}
57 Should Contain ${SUB_LIST} ${SUBNETS[1]}
60 [Documentation] Create four ports under previously created subnets
61 Create Port ${NETWORKS[0]} ${PORT_LIST[0]}
62 Create Port ${NETWORKS[0]} ${PORT_LIST[1]}
63 Create Port ${NETWORKS[1]} ${PORT_LIST[2]}
64 Create Port ${NETWORKS[1]} ${PORT_LIST[3]}
66 Check OpenDaylight Neutron Ports
67 [Documentation] Checking OpenDaylight Neutron API for known ports
68 ${resp} RequestsLibrary.Get Request session ${NEUTRON_PORTS_API}
70 Should be Equal As Strings ${resp.status_code} 200
73 [Documentation] Create Vm instances on compute node with port
74 Create Vm Instance With Port On Compute Node ${PORT_LIST[0]} ${VM_INSTANCES[0]} ${OS_COMPUTE_1_IP}
75 Create Vm Instance With Port On Compute Node ${PORT_LIST[1]} ${VM_INSTANCES[1]} ${OS_COMPUTE_2_IP}
76 Create Vm Instance With Port On Compute Node ${PORT_LIST[2]} ${VM_INSTANCES[2]} ${OS_COMPUTE_1_IP}
77 Create Vm Instance With Port On Compute Node ${PORT_LIST[3]} ${VM_INSTANCES[3]} ${OS_COMPUTE_2_IP}
79 Check ELAN Datapath Traffic Within The Networks
80 [Documentation] Checks datapath within the same network with different vlans.
82 Log This test will be added in the next patch
85 [Documentation] Create Router
86 Create Router ${ROUTERS[0]}
88 Add Interfaces To Router
89 [Documentation] Add Interfaces
90 : FOR ${INTERFACE} IN @{SUBNETS}
91 \ Add Router Interface ${ROUTERS[0]} ${INTERFACE}
93 Check L3_Datapath Traffic Across Networks With Router
94 [Documentation] Datapath Test Across the networks using Router for L3.
96 Log This test will be added in the next patch
99 [Documentation] Creates L3VPN and verify the same
100 VPN Create L3VPN ${VPN_INSTANCE[0]} CREATE_ID=${CREATE_ID} CREATE_EXPORT_RT=${CREATE_EXPORT_RT} CREATE_IMPORT_RT=${CREATE_IMPORT_RT} CREATE_TENANT_ID=${CREATE_TENANT_ID}
101 VPN Get L3VPN ${CREATE_ID}
103 Associate L3VPN to Routers
104 [Documentation] Associating router to L3VPN
106 ${devstack_conn_id}= Get ControlNode Connection
107 ${router_id}= Get Router Id ${ROUTERS[0]} ${devstack_conn_id}
108 Associate VPN to Router ${router_id} ${VPN_INSTANCE_NAME[1]}
110 Dissociate L3VPN to Routers
111 [Documentation] Dissociating router to L3VPN
113 ${devstack_conn_id}= Get ControlNode Connection
114 ${router_id}= Get Router Id ${ROUTERS[0]} ${devstack_conn_id}
115 Dissociate VPN to Router ${router_id} ${VPN_INSTANCE_NAME[1]}
117 Delete Router Interfaces
118 [Documentation] Remove Interface to the subnets.
119 : FOR ${INTERFACE} IN @{SUBNETS}
120 \ Remove Interface ${ROUTERS[0]} ${INTERFACE}
123 [Documentation] Delete Router and Interface to the subnets.
124 Delete Router ${ROUTERS[0]}
127 [Documentation] Delete L3VPN
128 VPN Delete L3VPN ${CREATE_ID}
130 Check Datapath Traffic Across Networks With L3VPN
131 [Documentation] Datapath Test Across the networks with VPN.
133 Log This test will be added in the next patch
136 [Documentation] Delete Vm instances in the given Instance List
137 : FOR ${VmInstance} IN @{VM_INSTANCES}
138 \ Delete Vm Instance ${VmInstance}
141 [Documentation] Delete Neutron Ports in the given Port List.
142 : FOR ${Port} IN @{PORT_LIST}
143 \ Delete Port ${Port}
146 [Documentation] Delete Sub Nets in the given Subnet List.
147 : FOR ${Subnet} IN @{SUBNETS}
148 \ Delete SubNet ${Subnet}
151 [Documentation] Delete Networks in the given Net List
152 : FOR ${Network} IN @{NETWORKS}
153 \ Delete Network ${Network}
156 Basic Vpnservice Suite Setup
157 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
159 Basic Vpnservice Suite Teardown