Remove setting of TRACE to entire netvirt in vpnservice
[integration/test.git] / csit / suites / netvirt / Netvirt_Vpnservice / basic_vpnservice.robot
index 8dbaa829f3454de1e7b4356cae18c1221c988ce1..89e4155e65d3a9ebe7e5f81f042974ead9ab2a82 100644 (file)
@@ -4,10 +4,9 @@ Documentation     Test suite to validate vpnservice functionality in an openstac
 ...               integration bridges and vxlan tunnels.
 Suite Setup       BuiltIn.Run Keywords    SetupUtils.Setup_Utils_For_Setup_And_Teardown
 ...               AND    DevstackUtils.Devstack Suite Setup
-...               AND    Enable ODL Karaf Log
 Suite Teardown    Close All Connections
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Run Keyword If Test Failed    Get Test Teardown Debugs
+Test Teardown     Get Test Teardown Debugs
 Library           OperatingSystem
 Library           RequestsLibrary
 Resource          ../../../libraries/Utils.robot
@@ -87,12 +86,23 @@ Create Nova VMs
     \    Wait Until Keyword Succeeds    25s    5s    Verify VM Is ACTIVE    ${VM}
     Log    Check for routes
     Wait Until Keyword Succeeds    30s    10s    Wait For Routes To Propogate
-    ${VM_IP_NET10}    ${DHCP_IP1}    Wait Until Keyword Succeeds    30s    10s    Verify VMs Received DHCP Lease    @{VM_INSTANCES_NET10}
+    : FOR    ${index}    IN RANGE    1    5
+    \    ${VM_IP_NET10}    ${DHCP_IP1}    Wait Until Keyword Succeeds    30s    10s    Verify VMs Received DHCP Lease
+    \    ...    @{VM_INSTANCES_NET10}
+    \    ${VM_IP_NET20}    ${DHCP_IP2}    Wait Until Keyword Succeeds    30s    10s    Verify VMs Received DHCP Lease
+    \    ...    @{VM_INSTANCES_NET20}
+    \    ${VM_IPS}=    Collections.Combine Lists    ${VM_IP_NET10}    ${VM_IP_NET20}
+    \    ${status}    ${message}    Run Keyword And Ignore Error    List Should Not Contain Value    ${VM_IPS}    None
+    \    Exit For Loop If    '${status}' == 'PASS'
+    \    BuiltIn.Sleep    5s
+    : FOR    ${vm}    IN    @{VM_INSTANCES_NET10}    @{VM_INSTANCES_NET20}
+    \    Write Commands Until Prompt    nova console-log ${vm}    30s
     Log    ${VM_IP_NET10}
     Set Suite Variable    ${VM_IP_NET10}
-    ${VM_IP_NET20}    ${DHCP_IP2}    Wait Until Keyword Succeeds    30s    10s    Verify VMs Received DHCP Lease    @{VM_INSTANCES_NET20}
     Log    ${VM_IP_NET20}
     Set Suite Variable    ${VM_IP_NET20}
+    Should Not Contain    ${VM_IP_NET10)    None
+    Should Not Contain    ${VM_IP_NET20}    None
 
 Check ELAN Datapath Traffic Within The Networks
     [Documentation]    Checks datapath within the same network with different vlans.
@@ -115,7 +125,7 @@ Add Interfaces To Router
     ${devstack_conn_id} =    Get ControlNode Connection
     : FOR    ${INTERFACE}    IN    @{SUBNETS}
     \    Add Router Interface    ${ROUTERS[0]}    ${INTERFACE}
-    ${interface_output} =    show Router Interface    ${ROUTERS[0]}
+    ${interface_output} =    Show Router Interface    ${ROUTERS[0]}
     : FOR    ${INTERFACE}    IN    @{SUBNETS}
     \    ${subnet_id} =    Get Subnet Id    ${INTERFACE}    ${devstack_conn_id}
     \    Should Contain    ${interface_output}    ${subnet_id}
@@ -174,8 +184,10 @@ Delete And Recreate Extra Route
     Show Router    @{ROUTERS}[0]    -D
     ${output} =    Execute Command on VM Instance    @{NETWORKS}[0]    ${VM_IP_NET10[1]}    ping -c 3 @{EXTRA_NW_IP}[0]
     Should Contain    ${output}    64 bytes
-    Update Router    @{ROUTERS}[0]    ${RT_CLEAR}
-    Show Router    @{ROUTERS}[0]    -D
+    # clear off extra-routes before the next set of tests
+    [Teardown]    Run Keywords    Update Router    @{ROUTERS}[0]    ${RT_CLEAR}
+    ...    AND    Show Router    @{ROUTERS}[0]    -D
+    ...    AND    Get Test Teardown Debugs
 
 Create L3VPN
     [Documentation]    Creates L3VPN and verify the same
@@ -248,13 +260,13 @@ Delete Router And Router Interfaces With L3VPN
     ${resp}=    VPN Get L3VPN    vpnid=${VPN_INSTANCE_ID[0]}
     Should Not Contain    ${resp}    ${router_id}
 
-Delete Router With Unknown ID
-    [Documentation]    Delete router with unknown ID
+Delete Router With NonExistentRouter Name
+    [Documentation]    Delete router with nonExistentRouter name
     ${devstack_conn_id}=    Get ControlNode Connection
     Switch Connection    ${devstack_conn_id}
-    ${output} =    Write Commands Until Prompt    neutron router-delete unknowRouter    30s
+    ${output} =    Write Commands Until Prompt    neutron router-delete nonExistentRouter    30s
     Close Connection
-    Should Contain    ${output}    Unable to find router with name or id
+    Should Match Regexp    ${output}    Unable to find router with name or id 'nonExistentRouter'|Unable to find router\\(s\\) with id\\(s\\) 'nonExistentRouter'
 
 Associate L3VPN To Networks
     [Documentation]    Associates L3VPN to networks and verify
@@ -367,9 +379,3 @@ Wait For Routes To Propogate
     ${net_id} =    Get Net Id    @{NETWORKS}[1]    ${devstack_conn_id}
     ${output} =    Write Commands Until Expected Prompt    sudo ip netns exec qdhcp-${net_id} ip route    ]>
     Should Contain    ${output}    @{SUBNET_CIDR}[1]
-
-Enable ODL Karaf Log
-    [Documentation]    Uses log:set TRACE org.opendaylight.netvirt to enable log
-    Log    "Enabled ODL Karaf log for org.opendaylight.netvirt"
-    ${output}=    Issue Command On Karaf Console    log:set TRACE org.opendaylight.netvirt
-    Log    ${output}