3node Tests for the Openstack Integration 53/38053/48
authorpriya.ramasubbu <priya.ramasubbu@hcl.com>
Mon, 25 Apr 2016 15:47:31 +0000 (21:17 +0530)
committerJamo Luhrsen <jluhrsen@redhat.com>
Mon, 16 May 2016 18:12:36 +0000 (18:12 +0000)
     * Add failover test cases for L2/L3
     * Fixed some Keywords which were causing socket closed
     * Add dumpflows and other debugs
     * Verify created and deleted routers with northbound calls

Change-Id: I1ab0f88e322e44ca9928d7feea33b732599168bc
Signed-off-by: priya.ramasubbu <priya.ramasubbu@hcl.com>
csit/libraries/DevstackUtils.robot
csit/libraries/OVSDB.robot
csit/libraries/OpenStackOperations.robot
csit/suites/openstack/clustering/01_l2_tests.robot [new file with mode: 0644]
csit/suites/openstack/clustering/02_l3_tests.robot [new file with mode: 0644]
csit/suites/openstack/connectivity/01_l2_tests.robot
csit/suites/openstack/connectivity/02_l3_tests.robot
csit/suites/ovsdb/Devstack_Tempest_Tests/01__single_node_devstack_tempest_tests.robot
csit/testplans/netvirt-3node-openstack.txt
csit/variables/Variables.py

index bba6fab552bdce52bed1c500dfb1b270aa54268f..f7d4c374123ebb5090f1f05de381f3bc54952164 100644 (file)
@@ -34,8 +34,12 @@ Run Tempest Tests
     # TODO: also need to verify some non-zero pass count as well as other results are ok (e.g. skipped, etc)
 
 Devstack Suite Setup Tests
-    [Documentation]    Login to the Openstack Control Node to run tempest suite
-    SSHLibrary.Open Connection    ${OS_CONTROL_NODE_IP}    prompt=${DEFAULT_LINUX_PROMPT}
+    [Arguments]    ${source_pwd}=no
+    [Documentation]  Login to  the Openstack Control Node to run tempest suite
+    ${devstack_conn_id}=   SSHLibrary.Open Connection    ${OS_CONTROL_NODE_IP}    prompt=${DEFAULT_LINUX_PROMPT}
+    Set Suite Variable    ${devstack_conn_id}
+    Set Suite Variable    ${source_pwd}
+    Log    ${devstack_conn_id}
     Utils.Flexible SSH Login    ${OS_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
     SSHLibrary.Set Client Configuration    timeout=${default_devstack_prompt_timeout}
 
index 8f232843e02e1fa85cee601e9aad4dc70476b91b..b5d4de262aeaa2f3292ecb0271e70b8d859c54e6 100644 (file)
@@ -66,6 +66,7 @@ Verify OVS Reports Connected
     [Documentation]    Uses "vsctl show" to check for string "is_connected"
     ${output}=    Utils.Run Command On Remote System    ${tools_system}    sudo ovs-vsctl show
     Should Contain    ${output}    is_connected
+    [Return]    ${output}
 
 Get OVSDB UUID
     [Arguments]    ${ovs_system_ip}=${TOOLS_SYSTEM_IP}    ${controller_ip}=${ODL_SYSTEM_IP}    ${controller_http_session}=session
index 966d7dd0c44e49724fd5fbf8e8890b3bce161b9f..fa83dc3f1920b5575c5a08d5f8716bfb1892fb8e 100644 (file)
@@ -1,24 +1,29 @@
 *** Settings ***
-Documentation     Openstack library. This library is useful for tests to create network, subnet, router and vm instances
-Library           SSHLibrary
-Resource          Utils.robot
-Variables         ../variables/Variables.py
+Documentation    Openstack library. This library is useful for tests to create network, subnet, router and vm instances
+Library    SSHLibrary
+Resource    Utils.robot
+Variables    ../variables/Variables.py
 
 *** Keywords ***
+Source Password
+    [Arguments]        ${force}=no
+    [Documentation]    Sourcing the Openstack PAsswords for neutron configurations
+    Run Keyword If    '${source_pwd}' == 'yes' or '${force}' == 'yes'     Write Commands Until Prompt    cd ${DEVSTACK_DEPLOY_PATH}; source openrc admin admin
+
 Create Network
-    [Arguments]    ${network_name}    ${devstack_path}=/opt/stack/new/devstack
+    [Arguments]    ${network_name}
     [Documentation]    Create Network with neutron request.
-    ${output}=    Write Commands Until Prompt    cd ${devstack_path} && cat localrc
-    Log    ${output}
-    ${output}=    Write Commands Until Prompt    source openrc admin admin
-    Log    ${output}
-    ${output}=    Write Commands Until Prompt    neutron -v net-create ${network_name}
+    Switch Connection    ${devstack_conn_id}
+    Source Password      force=yes
+    ${output}=    Write Commands Until Prompt    neutron -v net-create ${network_name}    30s
     Log    ${output}
     Should Contain    ${output}    Created a new network
 
 Delete Network
     [Arguments]    ${network_name}
     [Documentation]    Delete Network with neutron request.
+    Switch Connection    ${devstack_conn_id}
+    Source Password
     ${output}=    Write Commands Until Prompt    neutron -v net-delete ${network_name}
     Log    ${output}
     Should Contain    ${output}    Deleted network: ${network_name}
@@ -26,7 +31,9 @@ Delete Network
 Create SubNet
     [Arguments]    ${network_name}    ${subnet}    ${range_ip}
     [Documentation]    Create SubNet for the Network with neutron request.
-    ${output}=    Write Commands Until Prompt    neutron -v subnet-create ${network_name} ${range_ip} --name ${subnet}
+    Switch Connection    ${devstack_conn_id}
+    Source Password
+    ${output}=    Write Commands Until Prompt    neutron -v subnet-create ${network_name} ${range_ip} --name ${subnet}    30s
     Log    ${output}
     Should Contain    ${output}    Created a new subnet
 
@@ -55,6 +62,8 @@ Delete SubNet
     [Arguments]    ${subnet}
     [Documentation]    Delete SubNet for the Network with neutron request.
     Log    ${subnet}
+    Switch Connection    ${devstack_conn_id}
+    Source Password
     ${output}=    Write Commands Until Prompt    neutron -v subnet-delete ${subnet}
     Log    ${output}
     Should Contain    ${output}    Deleted subnet: ${subnet}
@@ -66,22 +75,19 @@ Verify No Gateway Ips
     : FOR    ${GatewayIpElement}    IN    @{GATEWAY_IPS}
     \    Should Not Contain    ${output}    ${GatewayIpElement}
 
-Create Vm Instance
-    [Arguments]    ${net_id}    ${network_name}
-    [Documentation]    Create Vm Instance with the net id of the Netowrk.
-    ${VmElement}=    Set Variable If    "${network_name}"=="net1_network"    MyFirstInstance    MySecondInstance
-    ${output}=    Write Commands Until Prompt    nova boot --image cirros-0.3.4-x86_64-uec --flavor m1.tiny --nic net-id=${net_id} ${VmElement}
-    Log    ${output}
-
 Delete Vm Instance
     [Arguments]    ${vm_name}
     [Documentation]    Delete Vm instances using instance names.
+    Switch Connection    ${devstack_conn_id}
+    Source Password
     ${output}=    Write Commands Until Prompt    nova delete ${vm_name}
-    Log    ${output}
+    Should Contain     ${output}     ${vm_name}
 
 Get Net Id
     [Arguments]    ${network_name}
     [Documentation]    Retrieve the net id for the given network name to create specific vm instance
+    Switch Connection    ${devstack_conn_id}
+    Source Password     force=yes
     ${output}=    Write Commands Until Prompt    neutron net-list | grep "${network_name}" | get_field 1
     Log    ${output}
     ${splitted_output}=    Split String    ${output}    ${EMPTY}
@@ -90,11 +96,22 @@ Get Net Id
     [Return]    ${net_id}
 
 Create Vm Instances
-    [Arguments]    ${net_id}    ${vm_instance_names}    ${image}=cirros-0.3.4-x86_64-uec    ${flavor}=m1.tiny
-    [Documentation]    Create Four Vm Instance with the net id of the Netowrk.
+    [Arguments]    ${net_name}    ${vm_instance_names}    ${image}=cirros-0.3.4-x86_64-uec    ${flavor}=m1.tiny
+    [Documentation]    Create X Vm Instance with the net id of the Netowrk.
+    Switch Connection    ${devstack_conn_id}
+    Source Password
+    ${net_id}=    Get Net Id      ${net_name}
     : FOR    ${VmElement}    IN    @{vm_instance_names}
     \    ${output}=    Write Commands Until Prompt    nova boot --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${VmElement}
     \    Log    ${output}
+    \    Wait Until Keyword Succeeds    25s    5s    Verify VM Is ACTIVE    ${VmElement}
+
+Verify VM Is ACTIVE
+    [Arguments]    ${vm_name}
+    [Documentation]    Run these commands to check whether the created vm instance is active or not.
+    ${output}=    Write Commands Until Prompt    nova show ${vm_name} | grep OS-EXT-STS:vm_state
+    Log    ${output}
+    Should Contain     ${output}    active
 
 View Vm Console
     [Arguments]    ${vm_instance_names}
@@ -106,23 +123,26 @@ View Vm Console
     \    Log    ${output}
 
 Ping Vm From DHCP Namespace
-    [Arguments]    ${net_id}    ${vm_ip}
+    [Arguments]    ${net_name}    ${vm_ip}
     [Documentation]    Reach all Vm Instance with the net id of the Netowrk.
     Log    ${vm_ip}
+    Switch Connection    ${devstack_conn_id}
+    ${net_id}=    Get Net Id      ${net_name}
+    Log    ${net_id}
     ${output}=    Write Commands Until Prompt    sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip}    20s
     Log    ${output}
