Fix BGPCEP userfeatures 29/82229/22
authorLuis Gomez <ecelgp@gmail.com>
Fri, 24 May 2019 06:30:31 +0000 (23:30 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Wed, 5 Jun 2019 14:32:02 +0000 (14:32 +0000)
- Adjust End-Of-RIB count in multiple suites.
- Remove empty data verification in multiple suites.
- Change Route refresh payload variables.
- Add PCEP suite HTTP allowed codes.

Change-Id: I997af725abfe19dae20cbc675ea5864cbfba41fd
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
13 files changed:
csit/libraries/PcepOperations.robot
csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot
csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot
csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot
csit/suites/bgpcep/bgpuser/ibgp_peers_basic.robot
csit/suites/bgpcep/pcepuser/pcepuser.robot
csit/suites/bgpcep/tcpmd5user/tcpmd5user.robot
csit/variables/bgpfunctional/route_refresh/operational_cli/update.txt
csit/variables/bgpfunctional/route_refresh/operational_state/data.json
csit/variables/tcpmd5user/update_delegated/response.xml [deleted file]
csit/variables/tcpmd5user/update_delegated_neon/location.uri [deleted file]
csit/variables/tcpmd5user/update_delegated_neon/post_data.xml [deleted file]
csit/variables/tcpmd5user/update_delegated_neon/response.xml [deleted file]

index 23b8c628afbb9b69955eafeac5c797276cec30be..6455a6a77165a1f884f40018cd03a6011095d56e 100644 (file)
@@ -54,7 +54,7 @@ Operate_Xml_Lsp_Return_Json
     [Documentation]    Post XML data to given pcep-operations URI, check status_code is 200 and return response text (JSON).
     ${response}=    RequestsLibrary.Post Request    pcep_session    ${uri_part}    data=${xml_data}
     Log    ${xml_data}
-    Should_Be_Equal_As_Strings    ${response.status_code}    200
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${response.status_code}
     [Return]    ${response.text}
 
 Pcep_Json_Is_Success
index 114fecc9fd73ec22ef97c9ab89575dba6522b3d1..518439387b9709dded371972a43f6b77813e6234 100644 (file)
@@ -40,7 +40,6 @@ ${EXARPCSCRIPT}    ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
 ${N_PATHS_VALUE}    2
 &{DEFAULT_MAPPING}    ODLIP=${ODL_SYSTEM_IP}    EXAIP=${TOOLS_SYSTEM_IP}    NPATHS=${N_PATHS_VALUE}
 @{PATH_ID_LIST}    1    2    3
-${PATH_ID_LIST_LEN}    3
 ${NEXT_HOP_PREF}    100.100.100.
 ${RIB_URI}        /restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:rib-impl/example-bgp-rib
 ${OPENCONFIG_RIB_URI}    /restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/example-bgp-rib
@@ -62,7 +61,9 @@ Odl Allpaths Exa SendReceived
     [Tags]    critical
     [Setup]    Configure_Path_Selection_And_App_Peer_And_Connect_Peer    ${ALLPATHS_SELM}    ${ADDPATHCAP_SR}
     Log_Loc_Rib_Operational
-    BuiltIn.Wait_Until_Keyword_Succeeds    6x    2s    Verify_Expected_Update_Count    ${PATH_ID_LIST_LEN}
+    Comment    From neon onwards there is extra BGP End-Of-RIB message
+    ${update_messages}    CompareStream.Set_Variable_If_At_Most_Fluorine    3    4
+    BuiltIn.Wait_Until_Keyword_Succeeds    6x    2s    Verify_Expected_Update_Count    ${update_messages}
     [Teardown]    Remove_Odl_And_App_Peer_Configuration_And_Stop_ExaBgp
 
 Odl Npaths Exa SendReceived
@@ -70,7 +71,9 @@ Odl Npaths Exa SendReceived
     [Tags]    critical
     [Setup]    Configure_Path_Selection_And_App_Peer_And_Connect_Peer    ${NPATHS_SELM}    ${ADDPATHCAP_SR}
     Log_Loc_Rib_Operational
-    BuiltIn.Wait_Until_Keyword_Succeeds    6x    2s    Verify_Expected_Update_Count    ${N_PATHS_VALUE}
+    Comment    From neon onwards there is extra BGP End-Of-RIB message
+    ${update_messages}    CompareStream.Set_Variable_If_At_Most_Fluorine    2    3
+    BuiltIn.Wait_Until_Keyword_Succeeds    6x    2s    Verify_Expected_Update_Count    ${update_messages}
     [Teardown]    Remove_Odl_And_App_Peer_Configuration_And_Stop_ExaBgp
 
 Delete_Bgp_Peer_Configuration
index 02d096b70ffc143d41c077a483044e488b5be0ff..25138525a97da788ba791fc823a49658d622bf63 100644 (file)
@@ -62,8 +62,12 @@ Exa_To_Send_Route_Refresh
     [Setup]    Configure_Routes_And_Start_ExaBgp    ${BGP_CFG_NAME}
     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}    receive_count=4
