Fix bgp route refresh test 76/77576/6
authortomas.markovic <tomas.markovic@pantheon.tech>
Wed, 7 Nov 2018 10:48:30 +0000 (11:48 +0100)
committerJamo Luhrsen <jluhrsen@redhat.com>
Thu, 8 Nov 2018 16:31:12 +0000 (16:31 +0000)
Change-Id: I0485816fc7b37938674e96047eb0510e00448bc0
Signed-off-by: tomas.markovic <tomas.markovic@pantheon.tech>
csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot
csit/variables/bgpfunctional/route_refresh/operational_cli/update.txt
csit/variables/bgpfunctional/route_refresh/operational_state/data.json
csit/variables/bgpfunctional/route_refresh/route.oxygen/location.uri [moved from csit/variables/bgpfunctional/route_refresh/route.fluorine/location.uri with 100% similarity]
csit/variables/bgpfunctional/route_refresh/route.oxygen/post_data.xml [moved from csit/variables/bgpfunctional/route_refresh/route.fluorine/post_data.xml with 94% similarity]
csit/variables/bgpfunctional/route_refresh/route/post_data.xml

index 3a53d4fb35b4e9cc518937b53c712c155808c670..b878f86a5a046b5586ced28323e069a388bfa86b 100644 (file)
@@ -61,7 +61,7 @@ Exa_To_Send_Route_Refresh
     BgpRpcClient.exa_clean_received_update_count
     BgpRpcClient.exa_announce    announce route-refresh ipv4 unicast
     BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    Verify_ExaBgp_Received_Updates    ${nr_configured_routes}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Odl_Operational_State_Count    notification_count=0    update_count=${nr_configured_routes}
+    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Odl_Operational_State_Count    notification_count=0    update_count=${nr_configured_routes}    receive_count=4
     [Teardown]    Deconfigure_Routes_And_Stop_ExaBgp
 
 Odl_To_Send_Route_Refresh
@@ -72,7 +72,8 @@ Odl_To_Send_Route_Refresh
     &{mapping}    BuiltIn.Create_Dictionary    BGP_PEER_IP=${TOOLS_SYSTEM_IP}
     TemplatedRequests.Post_As_Xml_Templated    ${BGP_VAR_FOLDER}/route_refresh    mapping=${mapping}    session=${CONFIG_SESSION}
     BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    Verify_ExaBgp_Received_Route_Refresh    1
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Odl_Operational_State_Count    notification_count=1    update_count=4
+    ${receive_count} =    CompareStream.Set_Variable_If_At_Least_Neon    6    4
+    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Odl_Operational_State_Count    notification_count=1    update_count=4    receive_count=${receive_count}
     [Teardown]    ExaBgpLib.Stop_ExaBgp
 
 Delete_Bgp_Peer_Configuration
@@ -147,21 +148,23 @@ Verify_ExaBgp_Received_Route_Refresh
     BuiltIn.Should Be Equal As Numbers    ${count}    ${expcount}
 
 Verify_Odl_Operational_State_Count
-    [Arguments]    ${notification_count}    ${update_count}
+    [Arguments]    ${notification_count}    ${update_count}    ${receive_count}
     [Documentation]    Check notification and update count gained from operatial neighbor state
     ...    On versions oxygen and above, it verifies these counts also against cli output.
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    NOT_COUNT=${notification_count}    UPD_COUNT=${update_count}
+    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    NOT_COUNT=${notification_count}    UPD_COUNT=${update_count}    RCV_COUNT=${receive_count}
     ${ret}=    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    TemplatedRequests.Get_As_Json_Templated    folder=${BGP_RR_VAR_FOLDER}/operational_state    mapping=${mapping}
     ...    session=${CONFIG_SESSION}    verify=True
     BuiltIn.Log    ${ret}