-    [Return]    ${output}
+    Should Contain    ${output}    64 bytes
 
 Ping From Instance
     [Arguments]    ${dest_vm}
     [Documentation]    Ping to the expected destination ip.
-    ${output}=    Write Commands Until Expected Prompt    ping -c 3 ${dest_vm}    $
+    ${output}=    Write Commands Until Expected Prompt    ping -c 3 ${dest_vm}    ${OS_SYSTEM_PROMPT}
     Log    ${output}
     [Return]    ${output}
 
 Curl Metadata Server
     [Documentation]    Ping to the expected destination ip.
-    ${output}=    Write Commands Until Expected Prompt    curl -i http://169.254.169.254    $
+    ${output}=    Write Commands Until Expected Prompt    curl -i http://169.254.169.254    ${OS_SYSTEM_PROMPT}
     Write Commands Until Prompt    exit
     Should Contain    ${output}    200
 
@@ -131,43 +151,116 @@ Close Vm Instance
     ${output}=    Write Commands Until Prompt    exit
     Log    ${output}
 
-Ssh Vm Instance
-    [Arguments]    ${net_id}    ${vm_ip}    ${user}=cirros    ${password}=cubswin:)    ${key_file}=test.pem
+Check If Console Is VmInstance
+    [Arguments]    ${console}=cirros
+    [Documentation]     Check if the session has been able to login to the VM instance
+    ${output}=       Write Commands Until Expected Prompt      id       ${OS_SYSTEM_PROMPT}
+    Should Contain    ${output}    ${console}
+
+Exit From Vm Console
+    [Documentation]     Check if the session has been able to login to the VM instance and exit the instance
+    ${rcode}=    Run Keyword And Return Status      Check If Console Is VmInstance    cirros
+    Run Keyword If     ${rcode}     Write Commands Until Prompt     exit
+    Get OvsDebugInfo
+
+Check Ping
+    [Arguments]     ${ip_address}
+    [Documentation]     Run Ping command on the IP available as argument
+    ${output}=   Write Commands Until Expected Prompt    ping -c 3 ${ip_address}    ${OS_SYSTEM_PROMPT}
+    Should Contain     ${output}     64 bytes
+
+Check Metadata Access
+    [Documentation]      Try curl on the Metadataurl and check if it is okay
+    ${output}=   Write Commands Until Expected Prompt    curl -i http://169.254.169.254    ${OS_SYSTEM_PROMPT}
+    Should Contain     ${output}     200
+
+Test Operations From Vm Instance
+    [Arguments]    ${net_name}    ${src_ip}    ${list_of_local_dst_ips}    ${l2_or_l3}=l2    ${list_of_external_dst_ips}=${NONE}    ${user}=cirros    ${password}=cubswin:)
     [Documentation]    Login to the vm instance using ssh in the network.
-    ${output}=    Write Commands Until Expected Prompt    sudo ip netns exec qdhcp-${net_id} ssh -i ${key_file} ${user}@${vm_ip}    (yes/no)?
-    Log    ${output}
-    ${output}=    Write Commands Until Expected Prompt    yes    d:
+    Switch Connection    ${devstack_conn_id}
+    Source Password
+    ${net_id}=    Get Net Id      ${net_name}
+    ${output}=   Write Commands Until Expected Prompt    sudo ip netns exec qdhcp-${net_id} ssh ${user}@${src_ip} -o ConnectTimeout=10 -o StrictHostKeyChecking=no      d:
     Log    ${output}
-    ${output}=    Write Commands Until Expected Prompt    ${password}    $
-    Log    ${output}
-    ${output}=    Write Commands Until Expected Prompt    ifconfig    $
-    Log    ${output}
-    ${output}=    Write Commands Until Expected Prompt    route    $
+    ${output}=    Write Commands Until Expected Prompt    ${password}    ${OS_SYSTEM_PROMPT}
     Log    ${output}
