Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / netvirt / vpnservice / vpn_basic_ipv6.robot
index b5547c45731f929f6b124f149e8f12c38d3866e8..74a7b8c4f4385d0b2a17334c83feb679ff233161 100644 (file)
@@ -69,7 +69,7 @@ Add Multiple Extra Routes And Check Datapath Before L3VPN Creation
     ${EXT_RT2} =    Set Variable    destination=@{EXTRA_NW_SUBNET}[1],gateway=@{VM_IP_NET10}[0]
     ${cmd} =    BuiltIn.Catenate    ${RT_OPTIONS}    ${EXT_RT1}    ${RT_OPTIONS}    ${EXT_RT2}
     OpenStackOperations.Update Router    ${ROUTER}    ${cmd}
-    OpenStackOperations.Show Router    ${ROUTER}    -D
+    OpenStackOperations.Show Router    ${ROUTER}
     ${vm_ips} =    BuiltIn.Create List    @{EXTRA_NW_SUBNET}
     BuiltIn.Wait Until Keyword Succeeds    30s    10s    Utils.Check For Elements At URI    ${FIB_ENTRY_URL}    ${vm_ips}
     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{VM_IP_NET10}[1]    ping6 -c 3 @{EXTRA_NW_IP}[1]
@@ -81,7 +81,7 @@ Add Multiple Extra Routes And Check Datapath Before L3VPN Creation
 
 Delete Extra Route
     OpenStackOperations.Update Router    ${ROUTER}    ${RT_CLEAR}
-    OpenStackOperations.Show Router    ${ROUTER}    -D
+    OpenStackOperations.Show Router    ${ROUTER}
 
 Delete And Recreate Extra Route
     [Documentation]    Recreate multiple extra route and check data path before L3VPN creation
@@ -90,12 +90,12 @@ Delete And Recreate Extra Route
     ${EXT_RT1} =    Set Variable    destination=@{EXTRA_NW_SUBNET}[0],gateway=@{VM_IP_NET10}[0]
     ${cmd} =    BuiltIn.Catenate    ${RT_OPTIONS}    ${EXT_RT1}
     OpenStackOperations.Update Router    ${ROUTER}    ${cmd}
-    OpenStackOperations.Show Router    ${ROUTER}    -D
+    OpenStackOperations.Show Router    ${ROUTER}
     ${output} =    OpenStackOperations.Execute Command on VM Instance    @{NETWORKS}[0]    @{VM_IP_NET10}[1]    ping6 -c 3 @{EXTRA_NW_IP}[0]
     BuiltIn.Should Contain    ${output}    64 bytes
     # clear off extra-routes before the next set of tests
     [Teardown]    BuiltIn.Run Keywords    OpenStackOperations.Update Router    ${ROUTER}    ${RT_CLEAR}
-    ...    AND    OpenStackOperations.Show Router    ${ROUTER}    -D
+    ...    AND    OpenStackOperations.Show Router    ${ROUTER}
     ...    AND    OpenStackOperations.Get Test Teardown Debugs
 
 Create L3VPN
@@ -138,24 +138,29 @@ Delete Router And Router Interfaces With L3VPN
     VpnOperations.Associate VPN to Router    routerid=${router_id}    vpnid=@{VPN_INSTANCE_IDS}[0]
     ${resp} =    VpnOperations.VPN Get L3VPN    vpnid=@{VPN_INSTANCE_IDS}[0]
     BuiltIn.Should Contain    ${resp}    ${router_id}
-    : FOR    ${INTERFACE}    IN    @{SUBNETS}
-    \    OpenStackOperations.Remove Interface    ${ROUTER}    ${INTERFACE}
+    FOR    ${INTERFACE}    IN    @{SUBNETS}
+        OpenStackOperations.Remove Interface    ${ROUTER}    ${INTERFACE}
+    END
     ${interface_output} =    OpenStackOperations.Show Router Interface    ${ROUTER}
-    : FOR    ${INTERFACE}    IN    @{SUBNETS}
-    \    ${subnet_id} =    OpenStackOperations.Get Subnet Id    ${INTERFACE}
-    \    BuiltIn.Should Not Contain    ${interface_output}    ${subnet_id}
+    FOR    ${INTERFACE}    IN    @{SUBNETS}
+        ${subnet_id} =    OpenStackOperations.Get Subnet Id    ${INTERFACE}
+        BuiltIn.Should Not Contain    ${interface_output}    ${subnet_id}
+    END
     OpenStackOperations.Delete Router    ${ROUTER}
     ${router_output} =    OpenStackOperations.List Routers
     BuiltIn.Should Not Contain    ${router_output}    ${ROUTER}
     @{router_list} =    BuiltIn.Create List    ${ROUTER}
-    BuiltIn.Wait Until Keyword Succeeds    3s    1s    Utils.Check For Elements Not At URI    ${ROUTER_URL}    ${router_list}
+    BuiltIn.Wait Until Keyword Succeeds    3s    1s    Utils.Check For Elements Not At URI    ${ROUTER_URL}    ${router_list}    check_for_null=True
     ${resp}=    VpnOperations.VPN Get L3VPN    vpnid=@{VPN_INSTANCE_IDS}[0]
     BuiltIn.Should Not Contain    ${resp}    ${router_id}
     Verify GWMAC Flow Entry Removed From Flow Table On All Compute Nodes
 
 Delete Router With NonExistentRouter Name