-    CompareStream.Run_Keyword_If_At_Least_Oxygen    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Cli_Output_Count    ${notification_count}    ${update_count}
+    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Cli_Output_Count    ${notification_count}    ${update_count}    ${receive_count}
 
 Verify_Cli_Output_Count
-    [Arguments]    ${notification_count}    ${update_count}
+    [Arguments]    ${notification_count}    ${update_count}    ${receive_count}
     [Documentation]    Checks notification and update count from odl-bgpcep-bgp-cli.
     ...    odl-bgpcep-bgp-cli is only avaiable on versions oxygen and above.
     ${output}    KarafKeywords.Safe_Issue_Command_On_Karaf_Console    bgp:operational-state -rib example-bgp-rib -neighbor ${TOOLS_SYSTEM_IP}
     BuiltIn.Log    ${output}
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    NOT_COUNT=${notification_count}    UPD_COUNT=${update_count}    DIVIDER=│
+    ${line_ending} =    CompareStream.Set_Variable_If_At_Least_Fluorine    ${EMPTY}    \r
+    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    NOT_COUNT=${notification_count}    UPD_COUNT=${update_count}    DIVIDER=│    LNE=${line_ending}
+    ...    RCV_COUNT=${receive_count}
     ${expstate}    TemplatedRequests.Resolve_Text_From_Template_File    folder=${BGP_RR_VAR_FOLDER}/operational_cli    file_name=update.txt    mapping=${mapping}
     BuiltIn.Should_Contain    ${output}    ${expstate}
index 94695ce58b8692b98eccaf841b21261e77dfa373..52802fe17a559046ddd036977f95b3f4ccda616c 100644 (file)
@@ -1,8 +1,8 @@
-Messages state         $DIVIDER\r
-====================== $DIVIDER\r
-Messages Received      $DIVIDER\r
-NOTIFICATION           $DIVIDER $NOT_COUNT\r
-UPDATE                 $DIVIDER $UPD_COUNT\r
-Messages Sent          $DIVIDER\r
-NOTIFICATION           $DIVIDER 0\r
-UPDATE                 $DIVIDER 4
+Messages state         $DIVIDER$LNE
+====================== $DIVIDER$LNE
+Messages Received      $DIVIDER$LNE
+NOTIFICATION           $DIVIDER $NOT_COUNT$LNE
+UPDATE                 $DIVIDER $UPD_COUNT$LNE
+Messages Sent          $DIVIDER$LNE
+NOTIFICATION           $DIVIDER 0$LNE
+UPDATE                 $DIVIDER $RCV_COUNT
index 9367bcd0c33b7af4f139610fd3918a30e4971ec7..45d9d4d5db8e082513a4c600d209ab5e2d67e95b 100644 (file)
@@ -7,7 +7,7 @@
             },
             "sent": {
                 "NOTIFICATION": 0,
-                "UPDATE": 4
+                "UPDATE": $RCV_COUNT
             }
         },
         "session-state": "ESTABLISHED",
similarity index 94%
rename from csit/variables/bgpfunctional/route_refresh/route.fluorine/post_data.xml
rename to csit/variables/bgpfunctional/route_refresh/route.oxygen/post_data.xml
index b581352d084f363a228528131c113421d4286b94..e42c260d2f92076b6463ce3825bd627da3d2bb84 100644 (file)
@@ -1,7 +1,6 @@
   <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
    <prefix>$PREFIX</prefix>
    <path-id>0</path-id>
-   <route-key>$PREFIX</route-key>
    <attributes>
     <ipv4-next-hop>
      <global>199.20.160.41</global>
index e42c260d2f92076b6463ce3825bd627da3d2bb84..b581352d084f363a228528131c113421d4286b94 100644 (file)
@@ -1,6 +1,7 @@
   <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
    <prefix>$PREFIX</prefix>
    <path-id>0</path-id>
+   <route-key>$PREFIX</route-key>
    <attributes>
     <ipv4-next-hop>
      <global>199.20.160.41</global>