Replace Start Suite with Suite Setup
[integration/test.git] / csit / suites / netvirt / bgpmultipath / l3vpn_bgp_multipath.robot
index 22f3a33eed3b09e50ac875f1fd396e993e7e8215..337580d1ecdfbae5deea7c215296ea0ad1b5e065 100644 (file)
@@ -3,7 +3,7 @@ Documentation     The objective of this testsuite is to test QBGP and ODL for mu
 ...               QBGP should be capable to receive multiple ECMP paths from different DC-GWs and
 ...               to export the ECMP paths to ODL instead of best path selection.
 ...               ODL should be capable to receive ECMP paths and it should program the FIB with ECMP paths.
-Suite Setup       Start Suite
+Suite Setup       Suite Setup
 Suite Teardown    Stop Suite
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Test Teardown     Test Cleanup
@@ -30,10 +30,7 @@ Resource          ../../../variables/Variables.robot
 @{SUBNET_CIDR}    22.1.1.0/24    33.1.1.0/24    44.1.1.0/24
 @{ROUTERS}        multipath_router_1    multipath_router_2    multipath_router_3
 ${AS_ID}          100
-${VPNV4_ADDR_FAMILY}    vpnv4
 ${BGP_CACHE}      bgp-cache
-${BGP_CONNECT}    bgp-connect -h ${ODL_SYSTEM_IP} -p 7644 add
-${DISPLAY_VPN4_ALL}    show-bgp --cmd "ip bgp ${VPNV4_ADDR_FAMILY} all"
 ${DIPSLAY_FIB}    fib-show
 ${ENABLE}         enable
 ${DISABLE}        disable
