Tidied up robot files
[integration/test.git] / csit / suites / openstack / vpnservice / basic_vpnservice.robot
1 *** Settings ***
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
8 Library           SSHLibrary
9 Library           OperatingSystem
10 Library           RequestsLibrary
11 Resource          ../../../libraries/Utils.robot
12 Resource          ../../../libraries/OpenStackOperations.robot
13 Resource          ../../../libraries/DevstackUtils.robot
14 Variables         ../../../variables/Variables.py
15
16 *** Variables ***
17 @{NETWORKS}       NET10    NET20
18 @{SUBNETS}        SUBNET1    SUBNET2
19 @{SUBNET_CIDR}    10.1.1.0/24    20.1.1.0/24
20 @{PORT_LIST}      PORT11    PORT21    PORT12    PORT22
21 @{VM_INSTANCES}    VM11    VM21    VM12    VM22
22 @{ROUTERS}        ROUTER_1    ROUTER_2
23
24 *** Test Cases ***
25 Verify Tunnel Creation
26     [Documentation]    Checks that vxlan tunnels have been created properly.
27     [Tags]    exclude
28     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
29     ...    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.
30
31 Create Neutron Networks
32     [Documentation]    Create two networks
33     Create Network    ${NETWORKS[0]}    --provider:network_type local
34     Create Network    ${NETWORKS[1]}    --provider:network_type local
35     List Networks
36
37 Create Neutron Subnets
38     [Documentation]    Create two subnets for previously created networks
39     Create SubNet    ${NETWORKS[0]}    ${SUBNETS[0]}    ${SUBNET_CIDR[0]}
40     Create SubNet    ${NETWORKS[1]}    ${SUBNETS[1]}    ${SUBNET_CIDR[1]}
41     List Subnets
42
43 Create Neutron Ports
44     [Documentation]    Create four ports under previously created subnets
45     Create Port    ${NETWORKS[0]}    ${PORT_LIST[0]}
46     Create Port    ${NETWORKS[0]}    ${PORT_LIST[1]}
47     Create Port    ${NETWORKS[1]}    ${PORT_LIST[2]}
48     Create Port    ${NETWORKS[1]}    ${PORT_LIST[3]}
49
50 Check OpenDaylight Neutron Ports
51     [Documentation]    Checking OpenDaylight Neutron API for known ports
52     ${resp}    RequestsLibrary.Get Request    session    ${NEUTRON_PORTS_API}
53     Log    ${resp.content}
54     Should be Equal As Strings    ${resp.status_code}    200
55
56 Create Nova VMs
57     [Documentation]    Create two subnets for previously created networks
58     Create Vm Instance With Port On Compute Node    ${PORT_LIST[0]}    ${VM_INSTANCES[0]}    ${OS_COMPUTE_1_IP}
59     Create Vm Instance With Port On Compute Node    ${PORT_LIST[1]}    ${VM_INSTANCES[1]}    ${OS_COMPUTE_2_IP}
60     Create Vm Instance With Port On Compute Node    ${PORT_LIST[2]}    ${VM_INSTANCES[2]}    ${OS_COMPUTE_1_IP}
61     Create Vm Instance With Port On Compute Node    ${PORT_LIST[3]}    ${VM_INSTANCES[3]}    ${OS_COMPUTE_2_IP}
62
63 Check ELAN Datapath Traffic Within The Networks
64     [Documentation]    Checks datapath within the same network with different vlans.
65     [Tags]    exclude
66     Log    This test will be added in the next patch
67
68 Create Routers
69     [Documentation]    Create Router
70     Create Router    ${ROUTERS[0]}
71
72 Add Interfaces To Router
73     [Documentation]    Add Interfaces
74     : FOR    ${INTERFACE}    IN    @{SUBNETS}
75     \    Add Router Interface    ${ROUTERS[0]}    ${INTERFACE}
76
77 Check L3_Datapath Traffic Across Networks With Router
78     [Documentation]    Datapath Test Across the networks using Router for L3.
79     [Tags]    exclude
80     Log    This test will be added in the next patch
81
82 Delete Router Interfaces
83     [Documentation]    Remove Interface to the subnets.
84     : FOR    ${INTERFACE}    IN    @{SUBNETS}
85     \    Remove Interface    ${ROUTERS[0]}    ${INTERFACE}
86
87 Delete Routers
88     [Documentation]    Delete Router and Interface to the subnets.
89     Delete Router    ${ROUTERS[0]}
90
91 Create L3VPN
92     [Documentation]    Create L3VPN.
93     [Tags]    exclude
94     Log    This test will be added in the next patch
95
96 Associate Networks To L3VPN
97     [Documentation]    Associate Networks To L3VPN.
98     [Tags]    exclude
99     Log    This test will be added in the next patch
100
101 Check Datapath Traffic Across Networks With L3VPN
102     [Documentation]    Datapath Test Across the networks with VPN.
103     [Tags]    exclude
104     Log    This test will be added in the next patch
105
106 Delete Vm Instances
107     [Documentation]    Delete Vm instances in the given Instance List
108     : FOR    ${VmInstance}    IN    @{VM_INSTANCES}
109     \    Delete Vm Instance    ${VmInstance}
110
111 Delete Neutron Ports
112     [Documentation]    Delete Neutron Ports in the given Port List.
113     : FOR    ${Port}    IN    @{PORT_LIST}
114     \    Delete SubNet    ${Port}
115
116 Delete Sub Networks
117     [Documentation]    Delete Sub Nets in the given Subnet List.
118     : FOR    ${Subnet}    IN    @{SUBNETS}
119     \    Delete SubNet    ${Subnet}
120
121 Delete Networks
122     [Documentation]    Delete Networks in the given Net List
123     : FOR    ${Network}    IN    @{NETWORKS}
124     \    Delete Network    ${Network}
125
126 *** Keywords ***
127 Basic Vpnservice Suite Setup
128     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
129
130 Basic Vpnservice Suite Teardown
131     Delete All Sessions