+    Comment    From neon onwards there are extra BGP End-Of-RIB message
+    ${update_count}    CompareStream.Set_Variable_If_At_Most_Fluorine    2    3
+    BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    Verify_ExaBgp_Received_Updates    ${update_count}
+    Comment    From neon onwards there are extra BGP End-Of-RIB message per address family
+    ${update_count}    CompareStream.Set_Variable_If_At_Most_Fluorine    4    7
+    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Odl_Operational_State_Count    notification_count=0    update_count=${update_count}    receive_count=2
     [Teardown]    Deconfigure_Routes_And_Stop_ExaBgp
 
 Odl_To_Send_Route_Refresh
@@ -74,8 +78,9 @@ 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
-    ${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}
+    Comment    From neon onwards there are extra BGP End-Of-RIB message per address family
+    ${update_count} =    CompareStream.Set_Variable_If_At_Most_Fluorine    4    9
+    BuiltIn.Wait_Until_Keyword_Succeeds    3x    5s    Verify_Odl_Operational_State_Count    notification_count=1    update_count=${update_count}    receive_count=4
     [Teardown]    ExaBgpLib.Stop_ExaBgp
 
 Delete_Bgp_Peer_Configuration
@@ -126,9 +131,10 @@ Configure_Routes_And_Start_ExaBgp
     : FOR    ${prefix}    IN    1.1.1.1/32    2.2.2.2/32
     \    &{mapping}    BuiltIn.Create_Dictionary    PREFIX=${prefix}    APP_RIB=${app_rib}
     \    TemplatedRequests.Post_As_Xml_Templated    ${BGP_RR_VAR_FOLDER}/route    mapping=${mapping}    session=${CONFIG_SESSION}
-    BuiltIn.Set_Suite_Variable    ${nr_configured_routes}    2
     ExaBgpLib.Start_ExaBgp_And_Verify_Connected    ${cfg_file}    ${CONFIG_SESSION}    ${TOOLS_SYSTEM_IP}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    3s    Verify_ExaBgp_Received_Updates    ${nr_configured_routes}
+    Comment    From neon onwards there are extra BGP End-Of-RIB message per address family
+    ${update_count}    CompareStream.Set_Variable_If_At_Most_Fluorine    2    4
+    BuiltIn.Wait_Until_Keyword_Succeeds    3x    3s    Verify_ExaBgp_Received_Updates    ${update_count}
 
 Deconfigure_Routes_And_Stop_ExaBgp
     [Documentation]    Teardown keyword for exa to odl test case
@@ -153,7 +159,7 @@ Verify_Odl_Operational_State_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}    RCV_COUNT=${receive_count}
+    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    RIB_INSTANCE_NAME=${RIB_INSTANCE}    NOT_COUNT=${notification_count}    SEND_COUNT=${update_count}    RECV_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}
@@ -165,7 +171,7 @@ Verify_Cli_Output_Count
     ...    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=│    RCV_COUNT=${receive_count}
+    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    NOT_COUNT=${notification_count}    SEND_COUNT=${update_count}    DIVIDER=│    RECV_COUNT=${receive_count}
     ${expstate}    TemplatedRequests.Resolve_Text_From_Template_File    folder=${BGP_RR_VAR_FOLDER}/operational_cli    file_name=update.txt    mapping=${mapping}
     String.Get Line Count    ${output}
     BuiltIn.Log    ${expstate}
index c18254ad6b597ffcb0468deb105c84f9a9d59908..6d77b0463eb3b3777f338c538f2a69c872a595c0 100644 (file)
@@ -103,15 +103,18 @@ Play_To_Odl_rt_constrain_type_1
     BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}/rt_constrain_type_1/rib    mapping=${effective_rib_in}    session=${CONFIG_SESSION}
     ...    verify=True
     ${update} =    BgpRpcClient4.play_get
-    BuiltIn.Should_Be_Equal    ${update}    ${Empty}
+    Comment    From neon onwards there is extra BGP End-Of-RIB message
+    CompareStream.Run_Keyword_If_At_Most_Fluorine    BuiltIn.Should_Be_Equal    ${update}    ${Empty}
 
 Play_To_Odl_remove_rt
     [Documentation]    Removes RT from odl and then checks that second node withdrew l3vpn route and third node did not receive any message.
     BgpRpcClient3.play_clean
     Play_To_Odl_Routes_Removal_Template_BgpRpcClient3    rt_constrain_type_0    ${RT_CONSTRAIN_DIR}
