From: Robert Varga Date: Tue, 26 Mar 2024 18:50:51 +0000 (+0100) Subject: Specify url as explicit argument X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F111075%2F1;p=integration%2Ftest.git Specify url as explicit argument With RFC8040 uris we end up specifying content=config and similar. This is tripping up RF warning non-escaped '='s. Rather then escaping all these, just use url= consistently across all invocations. Signed-off-by: Robert Varga Change-Id: Ifcf8c00629fc4237911e4fe270e3fab4811f1f91 --- diff --git a/csit/libraries/BGPSpeaker.robot b/csit/libraries/BGPSpeaker.robot index 17d5f6789e..1cfcc73060 100644 --- a/csit/libraries/BGPSpeaker.robot +++ b/csit/libraries/BGPSpeaker.robot @@ -65,7 +65,7 @@ Verify_BGP_Speaker_Connection ${exp_status_code}= BuiltIn.Set_Variable_If ${connected} 200 404 ${url}= BuiltIn.Set_Variable ... ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F${ip}?content=nonconfig - ${response}= RequestsLibrary.GET On Session ${session} ${url} expected_status=${exp_status_code} + ${response}= RequestsLibrary.GET On Session ${session} url=${url} expected_status=${exp_status_code} RETURN ${response.content} Start_BGP_Manager diff --git a/csit/libraries/ChangeCounter.robot b/csit/libraries/ChangeCounter.robot index 5d082b17aa..55e23983f2 100644 --- a/csit/libraries/ChangeCounter.robot +++ b/csit/libraries/ChangeCounter.robot @@ -34,7 +34,7 @@ CC_Setup Get_Change_Count [Documentation] GET data change request, assert status 200, return the value. [Arguments] ${session}=operational - ${response} = RequestsLibrary.GET On Session ${session} ${CC_DATA_CHANGE_COUNTER_URL} expected_status=200 + ${response} = RequestsLibrary.GET On Session ${session} url=${CC_DATA_CHANGE_COUNTER_URL} expected_status=200 # CompareStream.Set_Variable_If_At_Least_Else cannot be used direcly, because ${response.text}["data-change-counter"]["count"] would be # evaluated before the stream comparison and it causes failures BuiltIn.Log ${response.text} diff --git a/csit/libraries/NexusKeywords.robot b/csit/libraries/NexusKeywords.robot index 68897c74d6..1a8a8dbe76 100644 --- a/csit/libraries/NexusKeywords.robot +++ b/csit/libraries/NexusKeywords.robot @@ -371,7 +371,7 @@ Get_ODL_Versions_From_Nexus [Documentation] Returns name of last release found on nexus and list of all versions. RequestsLibrary.Create_Session nexus ${NEXUS_RELEASES_URL} verify=${TRUE} ${uri} = BuiltIn.Set_Variable maven-metadata.xml - ${response} = RequestsLibrary.GET On Session nexus ${uri} + ${response} = RequestsLibrary.GET On Session nexus url=${uri} BuiltIn.Log ${response.text} ${root} = XML.Parse_XML ${response.text} ${element} = XML.Get_Element ${root} versioning/latest diff --git a/csit/libraries/Utils.robot b/csit/libraries/Utils.robot index 449b9a1d39..a9e2ae840a 100644 --- a/csit/libraries/Utils.robot +++ b/csit/libraries/Utils.robot @@ -365,18 +365,18 @@ Concatenate the String Post Elements To URI [Documentation] Perform a POST rest operation, using the URL and data provided [Arguments] ${rest_uri} ${data} ${headers}=${headers} ${session}=session - ${resp}= RequestsLibrary.Post On Session ${session} ${rest_uri} data=${data} headers=${headers} + ${resp}= RequestsLibrary.Post On Session ${session} url=${rest_uri} data=${data} headers=${headers} Log ${resp.text} Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Remove All Elements At URI [Arguments] ${uri} ${session}=session - ${resp}= RequestsLibrary.Delete On Session ${session} ${uri} + ${resp}= RequestsLibrary.Delete On Session ${session} url=${uri} Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Remove All Elements At URI And Verify [Arguments] ${uri} ${session}=session - ${resp}= RequestsLibrary.Delete On Session ${session} ${uri} + ${resp}= RequestsLibrary.Delete On Session ${session} url=${uri} Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} ${resp}= RequestsLibrary.Get On Session ${session} url=${uri} Should Contain ${DELETED_STATUS_CODES} ${resp.status_code} @@ -393,7 +393,7 @@ Add Elements To URI From File [Documentation] Put data from a file to a URI [Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${session}=session ${body}= OperatingSystem.Get File ${data_file} - ${resp}= RequestsLibrary.Put On Session ${session} ${dest_uri} data=${body} headers=${headers} + ${resp}= RequestsLibrary.Put On Session ${session} url=${dest_uri} data=${body} headers=${headers} Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Add Elements To URI From File And Verify @@ -405,7 +405,7 @@ Add Elements To URI From File And Verify Add Elements To URI And Verify [Documentation] Put data to a URI and verify the HTTP response [Arguments] ${dest_uri} ${data} ${headers}=${headers} ${session}=session - ${resp}= RequestsLibrary.Put On Session ${session} ${dest_uri} ${data} headers=${headers} + ${resp}= RequestsLibrary.Put On Session ${session} url=${dest_uri} ${data} headers=${headers} Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} ${resp}= RequestsLibrary.Get On Session ${session} url=${dest_uri} Should Not Contain ${DELETED_STATUS_CODES} ${resp.status_code} @@ -415,7 +415,7 @@ Add Elements To URI From File And Check Validation Error [Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${session}=session BuiltIn.Comment TODO: Does this have any benefits, considering TemplatedRequests can also do this in one line? ${body}= OperatingSystem.Get File ${data_file} - ${resp}= RequestsLibrary.Put On Session ${session} ${dest_uri} data=${body} headers=${headers} + ${resp}= RequestsLibrary.Put On Session ${session} url=${dest_uri} data=${body} headers=${headers} Should Contain ${DATA_VALIDATION_ERROR} ${resp.status_code} Add Elements To URI From File And Check Server Error @@ -424,13 +424,13 @@ Add Elements To URI From File And Check Server Error [Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${session}=session BuiltIn.Comment TODO: Does this have any benefits, considering TemplatedRequests can also do this in one line? ${body}= OperatingSystem.Get File ${data_file} - ${resp}= RequestsLibrary.Put On Session ${session} ${dest_uri} data=${body} headers=${headers} + ${resp}= RequestsLibrary.Put On Session ${session} url=${dest_uri} data=${body} headers=${headers} Should Contain ${INTERNAL_SERVER_ERROR} ${resp.status_code} Post Elements To URI From File [Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${session}=session ${body}= OperatingSystem.Get File ${data_file} - ${resp}= RequestsLibrary.Post On Session ${session} ${dest_uri} data=${body} headers=${headers} + ${resp}= RequestsLibrary.Post On Session ${session} url=${dest_uri} data=${body} headers=${headers} Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Run Process With Logging And Status Check @@ -495,7 +495,7 @@ Check Item Occurrence Post Log Check [Documentation] Post body to ${uri}, log response content, and check status [Arguments] ${uri} ${body} ${session}=session ${status_codes}=200 - ${resp}= RequestsLibrary.Post On Session ${session} ${uri} ${body} + ${resp}= RequestsLibrary.Post On Session ${session} url=${uri} data=${body} Log ${resp.text} TemplatedRequests.Check Status Code ${resp} ${status_codes} RETURN ${resp} diff --git a/csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot b/csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot index 51c25ea53c..5b52393e23 100644 --- a/csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot +++ b/csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot @@ -137,7 +137,7 @@ Verify_Bgp_Peer_Connection # TODO: This keyword is not specific to prefix counting. Find a better place for it. ${peer_check_url} = BuiltIn.Set_Variable ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F ${exp_status_code} = BuiltIn.Set_Variable_If ${connected} 200 404 - ${rsp} = RequestsLibrary.GET On Session ${session} ${peer_check_url}${peer_ip}?content=nonconfig expected_status=${exp_status_code} + ${rsp} = RequestsLibrary.GET On Session ${session} url=${peer_check_url}${peer_ip}?content=nonconfig expected_status=${exp_status_code} BuiltIn.Log ${rsp.content} Set_Shard_Leaders_Location_And_Verify diff --git a/csit/suites/bgpcep/pcepuser/pcepuser.robot b/csit/suites/bgpcep/pcepuser/pcepuser.robot index 4cdb433247..d1bce641ae 100644 --- a/csit/suites/bgpcep/pcepuser/pcepuser.robot +++ b/csit/suites/bgpcep/pcepuser/pcepuser.robot @@ -156,5 +156,5 @@ Compare_Topology ... '${uri}'=='${EMPTY}' ... ${REST_API}/${TOPOLOGY_URL}=pcep-topology?content=nonconfig ... ${REST_API}/${TOPOLOGY_URL}=pcep-topology/${uri}?content=nonconfig - ${response}= RequestsLibrary.GET On Session ${CONFIG_SESSION} ${topology_uri} expected_status=200 + ${response}= RequestsLibrary.GET On Session ${CONFIG_SESSION} url=${topology_uri} expected_status=200 TemplatedRequests.Normalize_Jsons_And_Compare ${exp} ${response.text}