@@ -52,6 +49,31 @@ Verify ODL supports REST API/CLI for multipath configuration (enable/disable mul
     Configure Multipath On ODL    ${ENABLE}
     Verify Multipath    ${ENABLE}
 
+Verify CSC supports REST API/CLI for max path configuration
+    [Documentation]    Verify CSC supports REST API/CLI for max path configuration
+    : FOR    ${idx}    IN RANGE    ${START_VALUE}    ${NUM_OF_DCGW}
+    \    VpnOperations.VPN Create L3VPN    name=@{VPN_NAME}[${idx}]    vpnid=@{VPN_ID}[${idx}]    rd=@{L3VPN_RD_IRT_ERT}[${idx}]    exportrt=@{L3VPN_RD_IRT_ERT}[${idx}]    importrt=@{L3VPN_RD_IRT_ERT}[${idx}]
+    VpnOperations.Verify L3VPN On ODL    @{VPN_ID}
+    : FOR    ${dcgw}    IN    @{DCGW_IP_LIST}
+    \    BgpOperations.Create L3VPN on DCGW    ${dcgw}    ${AS_ID}    @{VPN_NAME}[0]    @{DCGW_RD_IRT_ERT}[0]
+    \    BgpOperations.Verify L3VPN On DCGW    ${dcgw}    @{VPN_NAME}[0]    @{DCGW_RD_IRT_ERT}[0]
+    : FOR    ${idx}    IN RANGE    ${START_VALUE}    ${NUM_OF_DCGW}
+    \    Configure Maxpath    @{MAX_PATH_LIST}[2]    @{DCGW_RD_IRT_ERT}[${idx}]
+    \    BuiltIn.Wait Until Keyword Succeeds    10s    2s    Verify Maxpath    @{MAX_PATH_LIST}[2]    @{DCGW_RD_IRT_ERT}[${idx}]
+    BuiltIn.Wait Until Keyword Succeeds    60s    10s    BgpOperations.Check BGP VPNv4 Nbr On ODL    ${NUM_OF_DCGW}    False
+
+Verify max-path error message with invalid inputs
+    [Documentation]    Verify max path error message while configuring maxpath with invalid range
+    VpnOperations.VPN Create L3VPN    name=@{VPN_NAME}[0]    vpnid=@{VPN_ID}[0]    rd=@{L3VPN_RD_IRT_ERT}[0]    exportrt=@{L3VPN_RD_IRT_ERT}[0]    importrt=@{L3VPN_RD_IRT_ERT}[0]
+    VpnOperations.Verify L3VPN On ODL    @{VPN_ID}[0]
+    : FOR    ${dcgw}    IN    @{DCGW_IP_LIST}
+    \    BgpOperations.Create L3VPN on DCGW    ${dcgw}    ${AS_ID}    @{VPN_NAME}[0]    @{DCGW_RD_IRT_ERT}[0]
+    \    BgpOperations.Verify L3VPN On DCGW    ${dcgw}    @{VPN_NAME}[0]    @{DCGW_RD_IRT_ERT}[0]
+    : FOR    ${invalid}    IN    @{MAX_PATH_INVALID_LIST}
+    \    Configure Maxpath    ${invalid}    @{DCGW_RD_IRT_ERT}[0]
+    \    BuiltIn.Wait Until Keyword Succeeds    10s    2s    Verify Maxpath    ${invalid}    @{DCGW_RD_IRT_ERT}[0]
+    BuiltIn.Wait Until Keyword Succeeds    60s    10s    BgpOperations.Check BGP VPNv4 Nbr On ODL    ${NUM_OF_DCGW}    False
+
 Verify ODL supports dynamic configuration changes for max path value
     [Documentation]    Verify ODL supports dynamic configuration changes for max path value
     VpnOperations.VPN Create L3VPN    name=@{VPN_NAME}[0]    vpnid=@{VPN_ID}[0]    rd=@{L3VPN_RD_IRT_ERT}[0]    exportrt=@{L3VPN_RD_IRT_ERT}[0]    importrt=@{L3VPN_RD_IRT_ERT}[0]
@@ -64,18 +86,40 @@ Verify ODL supports dynamic configuration changes for max path value
     BuiltIn.Wait Until Keyword Succeeds    10s    2s    Verify Maxpath    @{MAX_PATH_LIST}[2]    @{DCGW_RD_IRT_ERT}[0]
     : FOR    ${idx}    IN RANGE    ${START_VALUE}    ${NUM_OF_DCGW}
     \    BgpOperations.Add Routes On DCGW    @{DCGW_IP_LIST}[${idx}]    @{DCGW_RD_IRT_ERT}[0]    @{NETWORK_IP}[0]    @{LABEL}[${idx}]
-    BuiltIn.Wait Until Keyword Succeeds    60s    10s    Check BGP VPNv4 Nbr On ODL    ${NUM_OF_DCGW}
+    BuiltIn.Wait Until Keyword Succeeds    60s    10s    BgpOperations.Check BGP VPNv4 Nbr On ODL    ${NUM_OF_DCGW}
     BuiltIn.Wait Until Keyword Succeeds    60s    10s    Verify Routing Entry On ODL    @{DCGW_RD_IRT_ERT}[0]    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[2]
-    BuiltIn.Wait Until Keyword Succeeds    10s    2s    Verify FIB Entry On ODL    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[2]
+    BuiltIn.Wait Until Keyword Succeeds    30s    5s    Verify FIB Entry On ODL    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[2]
     : FOR    ${index}    IN RANGE    0    3
     \    Configure Maxpath    @{MAX_PATH_LIST}[${index}]    @{DCGW_RD_IRT_ERT}[0]
     \    BuiltIn.Wait Until Keyword Succeeds    10s    2s    Verify Maxpath    @{MAX_PATH_LIST}[${index}]    @{DCGW_RD_IRT_ERT}[0]
-    \    BuiltIn.Wait Until Keyword Succeeds    10s    2s    Verify Routing Entry On ODL    @{DCGW_RD_IRT_ERT}[0]    @{NETWORK_IP}[0]
+    \    BuiltIn.Wait Until Keyword Succeeds    60s    10s    Verify Routing Entry On ODL    @{DCGW_RD_IRT_ERT}[0]    @{NETWORK_IP}[0]
     \    ...    @{NUM_OF_ROUTES}[2]
-    \    BuiltIn.Wait Until Keyword Succeeds    10s    2s    Verify FIB Entry On ODL    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[${index}]
+    \    BuiltIn.Wait Until Keyword Succeeds    60s    10s    Verify FIB Entry On ODL    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[${index}]
+
+Verify that ECMP path gets withdrawn by QBGP after disabling multipath
+    [Documentation]    Verify that ECMP path gets withdrawn by QBGP after disabling multipath
+    VpnOperations.VPN Create L3VPN    name=@{VPN_NAME}[0]    vpnid=@{VPN_ID}[0]    rd=@{L3VPN_RD_IRT_ERT}[0]    exportrt=@{L3VPN_RD_IRT_ERT}[0]    importrt=@{L3VPN_RD_IRT_ERT}[0]
+    VpnOperations.Verify L3VPN On ODL    @{VPN_ID}[0]
+    VpnOperations.Associate VPN to Router    routerid=@{router_id_list}[0]    vpnid=@{VPN_ID}[0]
+    : FOR    ${dcgw}    IN    @{DCGW_IP_LIST}
+    \    BgpOperations.Create L3VPN on DCGW    ${dcgw}    ${AS_ID}    @{VPN_NAME}[0]    @{DCGW_RD_IRT_ERT}[0]
+    \    BgpOperations.Verify L3VPN On DCGW    ${dcgw}    @{VPN_NAME}[0]    @{DCGW_RD_IRT_ERT}[0]
+    Configure Maxpath    @{MAX_PATH_LIST}[2]    @{DCGW_RD_IRT_ERT}[0]
+    BuiltIn.Wait Until Keyword Succeeds    10s    2s    Verify Maxpath    @{MAX_PATH_LIST}[2]    @{DCGW_RD_IRT_ERT}[0]
+    : FOR    ${idx}    IN RANGE    ${START_VALUE}    ${NUM_OF_DCGW}
+    \    BgpOperations.Add Routes On DCGW    @{DCGW_IP_LIST}[${idx}]    @{DCGW_RD_IRT_ERT}[0]    @{NETWORK_IP}[0]    @{LABEL}[${idx}]
+    BuiltIn.Wait Until Keyword Succeeds    60s    10s    BgpOperations.Check BGP VPNv4 Nbr On ODL    ${NUM_OF_DCGW}
+    BuiltIn.Wait Until Keyword Succeeds    60s    10s    Verify Routing Entry On ODL    @{DCGW_RD_IRT_ERT}[0]    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[2]
+    BuiltIn.Wait Until Keyword Succeeds    30s    5s    Verify FIB Entry On ODL    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[2]
+    Configure Maxpath    @{MAX_PATH_LIST}[0]    @{DCGW_RD_IRT_ERT}[0]
+    BuiltIn.Wait Until Keyword Succeeds    60s    10s    Verify Routing Entry On ODL    @{DCGW_RD_IRT_ERT}[0]    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[2]
+    BuiltIn.Wait Until Keyword Succeeds    30s    5s    Verify FIB Entry On ODL    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[0]
+    Configure Maxpath    @{MAX_PATH_LIST}[2]    @{DCGW_RD_IRT_ERT}[0]
+    BuiltIn.Wait Until Keyword Succeeds    60s    10s    Verify Routing Entry On ODL    @{DCGW_RD_IRT_ERT}[0]    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[2]
+    BuiltIn.Wait Until Keyword Succeeds    30s    5s    Verify FIB Entry On ODL    @{NETWORK_IP}[0]    @{NUM_OF_ROUTES}[2]
 
 *** Keywords ***
-Start Suite
+Suite Setup
     [Documentation]    Setup start suite
     VpnOperations.Basic Suite Setup
     Create Setup
@@ -101,7 +145,7 @@ Create Setup
     : FOR    ${dcgw}    IN    @{DCGW_IP_LIST}
     \    BgpOperations.Start Quagga Processes On DCGW    ${dcgw}
     BgpOperations.Start Quagga Processes On ODL    ${ODL_SYSTEM_IP}
-    KarafKeywords.Issue Command On Karaf Console    ${BGP_CONNECT}
+    KarafKeywords.Issue Command On Karaf Console    ${BGP_CONFIG_SERVER_CMD}
     BgpOperations.Create BGP Configuration On ODL    localas=${AS_ID}    routerid=${ODL_SYSTEM_IP}
     : FOR    ${dcgw}    IN    @{DCGW_IP_LIST}
     \    BgpOperations.AddNeighbor To BGP Configuration On ODL    remoteas=${AS_ID}    neighborAddr=${dcgw}
@@ -156,14 +200,6 @@ Verify Maxpath
     BuiltIn.Run Keyword If    0 < ${maxpath} < 65    BuiltIn.Should Match Regexp    ${output}    ${rd}\\s*${maxpath}
     ...    ELSE    BuiltIn.Should Not Match Regexp    ${output}    ${rd}\\s*${maxpath}
 
-Check BGP VPNv4 Nbr On ODL
-    [Arguments]    ${dcgw_count}    ${flag}=True    ${start}=${START_VALUE}
-    [Documentation]    Check BGP VPNv4 neighbor all on ODL
-    ${output} =    KarafKeywords.Issue Command On Karaf Console    ${DISPLAY_VPN4_ALL}
-    : FOR    ${index}    IN RANGE    ${start}    ${dcgw_count}
-    \    BuiltIn.Run Keyword If    ${flag}==True    BuiltIn.Should Contain    ${output}    ${DCGW_IP_LIST[${index}]}
-    \    ...    ELSE    BuiltIn.Should Not Contain    ${output}    ${DCGW_IP_LIST[${index}]}
-
 Verify Routing Entry On ODL
     [Arguments]    ${rd}    ${prefix}    ${no_of_times}
     [Documentation]    Verify routing table for specific prefix