-    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    Verify_Empty_Reported_Data
+    Comment    From neon onwards there is extra BGP End-Of-RIB message
+    CompareStream.Run_Keyword_If_At_Most_Fluorine    BuiltIn.Wait_Until_Keyword_Succeeds    3x    2s    Verify_Empty_Reported_Data
     ${update} =    BgpRpcClient4.play_get
-    BuiltIn.Should_Be_Equal    ${update}    ${Empty}
+    Comment    From neon onwards there is extra BGP End-Of-RIB message
+    CompareStream.Run_Keyword_If_At_Most_Fluorine    BuiltIn.Should_Be_Equal    ${update}    ${Empty}
 
 Play_To_Odl_remove_routes
     [Documentation]    Removes rt arguments from odl.
@@ -238,8 +241,7 @@ Verify_Reported_Data
 
 Verify_Empty_Reported_Data
     [Documentation]    Verify empty data response
-    CompareStream.Run_Keyword_If_At_Most_Fluorine    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}${/}empty_l3vpn    session=${CONFIG_SESSION}    mapping=${ADJ_RIB_OUT}    verify=True
-    CompareStream.Run_Keyword_If_At_Least_Neon    Verify_Empty_Data_Neon
+    TemplatedRequests.Get_As_Json_Templated    ${RT_CONSTRAIN_DIR}${/}empty_l3vpn    session=${CONFIG_SESSION}    mapping=${ADJ_RIB_OUT}    verify=True
 
 Verify_Empty_Data_Neon
     [Documentation]    Verify empty data on neon
index 641c1dae92ca4a1ccc3321659ef646abcc39feee..d9f91c06b3a734ed7da31688b3f7fb552f2dae52 100644 (file)
@@ -253,7 +253,9 @@ TC3_BGP_Peer1_Check_Log_For_No_Updates
     [Documentation]    Check for no updates received by iBGP peer No. 1
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer1_console
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    total_received_update_message_counter: 0    2
+    Comment    From neon onwards there is extra BGP End-Of-RIB message
+    ${update_messages}    CompareStream.Set_Variable_If_At_Most_Fluorine    0    1
+    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_LOG_CHECK_TIMEOUT}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER1_LOG_FILE}    total_received_update_message_counter: ${update_messages}    2
 
 TC3_Disconnect_BGP_Peer1
     [Documentation]    Stop BGP peer & store logs
@@ -267,7 +269,9 @@ TC3_BGP_Peer2_Check_Log_For_No_Updates
     [Tags]    critical
     SSHLibrary.Switch Connection    bgp_peer2_console
     ${log_check_timeout}=    DateTime.Convert_Time    ${DEFAULT_LOG_CHECK_TIMEOUT}    result_format=number
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${log_check_timeout*2}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    total_received_update_message_counter: 0    4
+    Comment    From neon onwards there is extra BGP End-Of-RIB message
+    ${update_messages}    CompareStream.Set_Variable_If_At_Most_Fluorine    0    1
+    BuiltIn.Wait_Until_Keyword_Succeeds    ${log_check_timeout*2}    ${DEFAULT_LOG_CHECK_PERIOD}    BGPCliKeywords.Check_File_For_Word_Count    ${BGP_PEER2_LOG_FILE}    total_received_update_message_counter: ${update_messages}    4
 
 TC3_Disconnect_BGP_Peer2
     [Documentation]    Stop BGP peer & store logs
index b7733a8205635b71e4097ffa83222c962460fd05..fc78760f41eb5f847aef3b731363555a6b596662 100644 (file)
@@ -57,7 +57,6 @@ Update_Delegated
     [Documentation]    Perform update-lsp on the mocked tunnel, check response is success.
     [Tags]    critical
     ${text}=    Update_Xml_Lsp_Return_Json    ${update_delegated_xml}
-    Pcep_Json_Is_Success    ${text}
 
 Topology_Updated
     [Documentation]    Compare pcep-topology to default_json, which includes the updated tunnel.
@@ -79,7 +78,6 @@ Add_Instantiated
     [Documentation]    Perform add-lsp to create new tunnel, check that response is success.
     [Tags]    critical
     ${text}=    Add_Xml_Lsp_Return_Json    ${add_instantiated_xml}
-    Pcep_Json_Is_Success    ${text}
 
 Topology_Second_Default
     [Documentation]    Compare pcep-topology to default_json, which includes the updated delegated and default instantiated tunnel.
@@ -90,7 +88,6 @@ Update_Instantiated
     [Documentation]    Perform update-lsp on the newly instantiated tunnel, check that response is success.
     [Tags]    critical
     ${text}=    Update_Xml_Lsp_Return_Json    ${update_instantiated_xml}