+    ${rcode}=    Run Keyword And Return Status      Check If Console Is VmInstance
+    Run Keyword If     ${rcode}     Write Commands Until Expected Prompt    ifconfig    ${OS_SYSTEM_PROMPT}
+    Run Keyword If     ${rcode}     Write Commands Until Expected Prompt    route    ${OS_SYSTEM_PROMPT}
+    ${dest_vm}=    Get From List    ${list_of_local_dst_ips}    0
+    Log    ${dest_vm}
+    Run Keyword If     ${rcode}     Check Ping      ${dest_vm}
+    ${dest_dhcp}=    Get From List    ${list_of_local_dst_ips}    1
+    Log    ${dest_dhcp}
+    Run Keyword If     ${rcode}     Check Ping      ${dest_dhcp}
+    ${dest_vm}=    Get From List    ${list_of_local_dst_ips}    2
+    Log    ${dest_vm}
+    Run Keyword If     ${rcode}     Check Ping      ${dest_vm}
+    Run Keyword If     ${rcode}     Check Metadata Access
+    Run Keyword If    '${l2_or_l3}' == 'l3'    Ping Other Instances    ${list_of_external_dst_ips}
+    [Teardown]      Exit From Vm Console
+
+Ping Other Instances
+    [Arguments]    ${list_of_external_dst_ips}
+    [Documentation]    Check reachability with other network's instances.
+    ${rcode}=    Run Keyword And Return Status      Check If Console Is VmInstance
+    ${dest_vm}=    Get From List    ${list_of_external_dst_ips}    0
+    Log    ${dest_vm}
+    Run Keyword If     ${rcode}     Check Ping      ${dest_vm}
+    ${dest_dhcp}=    Get From List    ${list_of_external_dst_ips}    1
+    Log    ${dest_dhcp}
+    Run Keyword If     ${rcode}     Check Ping      ${dest_dhcp}
+    ${dest_vm}=    Get From List    ${list_of_external_dst_ips}    2
+    Log    ${dest_vm}
+    Run Keyword If     ${rcode}     Check Ping      ${dest_vm}
 
 Create Router
     [Arguments]    ${router_name}
     [Documentation]    Create Router and Add Interface to the subnets.
+    Switch Connection    ${devstack_conn_id}
+    Source Password
     ${output}=    Write Commands Until Prompt    neutron -v router-create ${router_name}
     Should Contain    ${output}    Created a new router
 
 Add Router Interface
     [Arguments]    ${router_name}    ${interface_name}
+    Switch Connection    ${devstack_conn_id}
+    Source Password
     ${output}=    Write Commands Until Prompt    neutron -v router-interface-add ${router_name} ${interface_name}
     Should Contain    ${output}    Added interface
 
 Remove Interface
     [Arguments]    ${router_name}    ${interface_name}
     [Documentation]    Remove Interface to the subnets.
+    Switch Connection    ${devstack_conn_id}
+    Source Password
     ${output}=    Write Commands Until Prompt    neutron -v router-interface-delete ${router_name} ${interface_name}
     Should Contain    ${output}    Removed interface from router
 
 Delete Router
     [Arguments]    ${router_name}
     [Documentation]    Delete Router and Interface to the subnets.
+    Switch Connection    ${devstack_conn_id}
+    Source Password
     ${output}=    Write Commands Until Prompt    neutron -v router-delete ${router_name}
     Should Contain    ${output}    Deleted router:
 
+Get DumpFlows And Ovsconfig
+    [Arguments]    ${openstack_node_ip}
+    [Documentation]    Get the OvsConfig and Flow entries from OVS from the Openstack Node
+    Log     ${openstack_node_ip}
+    SSHLibrary.Open Connection    ${openstack_node_ip}    prompt=${DEFAULT_LINUX_PROMPT}
+    Utils.Flexible SSH Login    ${OS_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
+    SSHLibrary.Set Client Configuration    timeout=${default_devstack_prompt_timeout}
+    Write Commands Until Expected Prompt     sudo ovs-vsctl show       ]>
+    Write Commands Until Expected Prompt     sudo ovs-ofctl dump-flows br-int -OOpenFlow13     ]>
+
+Get OvsDebugInfo
+    [Documentation]    Get the OvsConfig and Flow entries from all Openstack nodes
+    Run Keyword If     0 < ${NUM_OS_SYSTEM}       Get DumpFlows And Ovsconfig     ${OS_CONTROL_NODE_IP}
+    Run Keyword If     1 < ${NUM_OS_SYSTEM}       Get DumpFlows And Ovsconfig     ${OS_COMPUTE_1_IP}
+    Run Keyword If     2 < ${NUM_OS_SYSTEM}       Get DumpFlows And Ovsconfig     ${OS_COMPUTE_2_IP}
+
 Show Debugs
     [Arguments]    ${vm_indices}
     [Documentation]    Run these commands for debugging, it can list state of VM instances and ip information in control node