-    ${rc}    ${output}=    Run And Return Rc And Output    neutron router-delete nonExistentRouter
-    BuiltIn.Should Match Regexp    ${output}    Unable to find router with name or id 'nonExistentRouter'|Unable to find router\\(s\\) with id\\(s\\) 'nonExistentRouter'
+    ${result} =    Process.Run Process    openstack router delete nonExistentRouter    shell=True
+    BuiltIn.Log    ${result.stdout}
+    BuiltIn.Log    ${result.stderr}
+    BuiltIn.Should Be True    '${result.rc}' == '1'
+    BuiltIn.Should Match Regexp    ${result.stderr}    Failed to delete router with name or ID 'nonExistentRouter': No Router found for nonExistentRouter
 
 Associate L3VPN To Networks
     ${network1_id} =    OpenStackOperations.Get Net Id    @{NETWORKS}[0]
@@ -213,12 +218,14 @@ Suite Setup
     OpenStackOperations.Create Router    ${ROUTER}
     ${router_list} =    BuiltIn.Create List    ${ROUTER}
     BuiltIn.Wait Until Keyword Succeeds    3s    1s    Utils.Check For Elements At URI    ${ROUTER_URL}    ${router_list}
-    : FOR    ${interface}    IN    @{SUBNETS}
-    \    OpenStackOperations.Add Router Interface    ${ROUTER}    ${interface}
+    FOR    ${interface}    IN    @{SUBNETS}
+        OpenStackOperations.Add Router Interface    ${ROUTER}    ${interface}
+    END
     ${interface_output} =    OpenStackOperations.Show Router Interface    ${ROUTER}
-    : FOR    ${interface}    IN    @{SUBNETS}
-    \    ${subnet_id} =    OpenStackOperations.Get Subnet Id    ${interface}
-    \    BuiltIn.Should Contain    ${interface_output}    ${subnet_id}
+    FOR    ${interface}    IN    @{SUBNETS}
+        ${subnet_id} =    OpenStackOperations.Get Subnet Id    ${interface}
+        BuiltIn.Should Contain    ${interface_output}    ${subnet_id}
+    END
     ${GWMAC_ADDRS}    ${GWIP_ADDRS} =    VpnOperations.Get Gateway MAC And IP Address    ${ROUTER}    ${IP6_REGEX}
     BuiltIn.Set Suite Variable    ${GWMAC_ADDRS}
     BuiltIn.Set Suite Variable    ${GWIP_ADDRS}
@@ -238,8 +245,9 @@ Suite Setup
     OpenStackOperations.Create Vm Instance With Port On Compute Node    @{PORTS}[2]    @{NET_2_VMS}[0]    ${OS_CMP1_HOSTNAME}    sg=${SECURITY_GROUP}
     OpenStackOperations.Create Vm Instance With Port On Compute Node    @{PORTS}[3]    @{NET_2_VMS}[1]    ${OS_CMP2_HOSTNAME}    sg=${SECURITY_GROUP}
     ${vms}=    BuiltIn.Create List    @{NET_1_VMS}    @{NET_2_VMS}
-    : FOR    ${vm}    IN    @{vms}
-    \    OpenStackOperations.Poll VM Is ACTIVE    ${vm}
+    FOR    ${vm}    IN    @{vms}
+        OpenStackOperations.Poll VM Is ACTIVE    ${vm}
+    END
     BuiltIn.Wait Until Keyword Succeeds    30s    10s    Wait For Routes To Propogate    ${NETWORKS}    ${SUBNET_CIDRS}
     ${prefix_net10} =    Replace String    @{SUBNET_CIDRS}[0]    ::/64    (:[a-f0-9]{,4}){,4}
     ${status}    ${message}    Run Keyword And Ignore Error    BuiltIn.Wait Until Keyword Succeeds    3x    60s    OpenStackOperations.Collect VM IPv6 SLAAC Addresses
@@ -252,9 +260,10 @@ Suite Setup
     ${VM_INSTANCES} =    Collections.Combine Lists    ${NET_1_VMS}    ${NET_2_VMS}
     ${VM_IPS}=    Collections.Combine Lists    ${VM_IP_NET10}    ${VM_IP_NET20}
     ${LOOP_COUNT}    BuiltIn.Get Length    ${NET_1_VMS}
-    : FOR    ${index}    IN RANGE    0    ${LOOP_COUNT}
-    \    ${status}    ${message}    Run Keyword And Ignore Error    BuiltIn.Should Not Contain    @{VM_IPS}[${index}]    None
-    \    Run Keyword If    '${status}' == 'FAIL'    OpenStack CLI    openstack console log show @{VM_INSTANCES}[${index}]    30s
+    FOR    ${index}    IN RANGE    0    ${LOOP_COUNT}
+        ${status}    ${message}    Run Keyword And Ignore Error    BuiltIn.Should Not Contain    ${VM_IPS}[${index}]    None
+        Run Keyword If    '${status}' == 'FAIL'    OpenStack CLI    openstack console log show @{VM_INSTANCES}[${index}]    30s
+    END
     OpenStackOperations.Copy DHCP Files From Control Node
     BuiltIn.Set Suite Variable    ${VM_IP_NET10}
     BuiltIn.Set Suite Variable    ${VM_IP_NET20}