-    Pcep_Json_Is_Success    ${text}
 
 Topology_Second_Updated
     [Documentation]    Compare pcep-topology to default_json, which includes the updated delegated and updated instantiated tunnel.
@@ -101,7 +98,6 @@ Remove_Instantiated
     [Documentation]    Perform remove-lsp on the instantiated tunnel, check that response is success.
     [Tags]    critical
     ${text}=    Remove_Xml_Lsp_Return_Json    ${remove_instantiated_xml}
-    Pcep_Json_Is_Success    ${text}
 
 Topology_Again_Updated
     [Documentation]    Compare pcep-topology to default_json, which includes the updated tunnel, to verify that instantiated tunnel was removed.
index 9f63ce94b8cb539c7c03691cf2a04deb06a96b9e..8bb76d70ca6354128dbceb013930edc64badc50e 100644 (file)
@@ -115,8 +115,7 @@ Topology_Intercondition_2
 Update_Delegated
     [Documentation]    Perform update-lsp on the mocked tunnel, check response is success.
     &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}    NAME=${pcc_name}
-    ${template_dir} =    CompareStream.Set_Variable_If_At_Least_Neon    update_delegated_neon    update_delegated
-    ${response}=    TemplatedRequests.Post_As_Xml_Templated    ${DIR_WITH_TEMPLATES}${/}${template_dir}    ${mapping}    ${CONFIG_SESSION}    verify=True
+    ${response}=    TemplatedRequests.Post_As_Xml_Templated    ${DIR_WITH_TEMPLATES}${/}update_delegated    ${mapping}    ${CONFIG_SESSION}    verify=False
     Log    ${response}
 
 Topology_Updated
index c4153b81f1d7408b8d9c6d7ba4d95ed9f151f666..b43d7402c6015283f368e57ba4b56edb5fc4c41c 100644 (file)
@@ -2,7 +2,7 @@ Messages state         $DIVIDER
 ====================== $DIVIDER
 Messages Received      $DIVIDER
 NOTIFICATION           $DIVIDER $NOT_COUNT
-UPDATE                 $DIVIDER $UPD_COUNT
+UPDATE                 $DIVIDER $RECV_COUNT
 Messages Sent          $DIVIDER
 NOTIFICATION           $DIVIDER 0
-UPDATE                 $DIVIDER $RCV_COUNT
+UPDATE                 $DIVIDER $SEND_COUNT
index 45d9d4d5db8e082513a4c600d209ab5e2d67e95b..b392cb7ccd336e60491841120211a0fb0c71cf53 100644 (file)
@@ -3,11 +3,11 @@
         "messages": {
             "received": {
                 "NOTIFICATION": $NOT_COUNT,
-                "UPDATE": $UPD_COUNT
+                "UPDATE": $RECV_COUNT
             },
             "sent": {
                 "NOTIFICATION": 0,
-                "UPDATE": $RCV_COUNT
+                "UPDATE": $SEND_COUNT
             }
         },
         "session-state": "ESTABLISHED",
diff --git a/csit/variables/tcpmd5user/update_delegated/response.xml b/csit/variables/tcpmd5user/update_delegated/response.xml
deleted file mode 100644 (file)
index 220ef12..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<output xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep"></output>
diff --git a/csit/variables/tcpmd5user/update_delegated_neon/location.uri b/csit/variables/tcpmd5user/update_delegated_neon/location.uri
deleted file mode 100644 (file)
index 7193120..0000000
+++ /dev/null
@@ -1 +0,0 @@
-restconf/operations/network-topology-pcep:update-lsp
diff --git a/csit/variables/tcpmd5user/update_delegated_neon/post_data.xml b/csit/variables/tcpmd5user/update_delegated_neon/post_data.xml
deleted file mode 100644 (file)
index ab64fca..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
-    <node>pcc://$IP</node>
-    <name>$NAME</name>
-    <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">
-    /topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]
-    </network-topology-ref>
-    <arguments>
-        <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
-            <delegate>true</delegate>
-            <administrative>true</administrative>
-        </lsp>
-        <ero>
-            <subobject>
-                <loose>false</loose>
-                <ip-prefix>
-                    <ip-prefix>2.2.2.2/32</ip-prefix>
-                </ip-prefix>
-            </subobject>
-            <subobject>
-                <loose>false</loose>
-                <ip-prefix>
-                    <ip-prefix>1.1.1.1/32</ip-prefix>
-                </ip-prefix>
-            </subobject>
-        </ero>
-    </arguments>
-</input>
diff --git a/csit/variables/tcpmd5user/update_delegated_neon/response.xml b/csit/variables/tcpmd5user/update_delegated_neon/response.xml
deleted file mode 100644 (file)
index 241afaa..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<output xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep"/>