Re-create l3vpn and verify traffic
[integration/test.git] / csit / suites / netvirt / vpnservice / vpn_basic_dualstack_subnet_routing.robot
index 6d719b62a21a962f9c0d391837440e57341671cc..4994db789e614a53fddeaaabe4ec8a5c7de437e3 100644 (file)
@@ -160,6 +160,20 @@ Delete L3VPN
     BuiltIn.Wait Until Keyword Succeeds    10x    30s    Verify Ipv4 Data No Traffic
     BuiltIn.Wait Until Keyword Succeeds    10x    30s    Verify Ipv6 Data No Traffic
 
+ReCreate L3VPN and associate L3VPN To Routers and verify traffic
+    [Documentation]    Recreate L3VPN and associate L3VPN To Routers and verify ipv4/ipv6 traffic
+    ${net_id} =    OpenStackOperations.Get Net Id    @{NETWORKS}[0]
+    ${tenant_id} =    OpenStackOperations.Get Tenant ID From Network    ${net_id}
+    VpnOperations.VPN Create L3VPN    vpnid=@{VPN_INSTANCE_ID}[0]    name=@{VPN_NAME}[0]    rd=@{RDS}[0]    exportrt=@{RDS}[0]    importrt=@{RDS}[0]    tenantid=${tenant_id}
+    ${resp} =    VpnOperations.VPN Get L3VPN    vpnid=@{VPN_INSTANCE_ID}[0]
+    BuiltIn.Should Contain    ${resp}    @{VPN_INSTANCE_ID}[0]
+    ${router_id} =    OpenStackOperations.Get Router Id    ${ROUTER}
+    VpnOperations.Associate VPN to Router    routerid=${router_id}    vpnid=@{VPN_INSTANCE_ID}[0]
+    ${resp} =    VpnOperations.VPN Get L3VPN    vpnid=@{VPN_INSTANCE_ID}[0]
+    BuiltIn.Should Contain    ${resp}    ${router_id}
+    BuiltIn.Wait Until Keyword Succeeds    10x    30s    Verify Ipv4 Data Traffic
+    BuiltIn.Wait Until Keyword Succeeds    10x    30s    Verify Ipv6 Data Traffic
+
 *** Keywords ***
 Suite Setup
     [Documentation]    Create basic setup for feature.Create two network,subnet,four ports and four VMs
@@ -222,9 +236,9 @@ Suite Setup
     ${net_2_vm_ipv6} =    OpenStackOperations.Collect VM IPv6 SLAAC Addresses    false    ${NET_2_VMS}    @{NETWORKS}[1]    ${prefix_net20}
     ${loop_count}    Get Length    ${NET_1_VMS}
     : FOR    ${index}    IN RANGE    0    ${loop_count}
-    \    ${status}    ${message}    Run Keyword And Ignore Error    BuiltIn.Should Not Contain    @{net_1_vm_ipv6}[${index}]    None
+    \    ${status}    ${message}    Run Keyword And Ignore Error    BuiltIn.Should Not Contain    ${net_1_vm_ipv6}[${index}]    None
     \    Run Keyword If    '${status}' == 'FAIL'    Write Commands Until Prompt    nova console-log @{NET_1_VMS}[${index}]    30s
-    \    ${status}    ${message}    Run Keyword And Ignore Error    BuiltIn.Should Not Contain    @{net_2_vm_ipv6}[${index}]    None
+    \    ${status}    ${message}    Run Keyword And Ignore Error    BuiltIn.Should Not Contain    ${net_2_vm_ipv6}[${index}]    None
     \    Run Keyword If    '${status}' == 'FAIL'    Write Commands Until Prompt    nova console-log @{NET_2_VMS}[${index}]    30s
     BuiltIn.Set Suite Variable    ${net_1_vm_ipv4}
     BuiltIn.Set Suite Variable    ${net_2_vm_ipv4}