X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FBgpOperations.robot;h=8d4f717f87d741564419b051212a6db4156606e0;hb=3c2e192367ddecd6daccb9379b401c5e9a43ec0f;hp=bc51c8cd0dbb3f8e7a8ccd88890fdd753daadf25;hpb=bc476bcaff4a66e2d1f3a7253bbc7507d04653ae;p=integration%2Ftest.git diff --git a/csit/libraries/BgpOperations.robot b/csit/libraries/BgpOperations.robot index bc51c8cd0d..8d4f717f87 100644 --- a/csit/libraries/BgpOperations.robot +++ b/csit/libraries/BgpOperations.robot @@ -3,9 +3,12 @@ Documentation This library contains keywords related to the BGP functionalit Library SSHLibrary Resource Utils.robot Resource ../variables/Variables.robot +Resource TemplatedRequests.robot *** Variables *** ${VAR_BASE_BGP} ${CURDIR}/../variables/bgpfunctional +${BGP_BMP_DIR} ${CURDIR}/../variables/bgpfunctional/bmp_basic/filled_structure +${BGP_BMP_FEAT_DIR} ${CURDIR}/../variables/bgpfunctional/bmp_basic/empty_structure *** Keywords *** Start Quagga Processes On ODL @@ -183,3 +186,57 @@ Get External Tunnel Endpoint Configuration ${resp} = RequestsLibrary.Get Request session ${CONFIG_API}/itm:dc-gateway-ip-list/dc-gateway-ip/${ip}/ Log ${resp.content} [Return] ${resp.content} + +Teardown_Everything + [Documentation] Create and Log the diff between expected and actual responses, make sure Python tool was killed. + ... Tear down imported Resources. + KillPythonTool.Search_And_Kill_Remote_Python 'play\.py' + RequestsLibrary.Delete_All_Sessions + SSHLibrary.Close_All_Connections + +Check_Example_Bgp_Rib_Content + [Arguments] ${substr} ${error_message}=${JSONKEYSTR} not found, but expected. + [Documentation] Check the example-bgp-rib content for string + ${response}= RequestsLibrary.Get Request operational bgp-rib:bgp-rib/rib/example-bgp-rib + BuiltIn.Log ${response.status_code} + BuiltIn.Log ${response.text} + BuiltIn.Should_Contain ${response.text} ${substr} ${error_message} values=False + +Check_Example_Bgp_Rib_Does_Not_Contain + [Arguments] ${substr} ${error_message}=${JSONKEYSTR} found, but not expected. + [Documentation] Check the example-bgp-rib does not contain the string + ${response}= RequestsLibrary.Get Request operational bgp-rib:bgp-rib/rib/example-bgp-rib + BuiltIn.Log ${response.status_code} + BuiltIn.Log ${response.text} + BuiltIn.Should_Not_Contain ${response.text} ${substr} ${error_message} values=False + +Check_Example_IPv4_Topology_Content + [Arguments] ${string_to_check}=${EMPTY} + [Documentation] Check the example-ipv4-topology content for string + ${response}= RequestsLibrary.Get Request operational topology/example-ipv4-topology + BuiltIn.Log ${response.status_code} + BuiltIn.Log ${response.text} + BuiltIn.Should_Contain ${response.text} ${string_to_check} + +Check_Example_IPv4_Topology_Does_Not_Contain + [Arguments] ${string_to_check} + [Documentation] Check the example-ipv4-topology does not contain the string + ${response}= RequestsLibrary.Get Request operational topology/example-ipv4-topology + BuiltIn.Log ${response.status_code} + BuiltIn.Log ${response.text} + BuiltIn.Should_Not_Contain ${response.text} ${string_to_check} + +Bmp_Monitor_Precondition + [Arguments] ${session} + [Documentation] Verify example-bmp-monitor presence in bmp-monitors + &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP} + BuiltIn.Wait_Until_Keyword_Succeeds 6x 10s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_FEAT_DIR} mapping=${mapping} verify=True + ... session=${session} + +Bmp_Monitor_Postcondition + [Arguments] ${session} + [Documentation] Verifies if example-bmp-monitor data contains one peer. + &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP} + ${output} BuiltIn.Wait_Until_Keyword_Succeeds 10x 5s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_DIR} mapping=${mapping} + ... session=${session} verify=True + BuiltIn.Log ${output}