diff --git a/csit/suites/openstack/clustering/01_l2_tests.robot b/csit/suites/openstack/clustering/01_l2_tests.robot
new file mode 100644 (file)
index 0000000..fc88c2c
--- /dev/null
@@ -0,0 +1,215 @@
+*** Settings ***
+Documentation    Test suite to verify packet flows between vm instances.
+Suite Setup    Devstack Suite Setup Tests     source_pwd=yes
+Suite Teardown      Close All Connections
+Library    SSHLibrary
+Library    OperatingSystem
+Library    RequestsLibrary
+Library    Collections
+Resource    ../../../libraries/Utils.robot
+Resource    ../../../libraries/OpenStackOperations.robot
+Resource    ../../../libraries/DevstackUtils.robot
+Resource    ../../../libraries/OVSDB.robot
+Library    ../../../libraries/Common.py
+Variables    ../../../variables/Variables.py
+Resource    ../../../libraries/ClusterKeywords.robot
+
+*** Variables ***
+@{NETWORKS_NAME}    l2_net_1    l2_net_2
+@{SUBNETS_NAME}    l2_sub_net_1    l2_sub_net_2
+@{NET_1_VM_INSTANCES}    VmInstance1_l2_net_1    VmInstance2_net_1     VmInstance3_net_1
+@{NET_2_VM_INSTANCES}    VmInstance1_l2_net_2    VmInstance2_net_2     VmInstance3_net_2
+@{NET_1_VM_IPS}    70.0.0.3    70.0.0.4     70.0.0.5
+@{NET_2_VM_IPS}    80.0.0.3    80.0.0.4     80.0.0.5
+@{VM_IPS_NOT_DELETED}    70.0.0.4
+@{GATEWAY_IPS}    70.0.0.1    80.0.0.1
+@{DHCP_IPS}    70.0.0.2    80.0.0.2
+@{cluster_down_list}    1    2
+@{SUBNETS_RANGE}    70.0.0.0/24    80.0.0.0/24
+
+*** Test Cases ***
+Create Cluster List
+    [Documentation]    Create original cluster list.
+    ${original_cluster_list}    ClusterKeywords.Create Controller Index List
+    Set Suite Variable    ${original_cluster_list}
+    Log    ${original_cluster_list}
+
+Check OVS Manager Connection Status
+    [Documentation]    This will verify if the OVS manager is connected
+    ${output}=    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${OS_CONTROL_NODE_IP}
+    Log    ${output}
+    Set Suite Variable    ${status}    is_connected: true
+    ${dictionary}=    Create Dictionary    ${status}=9
+    Utils.Check Item Occurrence    ${output}    ${dictionary}
+
+Create Networks
+    [Documentation]    Create Network with neutron request.
+    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
+    \    Create Network    ${NetworkElement}
+
+Create Subnets For l2_net_1
+    [Documentation]    Create Sub Nets for the Networks with neutron request.
+    Create SubNet    l2_net_1    l2_sub_net_1    @{SUBNETS_RANGE}[0]
+
+Create Subnets For l2_net_2
+    [Documentation]    Create Sub Nets for the Networks with neutron request.
+    Create SubNet    l2_net_2    l2_sub_net_2    @{SUBNETS_RANGE}[1]
+
+Take Down ODL1
+    [Documentation]   Kill the karaf in First Controller
+    ClusterKeywords.Kill Multiple Controllers    1
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Remove Values From List    ${new_cluster_list}    1
+    Set Suite Variable    ${new_cluster_list}
+
+Create Vm Instances For l2_net_1
+    [Documentation]    Create Vm instances using flavor and image names for a network.
+    Log    ${devstack_conn_id}
+    Create Vm Instances    l2_net_1    ${NET_1_VM_INSTANCES}
+    [Teardown]    Show Debugs      ${NET_1_VM_INSTANCES}
+
+Bring Up ODL1
+    [Documentation]  Bring up ODL1 again
+    ClusterKeywords.Start Multiple Controllers    300s    1
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Set Suite Variable    ${new_cluster_list}
+
+Take Down ODL2
+    [Documentation]   Kill the karaf in Second Controller
+    ClusterKeywords.Kill Multiple Controllers    2
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Remove Values From List    ${new_cluster_list}    2
+    Set Suite Variable    ${new_cluster_list}
+
+Create Vm Instances For l2_net_2
+    [Documentation]    Create Vm instances using flavor and image names for a network.
+    Create Vm Instances     l2_net_2    ${NET_2_VM_INSTANCES}
+    [Teardown]    Show Debugs      ${NET_2_VM_INSTANCES}
+
+Bring Up ODL2
+    [Documentation]  Bring up ODL2 again
+    ClusterKeywords.Start Multiple Controllers    300s    2
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Set Suite Variable    ${new_cluster_list}
+
+Ping Vm Instance1 In l2_net_1
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace     l2_net_1    @{NET_1_VM_IPS}[0]
+
+Ping Vm Instance2 In l2_net_1
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace     l2_net_1    @{NET_1_VM_IPS}[1]
+
+Ping Vm Instance3 In l2_net_1
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace     l2_net_1    @{NET_1_VM_IPS}[2]
+
+Ping Vm Instance1 In l2_net_2
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace     l2_net_2    @{NET_2_VM_IPS}[0]
+
+Ping Vm Instance2 In l2_net_2
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace     l2_net_2    @{NET_2_VM_IPS}[1]
+
+Ping Vm Instance3 In l2_net_2
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace     l2_net_2    @{NET_2_VM_IPS}[2]
+
+Take Down ODL3
+    [Documentation]   Kill the karaf in Third Controller
+    ClusterKeywords.Kill Multiple Controllers    3
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Remove Values From List    ${new_cluster_list}    3
+    Set Suite Variable    ${new_cluster_list}
+
+Connectivity Tests From Vm Instance1 In l2_net_1
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[1]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_net_1     @{NET_1_VM_IPS}[0]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l2_net_1
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_net_1     @{NET_1_VM_IPS}[1]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l2_net_1
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_net_1     @{NET_1_VM_IPS}[2]    ${dst_ip_list}
+
+Bring Up ODL3
+    [Documentation]  Bring up ODL3 again
+    ClusterKeywords.Start Multiple Controllers    300s    3
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Set Suite Variable    ${new_cluster_list}
+
+Take Down ODL1 and ODL2
+    [Documentation]   Kill the karaf in First and Second Controller
+    : FOR    ${index}    IN    @{cluster_down_list}
+    \    ClusterKeywords.Kill Multiple Controllers    ${index}
+
+Connectivity Tests From Vm Instance1 In l2_net_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[1]    @{DHCP_IPS}[1]     @{NET_2_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_net_2     @{NET_2_VM_IPS}[0]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l2_net_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]     @{NET_2_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_net_2     @{NET_2_VM_IPS}[1]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l2_net_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]     @{NET_2_VM_IPS}[1]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_net_2     @{NET_2_VM_IPS}[2]    ${dst_ip_list}
+
+Bring Up ODL1 and ODL2
+    [Documentation]  Bring up ODL1 and ODL2 again.
+    : FOR    ${index}    IN    @{cluster_down_list}
+    \    ClusterKeywords.Start Multiple Controllers    300s    ${index}
+
+Delete Vm Instance
+    [Documentation]    Delete Vm instances using instance names.
+    Delete Vm Instance    VmInstance1_l2_net_1
+
+Ping All Vm Instances
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    ${net_id}=    Get Net Id    l2_net_1
+    : FOR    ${VmIpElement}    IN    @{VM_IPS_NOT_DELETED}
+    \    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
+    \    Should Contain    ${output}    64 bytes
+
+No Ping For Deleted Vm
+    [Documentation]    Check non reachability of deleted vm instances by pinging to them.
+    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    @{NET_1_VM_IPS}[0]
+    Should Contain    ${output}    Destination Host Unreachable
+
+Delete Vm Instances In network_1
+    [Documentation]    Delete Vm instances using instance names in network_1.
+    : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
+    \    Delete Vm Instance    ${VmElement}
+
+Delete Vm Instances In network_2
+    [Documentation]    Delete Vm instances using instance names in network_2.
+    : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
+    \    Delete Vm Instance    ${VmElement}
+
+Delete Sub Networks In network_1
+    [Documentation]    Delete Sub Nets for the Networks with neutron request.
+    Delete SubNet    l2_sub_net_1
+
+Delete Sub Networks In network_2
+    [Documentation]    Delete Sub Nets for the Networks with neutron request.
+    Delete SubNet    l2_sub_net_2
+
+Delete Networks
+    [Documentation]    Delete Networks with neutron request.
+    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
+    \    Delete Network    ${NetworkElement}
diff --git a/csit/suites/openstack/clustering/02_l3_tests.robot b/csit/suites/openstack/clustering/02_l3_tests.robot
new file mode 100644 (file)
index 0000000..e0613a6
--- /dev/null
@@ -0,0 +1,234 @@
+*** Settings ***
+Documentation    Test suite to check connectivity in L3 using routers.
+Suite Setup    Devstack Suite Setup Tests     source_pwd=yes
+Suite Teardown      Close All Connections
+Library    SSHLibrary
+Library    OperatingSystem
+Library    RequestsLibrary
+Resource    ../../../libraries/Utils.robot
+Resource    ../../../libraries/OpenStackOperations.robot
+Resource    ../../../libraries/DevstackUtils.robot
+Resource    ../../../libraries/ClusterKeywords.robot
+
+*** Variables ***
+@{NETWORKS_NAME}    l3_net_1    l3_net_2
+@{SUBNETS_NAME}    l3_sub_net_1    l3_sub_net_2
+@{NET_1_VM_INSTANCES}    VmInstance1_net_1    VmInstance2_net_1       VmInstance3_net_1
+@{NET_2_VM_INSTANCES}    VmInstance1_net_2    VmInstance2_net_2       VmInstance3_net_2
+@{NET_1_VM_IPS}    90.0.0.3    90.0.0.4      90.0.0.5
+@{NET_2_VM_IPS}    100.0.0.3    100.0.0.4    100.0.0.5
+@{GATEWAY_IPS}    90.0.0.1    100.0.0.1
+@{DHCP_IPS}    90.0.0.2    100.0.0.2
+@{SUBNETS_RANGE}    90.0.0.0/24    100.0.0.0/24
+@{odl_1_and_2_down}    1    2
+@{odl_2_and_3_down}    2    3
+
+*** Test Cases ***
+Create Networks
+    [Documentation]    Create Network with neutron request.
+    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
+    \    Create Network    ${NetworkElement}
+
+Create Subnets For l3_net_1
+    [Documentation]    Create Sub Nets for the Networks with neutron request.
+    Create SubNet    l3_net_1    l3_sub_net_1    @{SUBNETS_RANGE}[0]
+
+Create Subnets For l3_net_2
+    [Documentation]    Create Sub Nets for the Networks with neutron request.
+    Create SubNet    l3_net_2    l3_sub_net_2    @{SUBNETS_RANGE}[1]
+
+Take Down ODL1
+    [Documentation]   Kill the karaf in First Controller
+    ClusterKeywords.Kill Multiple Controllers    1
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Remove Values From List    ${new_cluster_list}    1
+    Set Suite Variable    ${new_cluster_list}
+
+Create Vm Instances For l3_net_1
+    [Documentation]    Create Four Vm instances using flavor and image names for a network.
+    Create Vm Instances    l3_net_1    ${NET_1_VM_INSTANCES}
+    [Teardown]    Show Debugs      ${NET_1_VM_INSTANCES}
+
+Bring Up ODL1
+    [Documentation]  Bring up ODL1 again
+    ClusterKeywords.Start Multiple Controllers    300s    1
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Set Suite Variable    ${new_cluster_list}
+
+Take Down ODL2
+    [Documentation]   Kill the karaf in Second Controller
+    ClusterKeywords.Kill Multiple Controllers    2
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Remove Values From List    ${new_cluster_list}    2
+    Set Suite Variable    ${new_cluster_list}
+
+Create Vm Instances For l3_net_2
+    [Documentation]    Create Four Vm instances using flavor and image names for a network.
+    Create Vm Instances     l3_net_2      ${NET_2_VM_INSTANCES}
+    [Teardown]    Show Debugs      ${NET_2_VM_INSTANCES}
+
+Bring Up ODL2
+    [Documentation]  Bring up ODL2 again
+    ClusterKeywords.Start Multiple Controllers    300s    2
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Set Suite Variable    ${new_cluster_list}
+
+Take Down ODL3
+    [Documentation]   Kill the karaf in Third Controller
+    ClusterKeywords.Kill Multiple Controllers    3
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Remove Values From List    ${new_cluster_list}    3
+    Set Suite Variable    ${new_cluster_list}
+
+Create Routers
+    [Documentation]    Create Router and Add Interface to the subnets.
+    Create Router    router_2
+    Create Router    router_3
+
+Add Interfaces To Router
+    [Documentation]    Add Interfaces
+    : FOR     ${interface}    IN     @{SUBNETS_NAME}
+    \    Add Router Interface     router_3     ${interface}
+
+Verify Created Routers
+    [Documentation]    Check created routers using northbound rest calls
+    ${data}    Utils.Get Data From URI    1    ${NEUTRON_ROUTERS_API}
+    Log    ${data}
+    Should Contain    ${data}    router_3
+
+Bring Up ODL3
+    [Documentation]  Bring up ODL3 again
+    ClusterKeywords.Start Multiple Controllers    300s    3
+    ${new_cluster_list}    ClusterKeywords.Create Controller Index List
+    Set Suite Variable    ${new_cluster_list}
+
+Ping Vm Instance1 In l3_net_2 From l3_net_1
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    l3_net_1    @{NET_2_VM_IPS}[0]
+
+Ping Vm Instance2 In l3_net_2 From l3_net_1
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    l3_net_1    @{NET_2_VM_IPS}[1]
+
+Ping Vm Instance3 In l3_net_2 From l3_net_1
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    l3_net_1    @{NET_2_VM_IPS}[2]
+
+Ping Vm Instance In l3_net_1 From l3_net_2
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    l3_net_2    @{NET_1_VM_IPS}[0]
+
+Ping Vm Instance In l3_net_1 From l3_net_2
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    l3_net_2    @{NET_1_VM_IPS}[1]
+
+Ping Vm Instance In l3_net_1 From l3_net_2
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    l3_net_2    @{NET_1_VM_IPS}[2]
+
+Take Down ODL1 and ODL2
+    [Documentation]   Kill the karaf in First and Second Controller
+    : FOR    ${index}    IN    @{odl_1_and_2_down}
+    \    ClusterKeywords.Kill Multiple Controllers    ${index}
+
+Connectivity Tests From Vm Instance1 In l3_net_1
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[1]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[2]    @{NET_2_VM_IPS}[1]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance    l3_net_1    @{NET_1_VM_IPS}[0]     ${dst_ip_list}     l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l3_net_1
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance    l3_net_1    @{NET_1_VM_IPS}[1]     ${dst_ip_list}     l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l3_net_1
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance    l3_net_1    @{NET_1_VM_IPS}[2]     ${dst_ip_list}     l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
+
+Bring Up ODL1 and ODL2
+    [Documentation]  Bring up ODL1 and ODL2 again
+    : FOR    ${index}    IN    @{odl_1_and_2_down}
+    \    ClusterKeywords.Start Multiple Controllers    300s    ${index}
+
+Take Down ODL2 and ODL3
+    [Documentation]   Kill the karaf in First and Second Controller
+    : FOR    ${index}    IN    @{odl_2_and_3_down}
+    \    ClusterKeywords.Kill Multiple Controllers    ${index}
+
+Connectivity Tests From Vm Instance1 In l3_net_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[1]    @{DHCP_IPS}[1]      @{NET_2_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance     l3_net_2    @{NET_2_VM_IPS}[0]     ${dst_ip_list}     l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l3_net_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]      @{NET_2_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance     l3_net_2    @{NET_2_VM_IPS}[1]     ${dst_ip_list}     l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l3_net_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]      @{NET_2_VM_IPS}[1]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance     l3_net_2    @{NET_2_VM_IPS}[2]     ${dst_ip_list}     l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
+
+Bring Up ODL2 and ODL3
+    [Documentation]  Bring up ODL2 and ODL3 again.
+    : FOR    ${index}    IN    @{odl_2_and_3_down}
+    \    ClusterKeywords.Start Multiple Controllers    300s    ${index}
+
+Delete Vm Instances In l3_net_1
+    [Documentation]    Delete Vm instances using instance names in l3_net_1.
+    : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
+    \    Delete Vm Instance    ${VmElement}
+
+Delete Vm Instances In l3_net_2
+    [Documentation]    Delete Vm instances using instance names in l3_net_2.
+    : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
+    \    Delete Vm Instance    ${VmElement}
+
+Delete Router Interfaces
+    [Documentation]    Remove Interface to the subnets.
+    : FOR     ${interface}    IN     @{SUBNETS_NAME}
+    \     Remove Interface     router_3     ${interface}
+
+Delete Routers
+    [Documentation]    Delete Router and Interface to the subnets.
+    Delete Router    router_2
+    Delete Router    router_3
+
+Verify Deleted Routers
+    [Documentation]    Check deleted routers using northbound rest calls
+    ${data}    Utils.Get Data From URI    1    ${NEUTRON_ROUTERS_API}
+    Log    ${data}
+    Should Not Contain    ${data}    router_3
+
+Delete Sub Networks In l3_net_1
+    [Documentation]    Delete Sub Nets for the Networks with neutron request.
+    Delete SubNet    l3_sub_net_1
+
+Delete Sub Networks In l3_net_2
+    [Documentation]    Delete Sub Nets for the Networks with neutron request.
+    Delete SubNet    l3_sub_net_2
+
+Delete Networks
+    [Documentation]    Delete Networks with neutron request.
+    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
+    \    Delete Network    ${NetworkElement}
index 343996315f8aafe8994f8af1de203f2b5d8d112e..94f7d9decbaff32b88e46b036ff60ec0438a8e7d 100644 (file)
 *** Settings ***
