From 4978f8ad77b30a22da71ade8bdfcea3d3dd5ef75 Mon Sep 17 00:00:00 2001 From: "tomas.markovic" Date: Wed, 7 Nov 2018 11:48:30 +0100 Subject: [PATCH] Fix bgp route refresh test Change-Id: I0485816fc7b37938674e96047eb0510e00448bc0 Signed-off-by: tomas.markovic --- .../bgpfunct/040_bgp_functional_route_ref.robot | 17 ++++++++++------- .../route_refresh/operational_cli/update.txt | 16 ++++++++-------- .../route_refresh/operational_state/data.json | 2 +- .../location.uri | 0 .../post_data.xml | 1 - .../route_refresh/route/post_data.xml | 1 + 6 files changed, 20 insertions(+), 17 deletions(-) rename csit/variables/bgpfunctional/route_refresh/{route.fluorine => route.oxygen}/location.uri (100%) rename csit/variables/bgpfunctional/route_refresh/{route.fluorine => route.oxygen}/post_data.xml (94%) diff --git a/csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot b/csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot index 3a53d4fb35..b878f86a5a 100644 --- a/csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot +++ b/csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot @@ -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} diff --git a/csit/variables/bgpfunctional/route_refresh/operational_cli/update.txt b/csit/variables/bgpfunctional/route_refresh/operational_cli/update.txt index 94695ce58b..52802fe17a 100644 --- a/csit/variables/bgpfunctional/route_refresh/operational_cli/update.txt +++ b/csit/variables/bgpfunctional/route_refresh/operational_cli/update.txt @@ -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 diff --git a/csit/variables/bgpfunctional/route_refresh/operational_state/data.json b/csit/variables/bgpfunctional/route_refresh/operational_state/data.json index 9367bcd0c3..45d9d4d5db 100644 --- a/csit/variables/bgpfunctional/route_refresh/operational_state/data.json +++ b/csit/variables/bgpfunctional/route_refresh/operational_state/data.json @@ -7,7 +7,7 @@ }, "sent": { "NOTIFICATION": 0, - "UPDATE": 4 + "UPDATE": $RCV_COUNT } }, "session-state": "ESTABLISHED", diff --git a/csit/variables/bgpfunctional/route_refresh/route.fluorine/location.uri b/csit/variables/bgpfunctional/route_refresh/route.oxygen/location.uri similarity index 100% rename from csit/variables/bgpfunctional/route_refresh/route.fluorine/location.uri rename to csit/variables/bgpfunctional/route_refresh/route.oxygen/location.uri diff --git a/csit/variables/bgpfunctional/route_refresh/route.fluorine/post_data.xml b/csit/variables/bgpfunctional/route_refresh/route.oxygen/post_data.xml 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 b581352d08..e42c260d2f 100644 --- a/csit/variables/bgpfunctional/route_refresh/route.fluorine/post_data.xml +++ b/csit/variables/bgpfunctional/route_refresh/route.oxygen/post_data.xml @@ -1,7 +1,6 @@ $PREFIX 0 - $PREFIX 199.20.160.41 diff --git a/csit/variables/bgpfunctional/route_refresh/route/post_data.xml b/csit/variables/bgpfunctional/route_refresh/route/post_data.xml index e42c260d2f..b581352d08 100644 --- a/csit/variables/bgpfunctional/route_refresh/route/post_data.xml +++ b/csit/variables/bgpfunctional/route_refresh/route/post_data.xml @@ -1,6 +1,7 @@ $PREFIX 0 + $PREFIX 199.20.160.41 -- 2.36.6