-Documentation     Test suite to verify packet flows between vm instances.
-Suite Setup       Devstack Suite Setup Tests
-Library           SSHLibrary
-Library           OperatingSystem
-Library           RequestsLibrary
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/OpenStackOperations.robot
-Resource          ../../../libraries/DevstackUtils.robot
+Documentation    Test suite to verify packet flows between vm instances.
+Suite Setup    Devstack Suite Setup Tests
+Suite Teardown      Close All Connections
+Library    SSHLibrary
+Library    OperatingSystem
+Library    RequestsLibrary
+Resource    ../../../libraries/Utils.robot
+Resource    ../../../libraries/OpenStackOperations.robot
+Resource    ../../../libraries/DevstackUtils.robot
 
 *** Variables ***
-@{NETWORKS_NAME}    network_1    network_2
-@{SUBNETS_NAME}    subnet_1    subnet_2
-@{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1
-@{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2
-@{NET_1_VM_IPS}    30.0.0.3    30.0.0.4
-@{NET_2_VM_IPS}    40.0.0.3    40.0.0.4
+@{NETWORKS_NAME}    l2_network_1    l2_network_2
+@{SUBNETS_NAME}    l2_subnet_1    l2_subnet_2
+@{NET_1_VM_INSTANCES}    MyFirstInstance_1    MySecondInstance_1      MyThirdInstance_1
+@{NET_2_VM_INSTANCES}    MyFirstInstance_2    MySecondInstance_2      MyThirdInstance_2
+@{NET_1_VM_IPS}    30.0.0.3    30.0.0.4     30.0.0.5
+@{NET_2_VM_IPS}    40.0.0.3    40.0.0.4     40.0.0.5
 @{VM_IPS_NOT_DELETED}    30.0.0.4
 @{GATEWAY_IPS}    30.0.0.1    40.0.0.1
 @{DHCP_IPS}       30.0.0.2    40.0.0.2
+@{SUBNETS_RANGE}    30.0.0.0/24    40.0.0.0/24
 
 *** Test Cases ***
 Create Networks
     [Documentation]    Create Network with neutron request.
     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
-    \    Create Network    ${NetworkElement}    devstack_path=/opt/stack/devstack
+    \    Create Network    ${NetworkElement}
 
-Create Subnets For network_1
+Create Subnets For l2_network_1
     [Documentation]    Create Sub Nets for the Networks with neutron request.
-    Create SubNet    network_1    subnet_1    30.0.0.0/24
+    Create SubNet    l2_network_1    l2_subnet_1    @{SUBNETS_RANGE}[0]
 
-Create Subnets For network_2
+Create Subnets For l2_network_2
     [Documentation]    Create Sub Nets for the Networks with neutron request.
-    Create SubNet    network_2    subnet_2    40.0.0.0/24
+    Create SubNet    l2_network_2    l2_subnet_2    @{SUBNETS_RANGE}[1]
 
-Create Vm Instances For network_1
+Create Vm Instances For l2_network_1
     [Documentation]    Create Four Vm instances using flavor and image names for a network.
-    ${net_id}=    Get Net Id    network_1
-    Create Vm Instances    ${net_id}    ${NET_1_VM_INSTANCES}
+    Create Vm Instances    l2_network_1    ${NET_1_VM_INSTANCES}
     [Teardown]    Show Debugs    ${NET_1_VM_INSTANCES}
 
-Create Vm Instances For network_2
+Create Vm Instances For l2_network_2
     [Documentation]    Create Four Vm instances using flavor and image names for a network.
-    ${net_id}=    Get Net Id    network_2
-    Set Suite Variable    ${net_id}
-    Create Vm Instances    ${net_id}    ${NET_2_VM_INSTANCES}
+    Create Vm Instances    l2_network_2    ${NET_2_VM_INSTANCES}
     [Teardown]    Show Debugs    ${NET_2_VM_INSTANCES}
 
-Ping All Vm Instances In network_1
+Ping Vm Instance1 In l2_network_1
     [Documentation]    Check reachability of vm instances by pinging to them.
-    ${net_id}=    Get Net Id    network_1
-    : FOR    ${VmIpElement}    IN    @{NET_1_VM_IPS}
-    \    ${output}    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
-    \    Should Contain    ${output}    64 bytes
+    Ping Vm From DHCP Namespace    l2_network_1      @{NET_1_VM_IPS}[0]
 
-Ping All Vm Instances In network_2
+Ping Vm Instance2 In l2_network_1
     [Documentation]    Check reachability of vm instances by pinging to them.
-    ${net_id}=    Get Net Id    network_2
-    : FOR    ${VmIpElement}    IN    @{NET_2_VM_IPS}
-    \    ${output}    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
-    \    Should Contain    ${output}    64 bytes
-
-Login to Vm Instances In network_1 Using Ssh
-    [Documentation]    Logging to the vm instance using generated key pair.
-    ${net_id}=    Get Net Id    network_1
-    Ssh Vm Instance    ${net_id}    30.0.0.3
+    Ping Vm From DHCP Namespace    l2_network_1     @{NET_1_VM_IPS}[1]
 
-Ping Vm Instance From Instance In network_1
-    [Documentation]    Check reachability of vm instances by pinging.
-    ${output}=    Ping From Instance    30.0.0.4
-    Should Contain    ${output}    64 bytes
+Ping Vm Instance3 In l2_network_1
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace    l2_network_1     @{NET_1_VM_IPS}[2]
 
-Ping Dhcp Server From Instance In network_1
-    [Documentation]    ping the dhcp server from instance.
-    ${output}=    Ping From Instance    30.0.0.2
-    Should Contain    ${output}    64 bytes
+Ping Vm Instance1 In l2_network_2
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace    l2_network_2     @{NET_2_VM_IPS}[0]
 
-Ping Metadata Server From Instance In network_1
-    [Documentation]    ping the metadata server from instance.
-    Curl Metadata Server
+Ping Vm Instance2 In l2_network_2
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace     l2_network_2      @{NET_2_VM_IPS}[1]
 
-Login to Vm Instances In network_2 Using Ssh
+Ping Vm Instance3 In l2_network_2
+    [Documentation]    Check reachability of vm instances by pinging to them.
+    Ping Vm From DHCP Namespace    l2_network_2     @{NET_2_VM_IPS}[2]
+
+Connectivity Tests From Vm Instance1 In l2_network_1
+    [Documentation]    Logging to the vm instance1 
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[1]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_network_1     @{NET_1_VM_IPS}[0]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l2_network_1
+    [Documentation]    Logging to the vm instance2 
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_network_1    @{NET_1_VM_IPS}[1]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l2_network_1
+    [Documentation]    Logging to the vm instance2 
+    ${dst_ip_list}=    Create List    @{NET_1_VM_IPS}[0]    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_network_1    @{NET_1_VM_IPS}[2]    ${dst_ip_list}
+
+Connectivity Tests From Vm Instance1 In l2_network_2
     [Documentation]    Logging to the vm instance using generated key pair.
-    ${net_id}=    Get Net Id    network_2
-    Ssh Vm Instance    ${net_id}    40.0.0.3
-
-Ping Vm Instance From Instance In network_2
-    [Documentation]    Check reachability of vm instances by pinging.
-    ${output}=    Ping From Instance    40.0.0.4
-    Should Contain    ${output}    64 bytes
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[1]    @{DHCP_IPS}[1]     @{NET_2_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_network_2     @{NET_2_VM_IPS}[0]    ${dst_ip_list}
 
-Ping Dhcp Server From Instance In network_2
-    [Documentation]    ping the dhcp server from instance.
-    ${output}=    Ping From Instance    40.0.0.2
-    Should Contain    ${output}    64 bytes
-
-Ping Metadata Server From Instance In network_2
-    [Documentation]    ping the metadata server from instance.
-    Curl Metadata Server
+Connectivity Tests From Vm Instance2 In l2_network_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]     @{NET_2_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_network_2     @{NET_2_VM_IPS}[1]    ${dst_ip_list}
 
-Delete Vm Instance
-    [Documentation]    Delete Vm instances using instance names.
-    Delete Vm Instance    MyFirstInstance_1
+Connectivity Tests From Vm Instance3 In l2_network_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{NET_2_VM_IPS}[0]    @{DHCP_IPS}[1]     @{NET_2_VM_IPS}[1]
+    Log    ${dst_ip_list}
+    Test Operations From Vm Instance      l2_network_2     @{NET_2_VM_IPS}[2]    ${dst_ip_list}
 
 Ping All Vm Instances
     [Documentation]    Check reachability of vm instances by pinging to them.
-    ${net_id}=    Get Net Id    network_1
+    ${net_id}=    Get Net Id    l2_network_1
     : FOR    ${VmIpElement}    IN    @{VM_IPS_NOT_DELETED}
     \    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    ${VmIpElement}
     \    Should Contain    ${output}    64 bytes
 
 No Ping For Deleted Vm
     [Documentation]    Check non reachability of deleted vm instances by pinging to them.
-    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    30.0.0.3
+    ${output}=    Ping Vm From DHCP Namespace    ${net_id}    @{NET_1_VM_IPS}[0]
     Should Contain    ${output}    Destination Host Unreachable
 
-Delete Vm Instances In network_1
-    [Documentation]    Delete Vm instances using instance names in network_1.
+Delete Vm Instances In l2_network_1
+    [Documentation]    Delete Vm instances using instance names in l2_network_1.
     : FOR    ${VmElement}    IN    @{NET_1_VM_INSTANCES}
     \    Delete Vm Instance    ${VmElement}
 
-Delete Vm Instances In network_2
-    [Documentation]    Delete Vm instances using instance names in network_2.
+Delete Vm Instances In l2_network_2
+    [Documentation]    Delete Vm instances using instance names in l2_network_2.
     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
     \    Delete Vm Instance    ${VmElement}
 
-Delete Sub Networks In network_1
+Delete Sub Networks In l2_network_1
     [Documentation]    Delete Sub Nets for the Networks with neutron request.
-    Delete SubNet    subnet_1
+    Delete SubNet    l2_subnet_1
 
-Delete Sub Networks In network_2
+Delete Sub Networks In l2_network_2
     [Documentation]    Delete Sub Nets for the Networks with neutron request.
-    Delete SubNet    subnet_2
+    Delete SubNet    l2_subnet_2
 
 Delete Networks
     [Documentation]    Delete Networks with neutron request.
index 166ec89718bb555b572fd24405617ed01840a0a2..77cc74d44e0ef2bd4915c5957ae502610c8c74da 100644 (file)
@@ -1,47 +1,47 @@
 *** Settings ***
-Documentation     Test suite to check connectivity in L3 using routers.
-Suite Setup       Devstack Suite Setup Tests
-Library           SSHLibrary
-Library           OperatingSystem
-Library           RequestsLibrary
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/OpenStackOperations.robot
-Resource          ../../../libraries/DevstackUtils.robot
+Documentation    Test suite to check connectivity in L3 using routers.
+Suite Setup    Devstack Suite Setup Tests
+Suite Teardown      Close All Connections
+Library    SSHLibrary
+Library    OperatingSystem
+Library    RequestsLibrary
+Resource    ../../../libraries/Utils.robot
+Resource    ../../../libraries/OpenStackOperations.robot
+Resource    ../../../libraries/DevstackUtils.robot
 
 *** Variables ***
 @{NETWORKS_NAME}    network_1    network_2
 @{SUBNETS_NAME}    subnet_1    subnet_2
-@{NET_1_VM_INSTANCES}    MyFirstInstance_1
-@{NET_2_VM_INSTANCES}    MyFirstInstance_2
-@{NET_1_VM_IPS}    50.0.0.3
-@{NET_2_VM_IPS}    60.0.0.3
+@{NET_1_VM_INSTANCES}    l3_instance_net_1_1   l3_instance_net_1_2      l3_instance_net_1_3
+@{NET_2_VM_INSTANCES}    l3_instance_net_2_1   l3_instance_net_2_2      l3_instance_net_2_3
+@{NET_1_VM_IPS}    50.0.0.3    50.0.0.4     50.0.0.5
+@{NET_2_VM_IPS}    60.0.0.3    60.0.0.4     60.0.0.5
 @{GATEWAY_IPS}    50.0.0.1    60.0.0.1
 @{DHCP_IPS}       50.0.0.2    60.0.0.2
+@{SUBNETS_RANGE}    50.0.0.0/24    60.0.0.0/24
 
 *** Test Cases ***
 Create Networks
     [Documentation]    Create Network with neutron request.
     : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
-    \    Create Network    ${NetworkElement}    devstack_path=/opt/stack/devstack
+    \    Create Network    ${NetworkElement}
 
 Create Subnets For network_1
     [Documentation]    Create Sub Nets for the Networks with neutron request.
-    Create SubNet    network_1    subnet_1    50.0.0.0/24
+    Create SubNet    network_1    subnet_1    @{SUBNETS_RANGE}[0]
 
 Create Subnets For network_2
     [Documentation]    Create Sub Nets for the Networks with neutron request.
-    Create SubNet    network_2    subnet_2    60.0.0.0/24
+    Create SubNet    network_2    subnet_2    @{SUBNETS_RANGE}[1]
 
 Create Vm Instances For network_1
     [Documentation]    Create Four Vm instances using flavor and image names for a network.
-    ${net_id}=    Get Net Id    network_1
-    Create Vm Instances    ${net_id}    ${NET_1_VM_INSTANCES}
+    Create Vm Instances     network_1     ${NET_1_VM_INSTANCES}
     [Teardown]    Show Debugs    ${NET_1_VM_INSTANCES}
 
 Create Vm Instances For network_2
     [Documentation]    Create Four Vm instances using flavor and image names for a network.
-    ${net_id}=    Get Net Id    network_2
-    Create Vm Instances    ${net_id}    ${NET_2_VM_INSTANCES}
+    Create Vm Instances     network_2     ${NET_2_VM_INSTANCES}
     [Teardown]    Show Debugs    ${NET_2_VM_INSTANCES}
 
 Create Routers
@@ -53,49 +53,77 @@ Add Interfaces To Router
     : FOR    ${interface}    IN    @{SUBNETS_NAME}
     \    Add Router Interface    router_1    ${interface}
 
-Ping Vm Instance In network_2 From network_1
+Ping Vm Instance1 In network_2 From network_1
     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
-    ${net_id}=    Get Net Id    network_1
-    ${output}    Ping Vm From DHCP Namespace    ${net_id}    60.0.0.3
-    Should Contain    ${output}    64 bytes
+    Ping Vm From DHCP Namespace    network_1    @{NET_2_VM_IPS}[0]
 
-Ping Vm Instance In network_1 From network_2
+Ping Vm Instance2 In network_2 From network_1
     [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
-    ${net_id}=    Get Net Id    network_2
-    ${output}    Ping Vm From DHCP Namespace    ${net_id}    50.0.0.3
-    Should Contain    ${output}    64 bytes
+    Ping Vm From DHCP Namespace    network_1    @{NET_2_VM_IPS}[1]
 
-Login to Vm Instances In network_1 Using Ssh
+Ping Vm Instance3 In network_2 From network_1
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    network_1    @{NET_2_VM_IPS}[2]
+
+Ping Vm Instance1 In network_1 From network_2
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    network_2    @{NET_1_VM_IPS}[0]
+
+Ping Vm Instance2 In network_1 From network_2
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    network_2    @{NET_1_VM_IPS}[1]
+
+Ping Vm Instance3 In network_1 From network_2
+    [Documentation]    Check reachability of vm instances by pinging to them after creating routers.
+    Ping Vm From DHCP Namespace    network_2    @{NET_1_VM_IPS}[2]
+
+Connectivity Tests From Vm Instance1 In network_1
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]     @{NET_2_VM_IPS}[1]    @{NET_2_VM_IPS}[2] 
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance      network_1    @{NET_1_VM_IPS}[0]    ${dst_ip_list}    l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In network_1
     [Documentation]    Logging to the vm instance using generated key pair.
-    ${net_id}=    Get Net Id    network_1
-    Ssh Vm Instance    ${net_id}    50.0.0.3
+    ${dst_ip_list}=    Create List    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]     @{NET_2_VM_IPS}[1]      @{NET_2_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance      network_1    @{NET_1_VM_IPS}[1]    ${dst_ip_list}    l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
 
-Ping Vm Instance From Instance In network_1
-    [Documentation]    Check reachability of vm instances by pinging.
-    ${output}=    Ping From Instance    60.0.0.3
-    Should Contain    ${output}    64 bytes
+Connectivity Tests From Vm Instance3 In network_1
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{DHCP_IPS}[0]     @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]     @{NET_2_VM_IPS}[1]      @{NET_2_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance      network_1    @{NET_1_VM_IPS}[2]    ${dst_ip_list}    l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
 
-Ping Dhcp Server In network_2 From Instance In network_1
-    [Documentation]    ping the dhcp server from instance.
-    ${output}=    Ping From Instance    60.0.0.2
-    Should Contain    ${output}    64 bytes
-    Close Vm Instance
+Connectivity Tests From Vm Instance1 In network_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[1]    @{NET_2_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[0]    @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance      network_2     @{NET_2_VM_IPS}[0]    ${dst_ip_list}    l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In network_2
+    [Documentation]    Logging to the vm instance using generated key pair.
+    ${dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]    @{NET_2_VM_IPS}[2]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[0]    @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance      network_2     @{NET_2_VM_IPS}[1]    ${dst_ip_list}    l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
 
-Login to Vm Instances In network_2 Using Ssh
+Connectivity Tests From Vm Instance3 In network_2
     [Documentation]    Logging to the vm instance using generated key pair.
-    ${net_id}=    Get Net Id    network_2
-    Ssh Vm Instance    ${net_id}    60.0.0.3
-
-Ping Vm Instance From Instance In network_2
-    [Documentation]    Check reachability of vm instances by pinging.
-    ${output}=    Ping From Instance    50.0.0.3
-    Should Contain    ${output}    64 bytes
-
-Ping Dhcp Server In network_1 From Instance In network_2
-    [Documentation]    ping the dhcp server from instance.
-    ${output}=    Ping From Instance    50.0.0.2
-    Should Contain    ${output}    64 bytes
-    Close Vm Instance
+    ${dst_ip_list}=    Create List    @{DHCP_IPS}[1]    @{NET_2_VM_IPS}[0]    @{NET_2_VM_IPS}[1]
+    Log    ${dst_ip_list}
+    ${other_dst_ip_list}=    Create List    @{DHCP_IPS}[0]    @{NET_1_VM_IPS}[0]    @{NET_1_VM_IPS}[1]     @{NET_1_VM_IPS}[2]
+    Log    ${other_dst_ip_list}
+    Test Operations From Vm Instance      network_2     @{NET_2_VM_IPS}[2]    ${dst_ip_list}    l2_or_l3=l3     list_of_external_dst_ips=${other_dst_ip_list}
 
 Delete Vm Instances In network_1
     [Documentation]    Delete Vm instances using instance names in network_1.
index 88dcb4c616a1246c1ddb22c95a7e7421a67450fa..fb4b228e28d97a3e78793cd01adf5ed276a5ac48 100644 (file)
@@ -74,11 +74,15 @@ List Nova Flavor
     ${output}=    Write Commands Until Prompt    nova flavor-list
     Log    ${output}
 
-Create Vm Instances
+Create Vm Instances For net1_network
     [Documentation]    Create Vm instances using flavor and image names.
-    : FOR    ${NetworkElement}    IN    @{NETWORKS_NAME}
-    \    ${net_id}=    Get Net Id    ${NetworkElement}
-    \    Create Vm Instance    ${net_id}    ${NetworkElement}
+    ${net_id}=    Get Net Id    net1_network
+    Create Vm Instances    ${net_id}    ${VM_INSTANCES_NAME}
+
+Create Vm Instances For net2_network
+    [Documentation]    Create Vm instances using flavor and image names.
+    ${net_id}=    Get Net Id    net2_network
+    Create Vm Instances    ${net_id}    ${VM_INSTANCES_NAME}
 
 Show Details of Created Vm Instance
     [Documentation]    View Details of the created vm instances using nova show.
index 1440edf3c7dc162f2a395ed5b4fabc33df6b2f77..4a574ead25c85d64f685ceb4ac4cc07fcbf22078 100644 (file)
@@ -1 +1,3 @@
 integration/test/csit/suites/openstack/connectivity/
+integration/test/csit/suites/openstack/clustering/
+
index fe7219849e19a8e0e22d75d8fda6c3178322d271..c29e0ac69388d63c5997c7c23049af981f317cbb 100644 (file)
@@ -165,6 +165,13 @@ LFM_SB_RPC_API = "/restconf/operations/odl-lisp-sb"
 
 # Neutron
 NEUTRON_NB_API = '/controller/nb/v2/neutron'
+NEUTRON_NETWORKS_API = NEUTRON_NB_API + '/' + 'networks'
+NEUTRON_ROUTERS_API = NEUTRON_NB_API + '/' + 'routers'
+OSREST = '/v2.0/networks'
+KARAF_HOME = '${WORKSPACE}${/}${BUNDLEFOLDER}'
+
+# Openstack System Prompt
+OS_SYSTEM_PROMPT = '$'
 
 # Other global variables
 # TODO: Move these to more apropriate sections.