From 74dd649a28904cbe7854f9bb8946baad635bb54e Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Wed, 27 Mar 2024 13:25:06 -0700 Subject: [PATCH 01/16] Migrate ExaBgpLib.robot The 'Get Request' RequestsLibrary keyword has been deprecated. Migrate it to 'GET On Session'. Change-Id: I262a907f8c5528611a62505f08c53490d04d5921 Signed-off-by: Sangwook Ha --- csit/libraries/ExaBgpLib.robot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/csit/libraries/ExaBgpLib.robot b/csit/libraries/ExaBgpLib.robot index 276e0cc3e1..b1bf48c12d 100644 --- a/csit/libraries/ExaBgpLib.robot +++ b/csit/libraries/ExaBgpLib.robot @@ -13,6 +13,7 @@ Documentation Robot keyword library (Resource) for handling the ExaBgp too ... ... TODO: RemoteBash.robot contains logic which could be reused here. +Library RequestsLibrary Library SSHLibrary Resource ${CURDIR}/SSHKeywords.robot Resource ${CURDIR}/RemoteBash.robot @@ -75,7 +76,9 @@ Verify_ExaBgps_Connection [Arguments] ${session} ${exabgp_ip}=${TOOLS_SYSTEM_IP} ${connected}=${True} ${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 Request ${session} ${peer_check_url}${exabgp_ip}?content=nonconfig + ${rsp}= RequestsLibrary.GET On Session + ... alias=${session} + ... url=${peer_check_url}${exabgp_ip}?content=nonconfig BuiltIn.Log ${rsp.content} BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code} -- 2.36.6 From a85296a2eb69c19e76c8f49f97d8db3005499958 Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Wed, 27 Mar 2024 13:57:22 -0700 Subject: [PATCH 02/16] Migrate 020_bgp_functional_multipath.robot The 'Get Request' RequestsLibrary keyword has been deprecated. Migrate it to 'GET On Session' and fix the URL to use the RFC8040 path. Change-Id: I122004fea42f15436084f00ed7b3b84ab8c1f748 Signed-off-by: Sangwook Ha --- .../bgpcep/bgpfunct/020_bgp_functional_multipath.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot b/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot index 2135dbabdf..5fc04cb164 100644 --- a/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot +++ b/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot @@ -196,9 +196,9 @@ Store_Rib_Configuration BuiltIn.Set_Suite_Variable ${rib_old} Log_Loc_Rib_Operational - ${rsp} RequestsLibrary.Get Request - ... ${CONFIG_SESSION} - ... /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/ + ${rsp} RequestsLibrary.GET On Session + ... alias=${CONFIG_SESSION} + ... url=/rests/data/bgp-rib:bgp-rib/rib=example-bgp-rib/loc-rib?content=nonconfig BuiltIn.Log ${rsp.content} Configure_App_Peer_With_Routes -- 2.36.6 From 74c71dc52652103ddbfcdc9258972d7d11b164a5 Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Wed, 27 Mar 2024 13:48:20 -0700 Subject: [PATCH 03/16] Fix duplicate keywords The 'Read_Text_Before_Prompt' keyword in ebgp_peers_basic.robot is unnecessary since it's already defined in BGPcliKeywords.robot. Remove the duplicate keyword. Also, use explicit resource name for the keywords imported from BGPcliKeywords.robot to make it more consistent and add a missing resource imported by BGPcliKeywords.robot. Change-Id: I817a58b04e4adc9e9c2c86b6f14065aa44e88d52 Signed-off-by: Sangwook Ha --- csit/libraries/BGPcliKeywords.robot | 1 + .../bgpcep/bgpuser/ebgp_peers_basic.robot | 18 ++++++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/csit/libraries/BGPcliKeywords.robot b/csit/libraries/BGPcliKeywords.robot index 8739d34261..536b6bc06f 100644 --- a/csit/libraries/BGPcliKeywords.robot +++ b/csit/libraries/BGPcliKeywords.robot @@ -15,6 +15,7 @@ Documentation Robot keyword library (Resource) for handling the BGP speake Library SSHLibrary timeout=10s Library RequestsLibrary Resource ../variables/Variables.robot +Resource BGPSpeaker.robot Resource RemoteBash.robot Resource NexusKeywords.robot diff --git a/csit/suites/bgpcep/bgpuser/ebgp_peers_basic.robot b/csit/suites/bgpcep/bgpuser/ebgp_peers_basic.robot index 81a33bf234..64613570db 100644 --- a/csit/suites/bgpcep/bgpuser/ebgp_peers_basic.robot +++ b/csit/suites/bgpcep/bgpuser/ebgp_peers_basic.robot @@ -145,16 +145,16 @@ Connect_iBGP_Peer1 [Documentation] Connect BGP peer [Tags] critical SSHLibrary.Switch Connection ibgp_peer1_console - Start_Console_Tool ${iBGP_PEER1_COMMAND} ${iBGP_PEER1_OPTIONS} - Read_And_Fail_If_Prompt_Is_Seen + BGPcliKeywords.Start_Console_Tool ${iBGP_PEER1_COMMAND} ${iBGP_PEER1_OPTIONS} + BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain ${CONFIG_SESSION} prefix Connect_eBGP_Peer1 [Documentation] Connect BGP peer [Tags] critical SSHLibrary.Switch Connection ebgp_peer1_console - Start_Console_Tool ${eBGP_PEER1_COMMAND} ${eBGP_PEER1_OPTIONS} - Read_And_Fail_If_Prompt_Is_Seen + BGPcliKeywords.Start_Console_Tool ${eBGP_PEER1_COMMAND} ${eBGP_PEER1_OPTIONS} + BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen Check_IPv4_Topology_For_First_Path [Documentation] The IPv4 topology shall contain the route announced by the first eBGP @@ -195,8 +195,8 @@ Connect_eBGP_Peer2 [Documentation] Connect BGP peer and check empty topology [Tags] critical SSHLibrary.Switch Connection ebgp_peer2_console - Start_Console_Tool ${eBGP_PEER2_COMMAND} ${eBGP_PEER2_OPTIONS} - Read_And_Fail_If_Prompt_Is_Seen + BGPcliKeywords.Start_Console_Tool ${eBGP_PEER2_COMMAND} ${eBGP_PEER2_OPTIONS} + BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen Disconnect_eBGP_Peer1 [Documentation] Stop BGP peer, log topology and store logs @@ -429,12 +429,6 @@ Setup_Everything KarafKeywords.Execute_Controller_Karaf_Command_On_Background ... log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol -Read_Text_Before_Prompt - [Documentation] Log text gathered by SSHLibrary.Read_Until_Prompt. - ... This needs to be a separate keyword just because how Read_And_Fail_If_Prompt_Is_Seen is implemented. - ${text} SSHLibrary.Read_Until_Prompt - BuiltIn.Log ${text} - Store_File_To_Workspace [Documentation] Store the ${source_file_name} to the workspace as ${target_file_name}. [Arguments] ${source_file_name} ${target_file_name} -- 2.36.6 From 1feeb85d876a6dd94c16f644ddf175a37dd5fc27 Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Wed, 27 Mar 2024 16:06:08 -0700 Subject: [PATCH 04/16] Migrate GoBgpLib.robot The 'Get Request' RequestsLibrary keyword has been deprecated. Migrate it to 'GET On Session'. Change-Id: Ia520b59076383f3b68f9bd0e692ce8355f909e72 Signed-off-by: Sangwook Ha --- csit/libraries/GoBgpLib.robot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/csit/libraries/GoBgpLib.robot b/csit/libraries/GoBgpLib.robot index da71866c35..986f3079f1 100644 --- a/csit/libraries/GoBgpLib.robot +++ b/csit/libraries/GoBgpLib.robot @@ -13,6 +13,7 @@ Documentation Robot keyword library (Resource) for handling the GoBgp tool ... Library Process +Library RequestsLibrary Library SSHLibrary Resource ${CURDIR}/BGPcliKeywords.robot Resource ${CURDIR}/RemoteBash.robot @@ -73,6 +74,9 @@ Verify_GoBgps_Connection ... ${connected} ... ${ALLOWED_STATUS_CODES} ... ${DELETED_STATUS_CODES} - ${rsp}= RequestsLibrary.Get Request ${session} ${peer_check_url}${gobgp_ip}?content=nonconfig + ${rsp}= RequestsLibrary.GET On Session + ... alias=${session} + ... url=${peer_check_url}${gobgp_ip}?content=nonconfig + ... expected_status=any BuiltIn.Log ${rsp.content} BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code} -- 2.36.6 From 525352e2c3aa1fa135729c4461ea5af642f22b5f Mon Sep 17 00:00:00 2001 From: Yaroslav Lastivka Date: Wed, 27 Mar 2024 18:38:58 +0200 Subject: [PATCH 05/16] Migrate request invocations (aaa) The '* Request' RequestsLibrary keyword has been deprecated. '* Request' keywords have been replaced by '* On Session'. JIRA: INTTEST-141 Change-Id: I00b92feced48fae4bc40ada42795d48f51e60df7 Signed-off-by: Yaroslav Lastivka Signed-off-by: Sangwook Ha --- csit/libraries/AAAKeywords.robot | 4 +- .../aaa/authn/Restconf_Basic_Auth.robot | 9 +-- .../aaa/keystone/010__keystone_authn.robot | 74 ++++++++++++------- .../aaa/tls/010__aaa_restconf_tls.robot | 6 +- 4 files changed, 56 insertions(+), 37 deletions(-) diff --git a/csit/libraries/AAAKeywords.robot b/csit/libraries/AAAKeywords.robot index 9735f5b2c4..33e56505ec 100644 --- a/csit/libraries/AAAKeywords.robot +++ b/csit/libraries/AAAKeywords.robot @@ -87,8 +87,8 @@ Get User From IDM DB [Arguments] ${user_id}=${EMPTY} Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTPORT} ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded - ${resp}= RequestsLibrary.GET Request httpbin ${idmurl}/users/${user_id} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= RequestsLibrary.GET On Session httpbin url=${idmurl}/users/${user_id} headers=${headers} + ... expected_status=200 Log ${resp.text} RETURN ${resp} diff --git a/csit/suites/aaa/authn/Restconf_Basic_Auth.robot b/csit/suites/aaa/authn/Restconf_Basic_Auth.robot index ce29321cce..85c701ae42 100644 --- a/csit/suites/aaa/authn/Restconf_Basic_Auth.robot +++ b/csit/suites/aaa/authn/Restconf_Basic_Auth.robot @@ -71,8 +71,7 @@ IDM Endpoints Only Available To admin Role [Documentation] A user with a non-"admin" role should not have access to AAA endpoints ${auth} = Create List ${USER_USER} ${USER_PW} Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${auth} headers=${HEADERS} - ${resp} = RequestsLibrary.Get Request httpbin ${USERS_REST_URL} - Should Be Equal As Numbers ${resp.status_code} 401 + ${resp} = RequestsLibrary.GET On Session httpbin url=${USERS_REST_URL} expected_status=401 *** Keywords *** @@ -81,8 +80,7 @@ Auth Should Fail [Arguments] ${url} ${user} ${password} @{auth} = Create List ${user} ${password} Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${auth} headers=${HEADERS} - ${resp} = RequestsLibrary.Get Request httpbin ${url} - Should Be Equal As Strings ${resp.status_code} 401 + ${resp} = RequestsLibrary.GET On Session httpbin url=${url} expected_status=401 ${header_value} = Convert To Uppercase ${resp.headers}[www-authenticate] Should Contain ${header_value} BASIC Log ${resp.content} @@ -92,5 +90,4 @@ Auth Should Pass [Arguments] ${url} ${user} ${password} @{auth} = Create List ${user} ${password} Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${auth} headers=${HEADERS} - ${resp} = RequestsLibrary.Get Request httpbin ${url} - Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session httpbin url=${url} expected_status=200 diff --git a/csit/suites/aaa/keystone/010__keystone_authn.robot b/csit/suites/aaa/keystone/010__keystone_authn.robot index 7977a2d9af..3927d727a7 100644 --- a/csit/suites/aaa/keystone/010__keystone_authn.robot +++ b/csit/suites/aaa/keystone/010__keystone_authn.robot @@ -48,9 +48,11 @@ Successful Authentication Including Domain ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_SDN_DOMAIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Successful Authentication Without Domain @@ -67,9 +69,11 @@ Successful Authentication Without Domain ... ... - URL "/restconf/operational/ietf-restconf-monitoring:restconf-state" is not specified neither in shiro.ini nor in MDSAL Dynamic Authorization so no specific role is required Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_CSC_SDN} headers=${HEADERS} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Unsuccessful Authentication Wrong User @@ -84,9 +88,11 @@ Unsuccessful Authentication Wrong User ... ... Due to authentication fails, authorization is not evaluated Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_INVALID} headers=${HEADERS} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} UnSuccessful Authentication Without Domain @@ -102,9 +108,11 @@ UnSuccessful Authentication Without Domain ... ... Due to authentication fails, authorization is not evaluated Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_SDN} headers=${HEADERS} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} Unsuccessful Authentication Wrong Domain @@ -125,9 +133,11 @@ Unsuccessful Authentication Wrong Domain ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_SDN_WRONG_DOM} ... headers=${HEADERS} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} Unsuccessful Basic Authorization @@ -146,9 +156,11 @@ Unsuccessful Basic Authorization ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_CSC_NO_ADMIN} ... headers=${HEADERS} - ${resp_ok} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp_ok} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp_ok.status_code} - ${resp_nook} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp_nook} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code} Unsuccessful Dynamic Authorization @@ -167,9 +179,11 @@ Unsuccessful Dynamic Authorization ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_CSC_NO_ADMIN} ... headers=${HEADERS} - ${resp_nook} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp_nook} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code} - ${resp_nook} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp_nook} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code} Unsuccessful Dynamic Authorization 2 @@ -196,18 +210,22 @@ Unsuccessful Dynamic Authorization 2 ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_SDN_DOMAIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} Create Session ... session ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_CSC_NO_ADMIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} Unsuccessful No Keystone Connection @@ -223,18 +241,21 @@ Unsuccessful No Keystone Connection ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_SDN_DOMAIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} Create Session ... session ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_CSC_NO_ADMIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} @@ -346,13 +367,14 @@ Provision MDSAL Create Session session_admin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Set Suite Variable ${PUT_DYNAMIC_AUTH_URI} /restconf/config/aaa:http-authorization ${body_dyn} OperatingSystem.Get File ${PUT_DYNAMIC_AUTH_FILE} - ${resp} RequestsLibrary.Put Request + ${resp} RequestsLibrary.PUT On Session ... session_admin - ... ${PUT_DYNAMIC_AUTH_URI} + ... url=${PUT_DYNAMIC_AUTH_URI} ... data=${body_dyn} ... headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} - Delete Request session_admin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} + DELETE On Session session_admin url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT} Restart Controller [Documentation] Controller restart is needed in order the new shiro.ini config takes effect @@ -367,7 +389,7 @@ Restart Controller Get Controller Modules [Documentation] Get the restconf modules, check 200 status and ietf-restconf presence Create Session session1 http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} - ${resp} RequestsLibrary.Get_Request session1 ${MODULES_API} + ${resp} RequestsLibrary.GET On Session session1 url=${MODULES_API} BuiltIn.Log ${resp.content} BuiltIn.Should_Be_Equal ${resp.status_code} ${200} BuiltIn.Should_Contain ${resp.content} ietf-restconf diff --git a/csit/suites/aaa/tls/010__aaa_restconf_tls.robot b/csit/suites/aaa/tls/010__aaa_restconf_tls.robot index 945fb3b7b2..1ce552a1b2 100644 --- a/csit/suites/aaa/tls/010__aaa_restconf_tls.robot +++ b/csit/suites/aaa/tls/010__aaa_restconf_tls.robot @@ -27,7 +27,7 @@ ${RESTCONF_MONITORING_URL} https://${ODL_SYSTEM_IP}:${RESTCONFPORT_TLS}${RE Basic Unsecure Restconf Request [Documentation] Tests a basic HTTP request, just to ensure that system is working fine with normal, unsecure reqs Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} - ${resp} RequestsLibrary.Get Request session ${RESTCONF_MONITORING_URI} + ${resp} RequestsLibrary.GET On Session session ${RESTCONF_MONITORING_URI} expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Delete All Sessions @@ -47,7 +47,7 @@ Activate TLS Enable TLS in ODL # Check ODL was restarted properly Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} - ${resp} RequestsLibrary.Get Request session ${RESTCONF_MONITORING_URI} + ${resp} RequestsLibrary.GET On Session session ${RESTCONF_MONITORING_URI} expected_status=anything Delete All Sessions Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} @@ -91,7 +91,7 @@ Activate Client Authentication Enable Client TLS Authentication in ODL # Check ODL was restarted properly Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} - ${resp} RequestsLibrary.Get Request session ${RESTCONF_MONITORING_URI} + ${resp} RequestsLibrary.GET On Session session ${RESTCONF_MONITORING_URI} expected_status=anything Delete All Sessions Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} -- 2.36.6 From ef948b66caa3ac79dc6da39938eb0293eb51ae5c Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Fri, 29 Mar 2024 14:26:05 -0700 Subject: [PATCH 06/16] Migrate request invocations for controller/NETCONF The '* Request' keywords have been deprecated. Replace '* Request' keywords with '* On Session'. Also, covert Bierman URLs to the RFC 8040 format. JIRA: INTTEST-141 Change-Id: Ie65aaa6a928ceaff0045f676b5cb84c33d2a4262 Signed-off-by: Sangwook Ha --- .../NETCONF/010__netconf_inventory.robot | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/csit/suites/controller/NETCONF/010__netconf_inventory.robot b/csit/suites/controller/NETCONF/010__netconf_inventory.robot index 47ffaf0d3c..99a2ef89b0 100644 --- a/csit/suites/controller/NETCONF/010__netconf_inventory.robot +++ b/csit/suites/controller/NETCONF/010__netconf_inventory.robot @@ -1,10 +1,12 @@ *** Settings *** Documentation Test suite for NETCONF client +... FIXME: this test suite is based on the config subsystem, which has been long gone. +... Currently this test suite is not used and hence should be fixed when added back. Library Collections Library OperatingSystem -Library String Library RequestsLibrary +Library String Library ../../../libraries/Common.py Variables ../../../variables/Variables.py @@ -13,13 +15,12 @@ Suite Teardown Delete All Sessions *** Variables *** -${NETOPEER} ${TOOLS_SYSTEM_IP} -${NETOPEER_USER} ${TOOLS_SYSTEM_USER} -${FILE} ${CURDIR}/../../../variables/xmls/netconf.xml -${REST_CONT_CONF} /restconf/config/network-topology:network-topology/topology/topology-netconf -${REST_CONT_OPER} /restconf/operational/network-topology:network-topology/topology/topology-netconf -${REST_NTPR_CONF} node/controller-config/yang-ext:mount/config:modules -${REST_NTPR_MOUNT} node/netopeer/yang-ext:mount/ +${NETOPEER} ${TOOLS_SYSTEM_IP} +${NETOPEER_USER} ${TOOLS_SYSTEM_USER} +${FILE} ${CURDIR}/../../../variables/xmls/netconf.xml +${REST_TOPOLOGY_NETCONF} /rests/data/network-topology:network-topology/topology=topology-netconf +${REST_NTPR_CONF} node=controller-config/yang-ext:mount/config:modules +${REST_NTPR_MOUNT} node=netopeer/yang-ext:mount *** Test Cases *** @@ -30,9 +31,12 @@ Add NetConf device ${XML2} Replace String ${XML1} 127.0.0.1 ${NETOPEER} ${body} Replace String ${XML2} mininet ${NETOPEER_USER} Log ${body} - ${resp} Post Request session ${REST_CONT_CONF}/${REST_NTPR_CONF} data=${body} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${REST_TOPOLOGY_NETCONF}/${REST_NTPR_CONF} + ... data=${body} + ... expected_status=204 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 204 Get Controller Inventory [Documentation] Get Controller operational inventory @@ -42,17 +46,21 @@ Get Controller Inventory Pull External Device configuration [Documentation] Pull Netopeer configuration [Tags] netconf - ${resp} Get Request session ${REST_CONT_CONF}/${REST_NTPR_MOUNT} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_TOPOLOGY_NETCONF}/${REST_NTPR_MOUNT}?content=config + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} {} Verify Device Operational data [Documentation] Verify Netopeer operational data [Tags] exclude - ${resp} Get Request session ${REST_CONT_OPER}/${REST_NTPR_MOUNT} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_TOPOLOGY_NETCONF}/${REST_NTPR_MOUNT}?content=nonconfig + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} schema Should Contain ${resp.content} statistics Should Contain ${resp.content} datastores @@ -60,9 +68,11 @@ Verify Device Operational data *** Keywords *** Get Inventory - ${resp} Get Request session ${REST_CONT_OPER}/node/netopeer + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_TOPOLOGY_NETCONF}/node=netopeer?content=nonconfig + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} "node-id":"netopeer" Should Contain ${resp.content} "netconf-node-topology:connection-status":"connected" Should Contain ${resp.content} "netconf-node-topology:available-capabilities" -- 2.36.6 From 5e0db03559ff014b9edcf705995e0c862fe363ca Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Fri, 29 Mar 2024 17:40:00 -0700 Subject: [PATCH 07/16] Use RFC 8040 URL for 'odl-mdsal-lowlevel-*' RPCs The URLs for odl-mdsal-lowlevel-control-{control,target} module RPCs have not been updated to RFC 8040 yet. Fix them up. Signed-off-by: Sangwook Ha Change-Id: I52afc3a94543567ed051d49a187bc1312febfbe8 --- csit/libraries/MdsalLowlevelPy.py | 4 ++-- .../mdsal/lowlevelrpc/become_prefix_leader/location.uri | 2 +- .../lowlevelrpc/check_publish_notifications/location.uri | 2 +- .../mdsal/lowlevelrpc/create_prefix_shard/location.uri | 2 +- csit/variables/mdsal/lowlevelrpc/get_constant/location.uri | 2 +- .../mdsal/lowlevelrpc/get_contexted_constant/location.uri | 2 +- .../mdsal/lowlevelrpc/get_singleton_constant/location.uri | 2 +- .../mdsal/lowlevelrpc/produce_transactions/location.uri | 2 +- .../mdsal/lowlevelrpc/register_bound_constant/location.uri | 2 +- .../mdsal/lowlevelrpc/register_constant/location.uri | 2 +- .../lowlevelrpc/register_flapping_singleton/location.uri | 2 +- .../lowlevelrpc/register_singleton_constant/location.uri | 2 +- .../mdsal/lowlevelrpc/remove_prefix_shard/location.uri | 2 +- .../lowlevelrpc/shutdown_prefix_shard_replica/location.uri | 2 +- .../mdsal/lowlevelrpc/shutdown_shard_replica/location.uri | 2 +- .../lowlevelrpc/start_publish_notifications/location.uri | 2 +- csit/variables/mdsal/lowlevelrpc/subscribe_ddtl/location.uri | 2 +- csit/variables/mdsal/lowlevelrpc/subscribe_dtcl/location.uri | 2 +- csit/variables/mdsal/lowlevelrpc/subscribe_ynl/location.uri | 2 +- .../mdsal/lowlevelrpc/unregister_bound_constant/location.uri | 2 +- .../mdsal/lowlevelrpc/unregister_constant/location.uri | 2 +- .../lowlevelrpc/unregister_flapping_singleton/location.uri | 2 +- .../lowlevelrpc/unregister_singleton_constant/location.uri | 2 +- .../variables/mdsal/lowlevelrpc/unsubscribe_ddtl/location.uri | 2 +- .../variables/mdsal/lowlevelrpc/unsubscribe_dtcl/location.uri | 2 +- csit/variables/mdsal/lowlevelrpc/unsubscribe_ynl/location.uri | 2 +- .../mdsal/lowlevelrpc/write_transactions/location.uri | 2 +- 27 files changed, 28 insertions(+), 28 deletions(-) diff --git a/csit/libraries/MdsalLowlevelPy.py b/csit/libraries/MdsalLowlevelPy.py index d6ceb5c831..4e1b24243a 100644 --- a/csit/libraries/MdsalLowlevelPy.py +++ b/csit/libraries/MdsalLowlevelPy.py @@ -124,7 +124,7 @@ def start_write_transactions_on_nodes( "CHAINED_FLAG": "true" if chained_flag else "false", } urlt = string.Template( - """http://$HOST:8181/restconf/operations/odl-mdsal-lowlevel-control:write-transactions""" + """http://$HOST:8181/rests/operations/odl-mdsal-lowlevel-control:write-transactions""" ) _initiate_rpcs(host_list, index_list, urlt, datat, subst_dict) @@ -178,7 +178,7 @@ def start_produce_transactions_on_nodes( "ISOLATED_TRANSACTIONS": "true" if isolated_transactions_flag else "false", } urlt = string.Template( - """http://$HOST:8181/restconf/operations/odl-mdsal-lowlevel-control:produce-transactions""" + """http://$HOST:8181/rests/operations/odl-mdsal-lowlevel-control:produce-transactions""" ) _initiate_rpcs(host_list, index_list, urlt, datat, subst_dict) diff --git a/csit/variables/mdsal/lowlevelrpc/become_prefix_leader/location.uri b/csit/variables/mdsal/lowlevelrpc/become_prefix_leader/location.uri index fb88de7c5d..bb28d90a51 100644 --- a/csit/variables/mdsal/lowlevelrpc/become_prefix_leader/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/become_prefix_leader/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:become-prefix-leader \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:become-prefix-leader diff --git a/csit/variables/mdsal/lowlevelrpc/check_publish_notifications/location.uri b/csit/variables/mdsal/lowlevelrpc/check_publish_notifications/location.uri index 14a3526ec5..475dcf25c8 100644 --- a/csit/variables/mdsal/lowlevelrpc/check_publish_notifications/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/check_publish_notifications/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:check-publish-notifications +/rests/operations/odl-mdsal-lowlevel-control:check-publish-notifications diff --git a/csit/variables/mdsal/lowlevelrpc/create_prefix_shard/location.uri b/csit/variables/mdsal/lowlevelrpc/create_prefix_shard/location.uri index 4f360714ca..b34309016a 100644 --- a/csit/variables/mdsal/lowlevelrpc/create_prefix_shard/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/create_prefix_shard/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:create-prefix-shard +/rests/operations/odl-mdsal-lowlevel-control:create-prefix-shard diff --git a/csit/variables/mdsal/lowlevelrpc/get_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/get_constant/location.uri index 1df1391ba7..f3d05e1cd0 100644 --- a/csit/variables/mdsal/lowlevelrpc/get_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/get_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-target:get-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-target:get-constant diff --git a/csit/variables/mdsal/lowlevelrpc/get_contexted_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/get_contexted_constant/location.uri index 6b5ff937ab..8bcf25c7be 100644 --- a/csit/variables/mdsal/lowlevelrpc/get_contexted_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/get_contexted_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-target:get-contexted-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-target:get-contexted-constant diff --git a/csit/variables/mdsal/lowlevelrpc/get_singleton_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/get_singleton_constant/location.uri index d30fed30cc..6087234f93 100644 --- a/csit/variables/mdsal/lowlevelrpc/get_singleton_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/get_singleton_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-target:get-singleton-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-target:get-singleton-constant diff --git a/csit/variables/mdsal/lowlevelrpc/produce_transactions/location.uri b/csit/variables/mdsal/lowlevelrpc/produce_transactions/location.uri index 6cf9549da9..3597bdf34e 100644 --- a/csit/variables/mdsal/lowlevelrpc/produce_transactions/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/produce_transactions/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:produce-transactions \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:produce-transactions diff --git a/csit/variables/mdsal/lowlevelrpc/register_bound_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/register_bound_constant/location.uri index bc24857d0b..f234f1b9a6 100644 --- a/csit/variables/mdsal/lowlevelrpc/register_bound_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/register_bound_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:register-bound-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:register-bound-constant diff --git a/csit/variables/mdsal/lowlevelrpc/register_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/register_constant/location.uri index 0af89eb82a..310e69ea42 100644 --- a/csit/variables/mdsal/lowlevelrpc/register_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/register_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:register-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:register-constant diff --git a/csit/variables/mdsal/lowlevelrpc/register_flapping_singleton/location.uri b/csit/variables/mdsal/lowlevelrpc/register_flapping_singleton/location.uri index 9fb9587697..40a5da4b75 100644 --- a/csit/variables/mdsal/lowlevelrpc/register_flapping_singleton/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/register_flapping_singleton/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:register-flapping-singleton \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:register-flapping-singleton diff --git a/csit/variables/mdsal/lowlevelrpc/register_singleton_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/register_singleton_constant/location.uri index a192d69bfb..47351539bf 100644 --- a/csit/variables/mdsal/lowlevelrpc/register_singleton_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/register_singleton_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:register-singleton-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:register-singleton-constant diff --git a/csit/variables/mdsal/lowlevelrpc/remove_prefix_shard/location.uri b/csit/variables/mdsal/lowlevelrpc/remove_prefix_shard/location.uri index 65d8867222..0407c7b43c 100644 --- a/csit/variables/mdsal/lowlevelrpc/remove_prefix_shard/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/remove_prefix_shard/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:remove-prefix-shard +/rests/operations/odl-mdsal-lowlevel-control:remove-prefix-shard diff --git a/csit/variables/mdsal/lowlevelrpc/shutdown_prefix_shard_replica/location.uri b/csit/variables/mdsal/lowlevelrpc/shutdown_prefix_shard_replica/location.uri index 7e00f3700d..ce999f1008 100644 --- a/csit/variables/mdsal/lowlevelrpc/shutdown_prefix_shard_replica/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/shutdown_prefix_shard_replica/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:shutdown-prefix-shard-replica +/rests/operations/odl-mdsal-lowlevel-control:shutdown-prefix-shard-replica diff --git a/csit/variables/mdsal/lowlevelrpc/shutdown_shard_replica/location.uri b/csit/variables/mdsal/lowlevelrpc/shutdown_shard_replica/location.uri index 968202bdb0..ce08c60cc2 100644 --- a/csit/variables/mdsal/lowlevelrpc/shutdown_shard_replica/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/shutdown_shard_replica/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:shutdown-shard-replica +/rests/operations/odl-mdsal-lowlevel-control:shutdown-shard-replica diff --git a/csit/variables/mdsal/lowlevelrpc/start_publish_notifications/location.uri b/csit/variables/mdsal/lowlevelrpc/start_publish_notifications/location.uri index 7c0fbb1a98..4a3d364d0c 100644 --- a/csit/variables/mdsal/lowlevelrpc/start_publish_notifications/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/start_publish_notifications/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:start-publish-notifications +/rests/operations/odl-mdsal-lowlevel-control:start-publish-notifications diff --git a/csit/variables/mdsal/lowlevelrpc/subscribe_ddtl/location.uri b/csit/variables/mdsal/lowlevelrpc/subscribe_ddtl/location.uri index 8725e8b175..daf35fb549 100644 --- a/csit/variables/mdsal/lowlevelrpc/subscribe_ddtl/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/subscribe_ddtl/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:subscribe-ddtl \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:subscribe-ddtl diff --git a/csit/variables/mdsal/lowlevelrpc/subscribe_dtcl/location.uri b/csit/variables/mdsal/lowlevelrpc/subscribe_dtcl/location.uri index 5d30b0fd03..06fe70abb1 100644 --- a/csit/variables/mdsal/lowlevelrpc/subscribe_dtcl/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/subscribe_dtcl/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:subscribe-dtcl \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:subscribe-dtcl diff --git a/csit/variables/mdsal/lowlevelrpc/subscribe_ynl/location.uri b/csit/variables/mdsal/lowlevelrpc/subscribe_ynl/location.uri index f0c5e6a426..78c479efac 100644 --- a/csit/variables/mdsal/lowlevelrpc/subscribe_ynl/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/subscribe_ynl/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:subscribe-ynl \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:subscribe-ynl diff --git a/csit/variables/mdsal/lowlevelrpc/unregister_bound_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/unregister_bound_constant/location.uri index 4c1243d250..de167b2fa4 100644 --- a/csit/variables/mdsal/lowlevelrpc/unregister_bound_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/unregister_bound_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:unregister-bound-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:unregister-bound-constant diff --git a/csit/variables/mdsal/lowlevelrpc/unregister_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/unregister_constant/location.uri index e6814696fb..f2241f0b45 100644 --- a/csit/variables/mdsal/lowlevelrpc/unregister_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/unregister_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:unregister-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:unregister-constant diff --git a/csit/variables/mdsal/lowlevelrpc/unregister_flapping_singleton/location.uri b/csit/variables/mdsal/lowlevelrpc/unregister_flapping_singleton/location.uri index 3f1177f666..532aa5e879 100644 --- a/csit/variables/mdsal/lowlevelrpc/unregister_flapping_singleton/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/unregister_flapping_singleton/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:unregister-flapping-singleton \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:unregister-flapping-singleton diff --git a/csit/variables/mdsal/lowlevelrpc/unregister_singleton_constant/location.uri b/csit/variables/mdsal/lowlevelrpc/unregister_singleton_constant/location.uri index f0e72fba26..450740993c 100644 --- a/csit/variables/mdsal/lowlevelrpc/unregister_singleton_constant/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/unregister_singleton_constant/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:unregister-singleton-constant \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:unregister-singleton-constant diff --git a/csit/variables/mdsal/lowlevelrpc/unsubscribe_ddtl/location.uri b/csit/variables/mdsal/lowlevelrpc/unsubscribe_ddtl/location.uri index 93cbe5af77..cce66e0f47 100644 --- a/csit/variables/mdsal/lowlevelrpc/unsubscribe_ddtl/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/unsubscribe_ddtl/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:unsubscribe-ddtl \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:unsubscribe-ddtl diff --git a/csit/variables/mdsal/lowlevelrpc/unsubscribe_dtcl/location.uri b/csit/variables/mdsal/lowlevelrpc/unsubscribe_dtcl/location.uri index 8850035310..a27c7bc401 100644 --- a/csit/variables/mdsal/lowlevelrpc/unsubscribe_dtcl/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/unsubscribe_dtcl/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:unsubscribe-dtcl \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:unsubscribe-dtcl diff --git a/csit/variables/mdsal/lowlevelrpc/unsubscribe_ynl/location.uri b/csit/variables/mdsal/lowlevelrpc/unsubscribe_ynl/location.uri index c2d4f5e816..d51746f3ad 100644 --- a/csit/variables/mdsal/lowlevelrpc/unsubscribe_ynl/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/unsubscribe_ynl/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:unsubscribe-ynl \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:unsubscribe-ynl diff --git a/csit/variables/mdsal/lowlevelrpc/write_transactions/location.uri b/csit/variables/mdsal/lowlevelrpc/write_transactions/location.uri index 2755958499..e76d22cadc 100644 --- a/csit/variables/mdsal/lowlevelrpc/write_transactions/location.uri +++ b/csit/variables/mdsal/lowlevelrpc/write_transactions/location.uri @@ -1 +1 @@ -/restconf/operations/odl-mdsal-lowlevel-control:write-transactions \ No newline at end of file +/rests/operations/odl-mdsal-lowlevel-control:write-transactions -- 2.36.6 From 1df85cc733881a9c386f46302a902bcfe05595fe Mon Sep 17 00:00:00 2001 From: Yaroslav Lastivka Date: Wed, 27 Mar 2024 23:12:14 +0200 Subject: [PATCH 08/16] Migrate request invocations (controller) The '* Request' and 'To Json' RequestsLibrary keywords have been deprecated. Replace '* Request' keywords with '* On Session' and replace 'To Json' in ClusterManagement.robot with the 'Json Parse from String' keyword in Utils.robot. Also, fix some URLs based on RESTCONF Bierman draft. JIRA: INTTEST-141 Change-Id: I75586bd86678755541ecf9161dac31c6326f63d9 Signed-off-by: Yaroslav Lastivka Signed-off-by: Sangwook Ha --- csit/libraries/ClusterManagement.robot | 6 ++-- csit/libraries/CrudLibrary.py | 12 +++++-- csit/libraries/SettingsLibrary.py | 20 ++++++------ .../010_crud_mdsal_perf.robot | 30 +++++++++--------- .../010_crud_mdsal_perf.robot | 31 ++++++++++--------- .../puts_during_isolation.robot | 12 +++---- .../singleton_service/global_rpc_freeze.robot | 4 +-- .../global_rpc_isolate.robot | 8 ++--- .../singleton_service/global_rpc_kill.robot | 4 +-- .../carpeople/crud/car-people/location.uri | 2 +- .../carpeople/crud/cars/location.uri | 2 +- .../carpeople/libtest/car/location.uri | 2 +- .../carpeople/libtest/car_person/location.uri | 2 +- .../carpeople/libtest/cars/location.uri | 2 +- .../libtest/cars_people/location.uri | 2 +- 15 files changed, 72 insertions(+), 67 deletions(-) diff --git a/csit/libraries/ClusterManagement.robot b/csit/libraries/ClusterManagement.robot index c624b10b8f..93ef015a10 100644 --- a/csit/libraries/ClusterManagement.robot +++ b/csit/libraries/ClusterManagement.robot @@ -30,7 +30,7 @@ Documentation Resource housing Keywords common to several suites for clust ... ... TODO: Unify capitalization of Leaders and Followers. -Library RequestsLibrary # for Create_Session and To_Json +Library RequestsLibrary # for Create_Session Library Collections Library String Library ClusterEntities.py @@ -244,7 +244,7 @@ Get_Raft_Property_From_Shard_Member ... uri=${uri} ... session=${session} ... http_timeout=${http_timeout} - ${data_object} = RequestsLibrary.To_Json ${data_text} + ${data_object} = Utils.Json Parse From String ${data_text} ${value} = Collections.Get_From_Dictionary ${data_object} value ${raft_property} = Collections.Get_From_Dictionary ${value} ${property} RETURN ${raft_property} @@ -1065,7 +1065,7 @@ ClusterManagement__Parse_Sync_Status [Documentation] Return sync status parsed out of given text. Called twice by Get_Sync_Status_Of_Member. [Arguments] ${shard_manager_text} BuiltIn.Log ${shard_manager_text} - ${manager_object} = RequestsLibrary.To_Json ${shard_manager_text} + ${manager_object} = Utils.Json Parse From String ${shard_manager_text} ${value_object} = Collections.Get_From_Dictionary dictionary=${manager_object} key=value ${sync_status} = Collections.Get_From_Dictionary dictionary=${value_object} key=SyncStatus RETURN ${sync_status} diff --git a/csit/libraries/CrudLibrary.py b/csit/libraries/CrudLibrary.py index 0f80253a3a..cec6c5bc1f 100644 --- a/csit/libraries/CrudLibrary.py +++ b/csit/libraries/CrudLibrary.py @@ -210,7 +210,9 @@ def buyCar(hostname, port, numberOfCarBuyers, start=0): def getCars(hostname, port, ignore): """Uses the GET on car:cars resource to get all cars in the store using RESTCONF""" - resp = UtilLibrary.get(SettingsLibrary.getCarsUrl(hostname, port), "admin", "admin") + resp = UtilLibrary.get( + SettingsLibrary.getCarsUrl(hostname, port) + "?content=config", "admin", "admin" + ) resp.encoding = "utf-8" print(resp.text) return resp @@ -225,7 +227,9 @@ def getPersons(hostname, port, ignore): """ resp = UtilLibrary.get( - SettingsLibrary.getPersonsUrl(hostname, port), "admin", "admin" + SettingsLibrary.getPersonsUrl(hostname, port) + "?content=config", + "admin", + "admin", ) resp.encoding = "utf-8" print(resp.text) @@ -242,7 +246,9 @@ def getCarPersonMappings(hostname, port, ignore): """ resp = UtilLibrary.get( - SettingsLibrary.getCarPersonUrl(hostname, port), "admin", "admin" + SettingsLibrary.getCarPersonUrl(hostname, port) + "?content=config", + "admin", + "admin", ) resp.encoding = "utf-8" print(resp) diff --git a/csit/libraries/SettingsLibrary.py b/csit/libraries/SettingsLibrary.py index 7e22ade8d8..c0325d334f 100644 --- a/csit/libraries/SettingsLibrary.py +++ b/csit/libraries/SettingsLibrary.py @@ -19,49 +19,47 @@ __email__ = "syedbahm@cisco.com" def getCarsUrl(hostname, port): """Cars resource URL for GET""" - return "http://" + hostname + ":" + port + "/restconf/config/car:cars" + return "http://" + hostname + ":" + port + "/rests/data/car:cars" def getPersonsUrl(hostname, port): """People resouce URL for GET""" - return "http://" + hostname + ":" + port + "/restconf/config/people:people" + return "http://" + hostname + ":" + port + "/rests/data/people:people" def getCarPersonUrl(hostname, port): """GET cars persons mapping resource URL""" - return "http://" + hostname + ":" + port + "/restconf/config/car-people:car-people" + return "http://" + hostname + ":" + port + "/rests/data/car-people:car-people" def getAddCarInitUrl(hostname, port): """POST or DELETE URL""" - return "http://" + hostname + ":" + port + "/restconf/config" + return "http://" + hostname + ":" + port + "/rests/data" def getAddCarUrl(hostname, port): """POST or DELETE URL""" - return "http://" + hostname + ":" + port + "/restconf/config/car:cars" + return "http://" + hostname + ":" + port + "/rests/data/car:cars" def getAddPersonUrl(hostname, port): """POST or DELETE URL""" - return "http://" + hostname + ":" + port + "/restconf/config" + return "http://" + hostname + ":" + port + "/rests/data" def getAddPersonRpcUrl(hostname, port): """POST URL -using rpc""" - return "http://" + hostname + ":" + port + "/restconf/operations/people:add-person" + return "http://" + hostname + ":" + port + "/rests/operations/people:add-person" def getAddCarPersonUrl(hostname, port): """POST URL for car person mapping""" - return "http://" + hostname + ":" + port + "/restconf/config" + return "http://" + hostname + ":" + port + "/rests/data" def getBuyCarRpcUrl(hostname, port): """POST URL for buy car rpc""" - return ( - "http://" + hostname + ":" + port + "/restconf/operations/car-purchase:buy-car" - ) + return "http://" + hostname + ":" + port + "/rests/operations/car-purchase:buy-car" def getJolokiaURL(hostname, port, shardIndex, shardName): diff --git a/csit/suites/controller/OneNode_Datastore/010_crud_mdsal_perf.robot b/csit/suites/controller/OneNode_Datastore/010_crud_mdsal_perf.robot index 735cfa9e9b..0be32338a8 100644 --- a/csit/suites/controller/OneNode_Datastore/010_crud_mdsal_perf.robot +++ b/csit/suites/controller/OneNode_Datastore/010_crud_mdsal_perf.robot @@ -40,9 +40,12 @@ ${addpeoplecmd} ... python cluster_rest_script.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} add-rpc --itemtype people --itemcount ${ITEM_COUNT} --threads 5 ${purchasecmd} ... python cluster_rest_script.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} add-rpc --itemtype car-people --itemcount ${ITEM_COUNT} --threads 5 -${carurl} /restconf/config/car:cars -${peopleurl} /restconf/config/people:people -${carpeopleurl} /restconf/config/car-people:car-people +${carurl} /rests/data/car:cars +${carurl_config} /rests/data/car:cars?content=config +${peopleurl} /rests/data/people:people +${peopleurl_config} /rests/data/people:people?content=config +${carpeopleurl} /rests/data/car-people:car-people +${carpeopleurl_config} /rests/data/car-people:car-people?content=config ${CONTROLLER_LOG_LEVEL} INFO ${TOOL_OPTIONS} ${EMPTY} @@ -59,7 +62,7 @@ Verify Cars [Documentation] Store logs and verify result Stop Tool Store File To Workspace cluster_rest_script.log cluster_rest_script_add_cars.log - ${rsp}= RequestsLibrary.Get Request session ${carurl} headers=${ACCEPT_XML} + ${rsp}= RequestsLibrary.GET On Session session url=${carurl_config} headers=${ACCEPT_XML} ${count}= XML.Get Element Count ${rsp.content} xpath=car-entry Should Be Equal As Numbers ${count} ${ITEM_COUNT} @@ -72,7 +75,7 @@ Verify People [Documentation] Store logs and verify result Stop Tool Store File To Workspace cluster_rest_script.log cluster_rest_script_add_people.log - ${rsp}= RequestsLibrary.Get Request session ${peopleurl} headers=${ACCEPT_XML} + ${rsp}= RequestsLibrary.GET On Session session url=${peopleurl_config} headers=${ACCEPT_XML} ${count}= XML.Get Element Count ${rsp.content} xpath=person Should Be Equal As Numbers ${count} ${ITEM_COUNT} @@ -89,23 +92,20 @@ Verify Purchases Delete Cars [Documentation] Remove cars from the datastore - ${rsp}= RequestsLibrary.Delete Request session ${carurl} - Should Be Equal As Numbers 200 ${rsp.status_code} - ${rsp}= RequestsLibrary.Get Request session ${carurl} + ${rsp}= RequestsLibrary.DELETE On Session session url=${carurl} expected_status=200 + ${rsp}= RequestsLibrary.GET On Session session url=${carurl_config} expected_status=anything Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code} Delete People [Documentation] Remove people from the datastore - ${rsp}= RequestsLibrary.Delete Request session ${peopleurl} - Should Be Equal As Numbers 200 ${rsp.status_code} - ${rsp}= RequestsLibrary.Get Request session ${peopleurl} + ${rsp}= RequestsLibrary.DELETE On Session session url=${peopleurl} expected_status=200 + ${rsp}= RequestsLibrary.GET On Session session url=${peopleurl_config} expected_status=anything Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code} Delete CarPeople [Documentation] Remove car-people entries from the datastore - ${rsp}= RequestsLibrary.Delete Request session ${carpeopleurl} - Should Be Equal As Numbers 200 ${rsp.status_code} - ${rsp}= RequestsLibrary.Get Request session ${carpeopleurl} + ${rsp}= RequestsLibrary.DELETE On Session session url=${carpeopleurl} expected_status=200 + ${rsp}= RequestsLibrary.GET On Session session url=${carpeopleurl_config} expected_status=anything Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code} @@ -149,7 +149,7 @@ Wait_Until_Tool_Finish Purchase Is Completed [Documentation] Check purchase of ${item_count} is completed. [Arguments] ${item_count} - ${rsp}= RequestsLibrary.Get Request session ${carpeopleurl} headers=${ACCEPT_XML} + ${rsp}= RequestsLibrary.GET On Session session url=${carpeopleurl_config} headers=${ACCEPT_XML} ${count}= XML.Get Element Count ${rsp.content} xpath=car-person Should Be Equal As Numbers ${count} ${item_count} diff --git a/csit/suites/controller/ThreeNodes_Datastore/010_crud_mdsal_perf.robot b/csit/suites/controller/ThreeNodes_Datastore/010_crud_mdsal_perf.robot index 7fb9608131..a4fd17741f 100644 --- a/csit/suites/controller/ThreeNodes_Datastore/010_crud_mdsal_perf.robot +++ b/csit/suites/controller/ThreeNodes_Datastore/010_crud_mdsal_perf.robot @@ -43,9 +43,12 @@ ${addpeoplecmd} ... python cluster_rest_script.py --port ${RESTCONFPORT} add-rpc --itemtype people --itemcount ${ITEM_COUNT} --threads 6 ${purchasecmd} ... python cluster_rest_script.py --port ${RESTCONFPORT} add-rpc --itemtype car-people --itemcount ${ITEM_COUNT} --threads 6 -${carurl} /restconf/config/car:cars -${peopleurl} /restconf/config/people:people -${carpeopleurl} /restconf/config/car-people:car-people +${carurl} /rests/data/car:cars +${carurl_config} /rests/data/car:cars?content=config +${peopleurl} /rests/data/people:people +${peopleurl_config} /rests/data/people:people?content=config +${carpeopleurl} /rests/data/car-people:car-people +${carpeopleurl_config} /rests/data/car-people:car-people?content=config ${CONTROLLER_LOG_LEVEL} INFO ${TOOL_OPTIONS} ${EMPTY} @@ -61,7 +64,7 @@ Verify Cars [Documentation] Store logs and verify result Stop Tool Store File To Workspace cluster_rest_script.log cluster_rest_script_add_cars.log - ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${carurl} headers=${ACCEPT_XML} + ${rsp}= RequestsLibrary.GET On Session session url=${carurl_config} headers=${ACCEPT_XML} ${count}= XML.Get Element Count ${rsp.content} xpath=car-entry Should Be Equal As Numbers ${count} ${ITEM_COUNT} @@ -74,7 +77,7 @@ Verify People [Documentation] Store logs and verify result Stop Tool Store File To Workspace cluster_rest_script.log cluster_rest_script_add_people.log - ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${peopleurl} headers=${ACCEPT_XML} + ${rsp}= RequestsLibrary.GET On Session session url=${peopleurl_config} headers=${ACCEPT_XML} ${count}= XML.Get Element Count ${rsp.content} xpath=person Should Be Equal As Numbers ${count} ${ITEM_COUNT} @@ -92,23 +95,20 @@ Verify Purchases Delete Cars [Documentation] Remove cars from the datastore - ${rsp}= RequestsLibrary.Delete Request ${car_leader_session} ${carurl} - Should Be Equal As Numbers 200 ${rsp.status_code} - ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${carurl} + ${rsp}= RequestsLibrary.DELETE On Session session url=${carurl} expected_status=200 + ${rsp}= RequestsLibrary.GET On Session session url=${carurl_config} expected_status=anything Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code} Delete People [Documentation] Remove people from the datastore - ${rsp}= RequestsLibrary.Delete Request ${car_leader_session} ${peopleurl} - Should Be Equal As Numbers 200 ${rsp.status_code} - ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${peopleurl} + ${rsp}= RequestsLibrary.DELETE On Session session url=${peopleurl} expected_status=200 + ${rsp}= RequestsLibrary.GET On Session session url=${peopleurl_config} expected_status=anything Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code} Delete CarPeople [Documentation] Remove car-people entries from the datastore - ${rsp}= RequestsLibrary.Delete Request ${car_leader_session} ${carpeopleurl} - Should Be Equal As Numbers 200 ${rsp.status_code} - ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${carpeopleurl} + ${rsp}= RequestsLibrary.DELETE On Session session url=${carpeopleurl} expected_status=200 + ${rsp}= RequestsLibrary.GET On Session session url=${carpeopleurl_config} expected_status=anything Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code} @@ -128,6 +128,7 @@ Start Suite SSHLibrary.Put File ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/scripts/cluster_rest_script.py . ${stdout} ${stderr} ${rc}= SSHLibrary.Execute Command ls return_stdout=True return_stderr=True ... return_rc=True + RequestsLibrary.Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} Stop Suite [Documentation] Suite teardown keyword @@ -149,7 +150,7 @@ Wait_Until_Tool_Finish Purchase Is Completed [Documentation] Check purchase of ${item_count} is completed. [Arguments] ${item_count} - ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${carpeopleurl} headers=${ACCEPT_XML} + ${rsp}= RequestsLibrary.GET On Session session url=${carpeopleurl_config} headers=${ACCEPT_XML} ${count}= XML.Get Element Count ${rsp.content} xpath=car-person Should Be Equal As Numbers ${count} ${item_count} diff --git a/csit/suites/controller/ThreeNodes_Datastore/puts_during_isolation.robot b/csit/suites/controller/ThreeNodes_Datastore/puts_during_isolation.robot index 7b02de6007..2be077c6f1 100644 --- a/csit/suites/controller/ThreeNodes_Datastore/puts_during_isolation.robot +++ b/csit/suites/controller/ThreeNodes_Datastore/puts_during_isolation.robot @@ -33,7 +33,8 @@ ${ITEM_COUNT} ${10000} ${THREADS} 10 ${ADDCMD} ... python ${TOOL_NAME} --port ${RESTCONFPORT} add-with-retries --itemtype car --itemcount ${ITEM_COUNT} --threads ${THREADS} -${CARURL} /restconf/config/car:cars +${CARURL} /rests/data/car:cars +${CARURL_CONFIG} /rests/data/car:cars?content=config ${SHARD_NAME} car ${SHARD_TYPE} config ${TEST_LOG_LEVEL} info @@ -86,9 +87,8 @@ Rejoin_Isolated_Member Delete Cars [Documentation] Remove cars from the datastore ${session} = Resolve_Http_Session_For_Member member_index=${new_leader_index} - ${rsp} = RequestsLibrary.Delete Request ${session} ${CARURL} - Should Be Equal As Numbers 200 ${rsp.status_code} - ${rsp} = RequestsLibrary.Get Request ${session} ${CARURL} + ${rsp} = RequestsLibrary.DELETE On Session ${session} url=${CARURL} expected_status=200 + ${rsp} = RequestsLibrary.GET On Session ${session} url=${CARURL_CONFIG} expected_status=anything Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code} @@ -113,7 +113,7 @@ Stop Suite Stop_Tool ${session} = Resolve_Http_Session_For_Member member_index=${new_leader_index} # best effort to make sure cars are deleted in case more suites will run after this and the delete test case had trouble - ${rsp} = RequestsLibrary.Delete Request ${session} ${CARURL} + ${rsp} = RequestsLibrary.DELETE On Session ${session} url=${CARURL} expected_status=anything BuiltIn.Log ${rsp.status_code} : ${rsp.text} SSHKeywords.Virtual_Env_Delete Store_File_To_Workspace ${out_file} ${out_file} @@ -147,7 +147,7 @@ Verify_Cars_Count Get_Cars_Count [Documentation] Count car items in config ds. [Arguments] ${session} - ${resp} = RequestsLibrary.Get_Request ${session} ${CARURL} + ${resp} = RequestsLibrary.GET On Session ${session} url=${CARURL_CONFIG} ${count} = BuiltIn.Evaluate len(${resp.json()}[cars][car-entry]) RETURN ${count} diff --git a/csit/suites/controller/singleton_service/global_rpc_freeze.robot b/csit/suites/controller/singleton_service/global_rpc_freeze.robot index 073c591667..8dfbfcff2b 100644 --- a/csit/suites/controller/singleton_service/global_rpc_freeze.robot +++ b/csit/suites/controller/singleton_service/global_rpc_freeze.robot @@ -23,12 +23,12 @@ Default Tags critical *** Variables *** -${RPC_URL} /restconf/operations/basic-rpc-test:basic-global +${RPC_URL} /rests/operations/basic-rpc-test:basic-global &{EMPTY_DICT} ${SERVICE} Basic-rpc-test'] ${TEST_LOG_LEVEL} info @{TEST_LOG_COMPONENTS} org.opendaylight.controller.remote.rpc -${EOS_URL} /restconf/operational/entity-owners:entity-owners +${EOS_URL} /rests/data/entity-owners:entity-owners?content=nonconfig ${active_nodes} ${EMPTY} diff --git a/csit/suites/controller/singleton_service/global_rpc_isolate.robot b/csit/suites/controller/singleton_service/global_rpc_isolate.robot index 96029838fb..42761acad6 100644 --- a/csit/suites/controller/singleton_service/global_rpc_isolate.robot +++ b/csit/suites/controller/singleton_service/global_rpc_isolate.robot @@ -24,12 +24,12 @@ Default Tags critical *** Variables *** -${RPC_URL} /restconf/operations/basic-rpc-test:basic-global +${RPC_URL} /rests/operations/basic-rpc-test:basic-global &{EMPTY_DICT} ${SERVICE} Basic-rpc-test'] ${TEST_LOG_LEVEL} info @{TEST_LOG_COMPONENTS} org.opendaylight.controller.remote.rpc -${EOS_URL} /restconf/operational/entity-owners:entity-owners +${EOS_URL} /rests/data/entity-owners:entity-owners?content=nonconfig ${RPC_STATUS_ISOLATED} 501 @@ -71,8 +71,8 @@ Rpc_On_Isolated_Node ${session} = Resolve_Http_Session_For_Member member_index=${old_brt_owner} BuiltIn.Run_Keyword_And_Ignore_Error Get_And_Log_EOS_Output_To_Karaf_Log ${session} BuiltIn.Pass_Execution Rpc on isolated node may work for some time(bug 8207), then will fail (bug 8214) - ${resp} = RequestsLibrary.Post Request ${session} ${RPC_URL} data=${EMPTY} - BuiltIn.Should_Be_Equal_As_Numbers ${resp.status_code} ${RPC_STATUS_ISOLATED} + ${resp} = RequestsLibrary.POST On Session ${session} url=${RPC_URL} data=${EMPTY} + ... expected_status=${RPC_STATUS_ISOLATED} Rpc_On_Non_Isolated_Cluster_Nodes [Documentation] Run rpc on remained cluster nodes. diff --git a/csit/suites/controller/singleton_service/global_rpc_kill.robot b/csit/suites/controller/singleton_service/global_rpc_kill.robot index 59c0767e5f..08ce9945b5 100644 --- a/csit/suites/controller/singleton_service/global_rpc_kill.robot +++ b/csit/suites/controller/singleton_service/global_rpc_kill.robot @@ -24,12 +24,12 @@ Default Tags critical *** Variables *** -${RPC_URL} /restconf/operations/basic-rpc-test:basic-global +${RPC_URL} /rests/operations/basic-rpc-test:basic-global &{EMPTY_DICT} ${SERVICE} Basic-rpc-test'] ${TEST_LOG_LEVEL} info @{TEST_LOG_COMPONENTS} org.opendaylight.controller.remote.rpc -${EOS_URL} /restconf/operational/entity-owners:entity-owners +${EOS_URL} /rests/data/entity-owners:entity-owners?content=nonconfig *** Test Cases *** diff --git a/csit/variables/carpeople/crud/car-people/location.uri b/csit/variables/carpeople/crud/car-people/location.uri index 81ac4440fc..b78be0b238 100644 --- a/csit/variables/carpeople/crud/car-people/location.uri +++ b/csit/variables/carpeople/crud/car-people/location.uri @@ -1 +1 @@ -/restconf/config/car-people:car-people +/rests/data/car-people:car-people diff --git a/csit/variables/carpeople/crud/cars/location.uri b/csit/variables/carpeople/crud/cars/location.uri index 22a7f80ea1..8a0a81dbdf 100644 --- a/csit/variables/carpeople/crud/cars/location.uri +++ b/csit/variables/carpeople/crud/cars/location.uri @@ -1 +1 @@ -/restconf/config/car:cars +/rests/data/car:cars diff --git a/csit/variables/carpeople/libtest/car/location.uri b/csit/variables/carpeople/libtest/car/location.uri index e07c8f8329..2abba97b58 100644 --- a/csit/variables/carpeople/libtest/car/location.uri +++ b/csit/variables/carpeople/libtest/car/location.uri @@ -1 +1 @@ -/restconf/config/car:cars/car-entry/boogie +/rests/data/car:cars/car-entry/boogie diff --git a/csit/variables/carpeople/libtest/car_person/location.uri b/csit/variables/carpeople/libtest/car_person/location.uri index 49d3e33b6c..6e7f29ead8 100644 --- a/csit/variables/carpeople/libtest/car_person/location.uri +++ b/csit/variables/carpeople/libtest/car_person/location.uri @@ -1 +1 @@ -/restconf/config/car-people:car-people/car-person/boogie/joe +/rests/data/car-people:car-people/car-person/boogie/joe diff --git a/csit/variables/carpeople/libtest/cars/location.uri b/csit/variables/carpeople/libtest/cars/location.uri index 22a7f80ea1..8a0a81dbdf 100644 --- a/csit/variables/carpeople/libtest/cars/location.uri +++ b/csit/variables/carpeople/libtest/cars/location.uri @@ -1 +1 @@ -/restconf/config/car:cars +/rests/data/car:cars diff --git a/csit/variables/carpeople/libtest/cars_people/location.uri b/csit/variables/carpeople/libtest/cars_people/location.uri index 81ac4440fc..b78be0b238 100644 --- a/csit/variables/carpeople/libtest/cars_people/location.uri +++ b/csit/variables/carpeople/libtest/cars_people/location.uri @@ -1 +1 @@ -/restconf/config/car-people:car-people +/rests/data/car-people:car-people -- 2.36.6 From 4122a5096fc35c216fa6192d54da4a1d938f0128 Mon Sep 17 00:00:00 2001 From: Yaroslav Lastivka Date: Thu, 28 Mar 2024 00:17:36 +0200 Subject: [PATCH 09/16] Migrate request invocations (openflowplugin) The '* Request' and 'To Json' RequestsLibrary keywords have been deprecated. Replace '* Request' keywords with '* On Session'. In the case of 'To Json', replace it with the 'Json Parse from String' in Utils.robot when the pretty_print is false. When pretty_print is required, use the Evaulate keyword with the json module to generate properly formatted JSON string. JIRA: INTTEST-141 Change-Id: I5a5842bf68870679196824661219be7e62c52d32 Signed-off-by: Yaroslav Lastivka Signed-off-by: Sangwook Ha --- csit/libraries/BulkomaticKeywords.robot | 5 +- csit/libraries/ClusterOpenFlow.robot | 24 ++- csit/libraries/DataModels.robot | 10 +- csit/libraries/FlowLib.robot | 174 +++++++++--------- csit/libraries/SwitchUtils.robot | 5 +- csit/libraries/Utils.robot | 6 +- csit/libraries/WorkflowsOpenFlow.robot | 6 +- .../openflowplugin/Bug_Validation/6917.robot | 2 +- .../openflowplugin/Bug_Validation/7258.robot | 2 +- .../openflowplugin/Bug_Validation/7335.robot | 2 +- .../openflowplugin/Bug_Validation/7349.robot | 2 +- .../openflowplugin/Bug_Validation/8723.robot | 2 +- .../010_bundle_resync.robot | 2 +- .../010_Group_Flows.robot | 20 +- .../010_Lithium_Rps_Calls_Ovs.robot | 12 +- .../020_Lithium_Rps_Calls_Cpqd.robot | 6 +- .../030_Flow_Update_Test.robot | 8 +- .../010__SM_add_upd_del_flows.robot | 26 ++- .../005__openflow_group.robot | 40 ++-- .../010__openflow_meter.robot | 37 ++-- .../010__restconf_inventory.robot | 21 +-- .../020__restconf_topology.robot | 7 +- .../010__restconf_inventory.robot | 20 +- .../020__restconf_topology.robot | 7 +- .../020_restconf_topology.robot | 10 +- .../MD_SAL_NSF_OF10/040_restconf_frm.robot | 23 ++- .../020_restconf_topology.robot | 10 +- .../MD_SAL_NSF_OF13/040_restconf_frm.robot | 35 ++-- .../010_Rest_Config_Flows.robot | 4 +- .../020_Stats_Collection_Gauss.robot | 2 +- .../030_Stats_Collection_Linear.robot | 2 +- .../040_Stats_Collection_One.robot | 2 +- .../050_Stats_Collection_FirstTable.robot | 2 +- ...60_Stats_Collection_Basic16kScenario.robot | 4 +- ...s_Collection_100k_WithMininetRestart.robot | 5 +- ...00k_Flows_Configuration_Time_Measure.robot | 2 +- .../090_BulkMaticConfigDsSetup_100k.robot | 2 +- .../Reconciliation/010_Group_Flows.robot | 14 +- 38 files changed, 293 insertions(+), 270 deletions(-) diff --git a/csit/libraries/BulkomaticKeywords.robot b/csit/libraries/BulkomaticKeywords.robot index 302c913fa5..83f9dfa516 100644 --- a/csit/libraries/BulkomaticKeywords.robot +++ b/csit/libraries/BulkomaticKeywords.robot @@ -3,6 +3,7 @@ Documentation Bulkomatic Keyword library contains keywords for performing ... with a single bulkomatic API we can trigger bulk flows in config datastore which eventually populates switches and operational datastore ... So far this library is only to be used by MD-SAL clustering and OpenFlowplugin clustering test as it is very specific for these tests +Resource ClusterManagement.robot Resource Utils.robot Variables ../variables/Variables.py @@ -24,7 +25,7 @@ Operation Status Check [Documentation] Checks to see if read or write operation is successfull in controller node. [Arguments] ${op_status_uri} ${controller_index} ${data}= ClusterManagement.Get From Member ${op_status_uri} ${controller_index} - ${json}= To Json ${data} + ${json}= Utils.Json Parse From String ${data} ${value}= Get From Dictionary ${json} value ${value}= Convert to String ${value} ${two}= Convert to String 2 @@ -92,7 +93,7 @@ Verify Flow Count [Documentation] Verify Flow Count in member ${controller_index} matches ${flow_count}. [Arguments] ${flow_count} ${controller_index} ${data}= Get Bulk Flow Count ${controller_index} - ${json}= To Json ${data} + ${json}= Utils.Json Parse From String ${data} ${value}= Get From Dictionary ${json} value Should Be Equal As Strings ${value} ${flow_count} diff --git a/csit/libraries/ClusterOpenFlow.robot b/csit/libraries/ClusterOpenFlow.robot index 1a0460d591..ede359edd8 100644 --- a/csit/libraries/ClusterOpenFlow.robot +++ b/csit/libraries/ClusterOpenFlow.robot @@ -308,9 +308,11 @@ Check Linear Topology On Member [Documentation] Check Linear topology. [Arguments] ${switches} ${member_index}=1 ${session}= Resolve_Http_Session_For_Member member_index=${member_index} - ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_TOPO_API} + ${resp}= RequestsLibrary.GET On Session + ... ${session} + ... url=${RFC8040_OPERATIONAL_TOPO_API} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 FOR ${switch} IN RANGE 1 ${switches+1} Should Contain ${resp.text} "node-id":"openflow:${switch}" Should Contain ${resp.text} "tp-id":"openflow:${switch}:1" @@ -333,9 +335,11 @@ Check No Switches On Member [Documentation] Check no switch is in topology [Arguments] ${switches} ${member_index}=1 ${session}= Resolve_Http_Session_For_Member member_index=${member_index} - ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_TOPO_API} + ${resp}= RequestsLibrary.GET On Session + ... ${session} + ... url=${RFC8040_OPERATIONAL_TOPO_API} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 FOR ${switch} IN RANGE 1 ${switches+1} Should Not Contain ${resp.text} openflow:${switch} END @@ -344,9 +348,11 @@ Check Number Of Flows On Member [Documentation] Check number of flows in the inventory. [Arguments] ${flows} ${member_index}=1 ${session}= Resolve_Http_Session_For_Member member_index=${member_index} - ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_NODES_API} + ${resp}= RequestsLibrary.GET On Session + ... ${session} + ... url=${RFC8040_OPERATIONAL_NODES_API} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${count}= Get Count ${resp.text} "priority" Should Be Equal As Integers ${count} ${flows} @@ -354,8 +360,10 @@ Check Number Of Groups On Member [Documentation] Check number of groups in the inventory. [Arguments] ${groups} ${member_index}=1 ${session}= Resolve_Http_Session_For_Member member_index=${member_index} - ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_NODES_API} + ${resp}= RequestsLibrary.GET On Session + ... ${session} + ... url=${RFC8040_OPERATIONAL_NODES_API} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${group_count}= Get Count ${resp.text} "group-type" Should Be Equal As Integers ${group_count} ${groups} diff --git a/csit/libraries/DataModels.robot b/csit/libraries/DataModels.robot index 3b8994a1c9..69e4c6a1cb 100644 --- a/csit/libraries/DataModels.robot +++ b/csit/libraries/DataModels.robot @@ -3,6 +3,7 @@ Documentation Library to deal with mdsal data models. Initially, as a comm ... debug a list of data models. Library RequestsLibrary +Resource Utils.robot *** Variables *** @@ -14,7 +15,7 @@ ${INTEGRATION_BRIDGE} br-int *** Keywords *** Get Model Dump [Documentation] Will output a list of mdsal models using ${data_models} list - [Arguments] ${controller_ip} ${data_models}=@{internal_data_models} ${restconf_root}=restconf + [Arguments] ${controller_ip} ${data_models}=@{internal_data_models} ${restconf_root}=rests # while feature request in bug 7892 is not done, we will quickly timeout and not retry the model dump get # request. This is because when it's done in a failed cluster state, it could take 20s for the reesponse to # to come back as the internal clustering times out waiting for a leader which will not come. When bug 7892 @@ -28,15 +29,14 @@ Get Model Dump ... timeout=1 ... max_retries=0 FOR ${model} IN @{data_models} - ${resp}= RequestsLibrary.Get Request model_dump_session ${restconf_root}/${model} - ${pretty_output}= To Json ${resp.text} pretty_print=True - Log ${pretty_output} + ${resp}= RequestsLibrary.GET On Session model_dump_session url=${restconf_root}/${model} + Utils.Log Content ${resp.text} END Verify No Ingress Dispatcher Non-Default Flow Entries [Documentation] Verify the ingress dispatcher table has no non-default flows after neutron was cleaned up [Arguments] ${ovs_ip} - ${flow_output}= Run Command On Remote System + ${flow_output}= Utils.Run Command On Remote System ... ${ovs_ip} ... sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE} table=${DISPATCHER_TABLE} | grep -v "priority=0" Log ${flow_output} diff --git a/csit/libraries/FlowLib.robot b/csit/libraries/FlowLib.robot index 18c163e2f0..d58f9bc8c0 100644 --- a/csit/libraries/FlowLib.robot +++ b/csit/libraries/FlowLib.robot @@ -4,14 +4,16 @@ Documentation Keywords used to create/modify flow objects. The object is d ... cookie and barrier fields, string formatted xml that can be used to push to ... controller). TODO: Remove hard dependency on controller HTTP "session". -Library XML -Library String +Library OperatingSystem Library RequestsLibrary -Library ScaleClient.py +Library String +Library XML +Library Common.py Library FlowLib.py +Library ScaleClient.py Library XmlComparator.py -Library Common.py Resource CompareStream.robot +Resource TemplatedRequests.robot Resource ../variables/openflowplugin/Variables.robot Variables ../variables/Variables.py @@ -20,7 +22,10 @@ Variables ../variables/Variables.py Check No Switches In Inventory [Documentation] Check no switch is in inventory [Arguments] ${switches} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API} + ${resp}= RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_OPERATIONAL_NODES_API} + ... expected_status=200 Log ${resp.text} FOR ${switch} IN RANGE 1 ${switches+1} Should Not Contain ${resp.text} "openflow:${switch}" @@ -29,9 +34,8 @@ Check No Switches In Inventory Check No Switches In Topology [Documentation] Check no switch is in topology [Arguments] ${switches} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} + ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 FOR ${switch} IN RANGE 1 ${switches+1} Should Not Contain ${resp.text} openflow:${switch} END @@ -40,9 +44,11 @@ Check Switches In Inventory [Documentation] Check all switches and stats in operational inventory [Arguments] ${switches} FOR ${switch} IN RANGE 1 ${switches+1} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch} + ${resp}= RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.text} flow-capable-node-connector-statistics Should Contain ${resp.text} flow-table-statistics END @@ -50,27 +56,24 @@ Check Switches In Inventory Check Switches In Topology [Documentation] Check switches are in the topology. [Arguments] ${switches} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} + ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${count}= Get Count ${resp.text} "node-id":"openflow: BuiltIn.Should Be Equal As Numbers ${count} ${switches} Check Number Of Links [Documentation] Check number of links in the topolgy. [Arguments] ${links} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} + ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${count}= Get Count ${resp.text} "link-id":"openflow: Should Be Equal As Integers ${count} ${links} Check Linear Topology [Documentation] Check Linear topology. [Arguments] ${switches} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} + ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 FOR ${switch} IN RANGE 1 ${switches+1} Should Contain ${resp.text} "node-id":"openflow:${switch}" Should Contain ${resp.text} "tp-id":"openflow:${switch}:1" @@ -98,44 +101,46 @@ Check Flows Operational Datastore Check Number Of Flows [Documentation] Check number of flows in the inventory. [Arguments] ${flows} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API} + ${resp}= RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_OPERATIONAL_NODES_API} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${count}= Get Count ${resp.text} "priority" Should Be Equal As Integers ${count} ${flows} Check Number Of Groups [Documentation] Check number of groups in the inventory. [Arguments] ${groups} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API} + ${resp}= RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_OPERATIONAL_NODES_API} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${group_count}= Get Count ${resp.text} "group-type" Should Be Equal As Integers ${group_count} ${groups} Check Flow Stats Are Available [Documentation] A GET on the /node=${node_id} inventory API is made and flow stats string is checked for existence. [Arguments] ${node_id} ${flows} - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=2 + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=2 + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain X Times ${resp.text} priority ${flows} Check Number Of Hosts [Documentation] Check number of hosts in topology [Arguments] ${hosts} - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} + ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${count}= Get Count ${resp.text} "node-id":"host: Should Be Equal As Integers ${count} ${hosts} Check No Hosts [Documentation] Check if all hosts are deleted from inventory - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} - Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200 Should Not Contain ${resp.text} "node-id":"host: Add Table Miss Flows @@ -298,37 +303,35 @@ Remove Flow XML Element Add Group To Controller And Verify [Documentation] Push group through REST-API and verify in data-store [Arguments] ${group_body} ${node_id} ${group_id} - ${resp}= RequestsLibrary.Put Request + ${resp}= RequestsLibrary.PUT On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id} + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id} ... headers=${HEADERS_XML} ... data=${group_body} Log ${resp.text} - BuiltIn.Should_Match "${resp.status_code}" "20?" - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config ... headers=${ACCEPT_XML} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Compare Xml ${group_body} ${resp.text} Add Flow To Controller And Verify [Documentation] Push flow through REST-API and verify in data-store [Arguments] ${flow_body} ${node_id} ${table_id} ${flow_id} - ${resp}= RequestsLibrary.Put Request + ${resp}= RequestsLibrary.PUT On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} ... headers=${HEADERS_XML} ... data=${flow_body} Log ${resp.text} - BuiltIn.Should_Match "${resp.status_code}" "20?" - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config ... headers=${ACCEPT_XML} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Compare Xml ${flow_body} ${resp.text} Verify Flow On Mininet Switch @@ -344,14 +347,15 @@ Verify Flow On Mininet Switch Remove Group From Controller And Verify [Documentation] Remove group and verify [Arguments] ${node_id} ${group_id} - ${resp}= RequestsLibrary.Delete Request + ${resp}= RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id} + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id} + ... expected_status=204 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 204 - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.Get On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config + ... expected_status=anything IF ${resp.status_code} == 404 or ${resp.status_code} == 409 RETURN Builtin.Log ${resp.text} Builtin.Fail The request failed with code ${resp.status_code} @@ -359,14 +363,15 @@ Remove Group From Controller And Verify Remove Flow From Controller And Verify [Documentation] Remove flow and verify [Arguments] ${node_id} ${table_id} ${flow_id} - ${resp}= RequestsLibrary.Delete Request + ${resp}= RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... expected_status=204 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 204 - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.Get On Session ... session - ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config + ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config + ... expected_status=anything IF ${resp.status_code} == 404 or ${resp.status_code} == 409 RETURN Builtin.Log ${resp.text} Builtin.Fail The request failed with code ${resp.status_code} @@ -395,14 +400,14 @@ Remove Default Flows write dpctl dump-flows -O OpenFlow13 ${switchoutput}= Read Until > ${headers}= Create Dictionary Content-Type=application/yang-data+xml - ${resp}= RequestsLibrary.Post Request + ${resp}= RequestsLibrary.POST On Session ... session - ... rests/operations/sal-flow:remove-flow + ... url=rests/operations/sal-flow:remove-flow ... data=${flow.xml} ... headers=${headers} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API} + ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_NODES_API} Log ${resp.text} Should Not Contain ${resp.text} "output-node-connector": "CONTROLLER", ${strings_to_check_for}= Create List CONTROLLER @@ -440,10 +445,11 @@ Flow Presence In Config Store ... This keyword assumes that the global/suite variables are available (${table_id}, ${flow_id} and ${switch_idx} [Arguments] ${expvalue} ${headers}= Create Dictionary Accept=application/xml - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.Get On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config ... headers=${headers} + ... expected_status=anything Log ${resp} Log ${resp.text} IF ${resp.status_code}!=200 RETURN ${False} ${EMPTY} @@ -456,10 +462,11 @@ Flow Presence In Operational Store ... This keyword assumes that the global/suite variables are available (${table_id}, ${flow_id} and ${switch_idx} [Arguments] ${expvalue} ${check_id}=${False} ${headers}= Create Dictionary Accept=application/xml - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.Get On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id} + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id} ... headers=${headers} + ... expected_status=anything Log ${resp} Log ${resp.text} IF ${resp.status_code}!=200 RETURN ${False} ${EMPTY} @@ -510,24 +517,23 @@ Add Flow Via RPC Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory Log Element ${req} ${strxml}= Element To String ${req} - ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:add-flow data=${strxml} + ${resp}= RequestsLibrary.POST On Session + ... session + ... url=/rests/operations/sal-flow:add-flow + ... data=${strxml} + ... expected_status=204 Log ${resp.text} - ${expected_status_code}= CompareStream.Set_Variable_If_At_Least_Phosphorus 204 200 - Log ${expected_status_code} - Should Be Equal As Strings ${resp.status_code} ${expected_status_code} Add Flow Via Restconf [Documentation] Configures a flow specified by given flow details (${node_id}, ${table_id}, ${flow_body}) using POST method [Arguments] ${node_id} ${table_id} ${flow_body} Log ${flow_body} - ${resp}= RequestsLibrary.Post Request + ${resp}= RequestsLibrary.POST On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id} + ... url=${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id} ... data=${flow_body} + ... expected_status=201 Log ${resp.text} - ${msg}= Set Variable - ... Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id} failed, http response ${resp.status_code} received. - Should Be Equal As Strings ${resp.status_code} 201 msg=${msg} Update Flow Via RPC [Documentation] Updates a flow by using update-flow operation. ${xmlroot} is usually a variable created by @@ -552,24 +558,23 @@ Update Flow Via RPC Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory Log Element ${xml} ${strxml}= Element To String ${xml} - ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:update-flow data=${strxml} + ${resp}= RequestsLibrary.POST On Session + ... session + ... url=/rests/operations/sal-flow:update-flow + ... data=${strxml} + ... expected_status=204 Log ${resp.text} - ${expected_status_code}= CompareStream.Set_Variable_If_At_Least_Phosphorus 204 200 - Log ${expected_status_code} - Should Be Equal As Strings ${resp.status_code} ${expected_status_code} Update Flow Via Restconf [Documentation] Updates a flow configuration by given flow details (${node_id}, ${table_id}, ${flow_body}) using PUT method [Arguments] ${node_id} ${table_id} ${flow_id} ${flow_body} Log ${flow_body} - ${resp}= RequestsLibrary.Put Request + ${resp}= RequestsLibrary.PUT On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... url=${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} ... data=${flow_body} + ... expected_status=204 Log ${resp.text} - ${msg}= Set Variable - ... Updating flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. - Should Be Equal As Strings ${resp.status_code} 204 msg=${msg} Delete Flow Via RPC [Documentation] Deletes a flow by using remove-flow opearation. ${xmlroot} is usually a variable created by @@ -584,29 +589,28 @@ Delete Flow Via RPC Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory Log Element ${req} ${strxml}= Element To String ${req} - ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:remove-flow data=${strxml} + ${resp}= RequestsLibrary.POST On Session + ... session + ... url=/rests/operations/sal-flow:remove-flow + ... data=${strxml} + ... expected_status=204 Log ${resp.text} - ${expected_status_code}= CompareStream.Set_Variable_If_At_Least_Phosphorus 204 200 - Log ${expected_status_code} - Should Be Equal As Strings ${resp.status_code} ${expected_status_code} Delete Flow Via Restconf [Documentation] Deletes a flow from configuration datastore specified by given flow details (${node_id}, ${table_id}, ${flow_body}) using DELETE method [Arguments] ${node_id} ${table_id} ${flow_id} - ${resp}= RequestsLibrary.Delete Request + ${resp}= RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... url=${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... expected_status=204 Log ${resp.text} - ${msg}= Set Variable - ... Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. - Should Be Equal As Strings ${resp.status_code} 204 msg=${msg} Get Flow Id [Documentation] This verifies specific flow-id for particular table-id matching from the flow element [Arguments] ${dpnid} ${table_id} ${flow_element} - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${dpnid}/flow-node-inventory:table=${table_id}?content=config + ... url=${RFC8040_NODES_API}/node=openflow%3A${dpnid}/flow-node-inventory:table=${table_id}?content=config BuiltIn.Log ${resp.text} @{flow_id}= String.Get Regexp Matches ${resp.text} id\":\"(\\d+${flow_element}) 1 RETURN @{flow_id}[0] diff --git a/csit/libraries/SwitchUtils.robot b/csit/libraries/SwitchUtils.robot index be60c08380..c64f26005a 100644 --- a/csit/libraries/SwitchUtils.robot +++ b/csit/libraries/SwitchUtils.robot @@ -1,4 +1,5 @@ *** Settings *** +Library RequestsLibrary Library SSHLibrary Library Telnet @@ -23,14 +24,14 @@ Get Switch Datapath ID Verify Switch In Operational Data Store [Documentation] Verifies the existence of the switch.datapath_id in the operational datastore. [Arguments] ${switch} - ${resp}= RequestsLibrary.Get Request session ${REST_CONTEXT} + ${resp}= RequestsLibrary.GET On Session session url=${REST_CONTEXT} Log ${resp.text} Should Match Regexp ${resp.text} openflow:${switch.datapath_id} Verify Switch Not In Operational Data Store [Documentation] Verifies that the given switch.datapath_id is not in the operational datastore. [Arguments] ${switch} - ${resp}= RequestsLibrary.Get Request session ${REST_CONTEXT} + ${resp}= RequestsLibrary.GET On Session session url=${REST_CONTEXT} Log ${resp.text} Should Not Match Regexp ${resp.text} openflow:${switch.datapath_id} diff --git a/csit/libraries/Utils.robot b/csit/libraries/Utils.robot index a9e2ae840a..ddcc2f7f98 100644 --- a/csit/libraries/Utils.robot +++ b/csit/libraries/Utils.robot @@ -114,7 +114,9 @@ Check For Specific Number Of Elements At URI Log Content [Arguments] ${resp_content} IF '''${resp_content}''' != '${EMPTY}' - ${resp_json}= RequestsLibrary.To Json ${resp_content} pretty_print=True + ${resp_json}= BuiltIn.Evaluate + ... json.dumps(json.loads('''${resp_content}'''), sort_keys=True, indent=4, separators=(',', ': ')) + ... modules=json ELSE ${resp_json}= BuiltIn.Set Variable ${EMPTY} END @@ -176,7 +178,7 @@ Clean Up Ovs Extract Value From Content [Documentation] Will take the given response content and return the value at the given index as a string [Arguments] ${content} ${index} - ${JSON}= Evaluate json.loads('''${content}''') json + ${JSON}= BuiltIn.Evaluate json.loads('''${content}''') modules=json ${value}= Set Variable ${JSON${index}} RETURN ${value} diff --git a/csit/libraries/WorkflowsOpenFlow.robot b/csit/libraries/WorkflowsOpenFlow.robot index dac5fe89fc..2ad987e5d1 100644 --- a/csit/libraries/WorkflowsOpenFlow.robot +++ b/csit/libraries/WorkflowsOpenFlow.robot @@ -360,6 +360,10 @@ Workflow Setup Workflow Teardown [Documentation] Cleanup when workflow is interrupt - Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + Run Keyword And Ignore Error + ... RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_NODES_API} + ... expected_status=anything Utils.Clean Mininet System RequestsLibrary.Delete All Sessions diff --git a/csit/suites/openflowplugin/Bug_Validation/6917.robot b/csit/suites/openflowplugin/Bug_Validation/6917.robot index 1b6808b391..95ebdce233 100644 --- a/csit/suites/openflowplugin/Bug_Validation/6917.robot +++ b/csit/suites/openflowplugin/Bug_Validation/6917.robot @@ -90,4 +90,4 @@ Add Flow ... ${False} ... ${True} Sleep 8 - [Teardown] BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + [Teardown] BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API} diff --git a/csit/suites/openflowplugin/Bug_Validation/7258.robot b/csit/suites/openflowplugin/Bug_Validation/7258.robot index 7f7d99c8ef..9cd8534587 100644 --- a/csit/suites/openflowplugin/Bug_Validation/7258.robot +++ b/csit/suites/openflowplugin/Bug_Validation/7258.robot @@ -50,6 +50,6 @@ Initialization Phase Final Phase [Documentation] Stops mininet. - BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API} MininetKeywords.Stop Mininet And Exit ${mininet_conn_id} RequestsLibrary.Delete All Sessions diff --git a/csit/suites/openflowplugin/Bug_Validation/7335.robot b/csit/suites/openflowplugin/Bug_Validation/7335.robot index caa34b2842..7642b34935 100644 --- a/csit/suites/openflowplugin/Bug_Validation/7335.robot +++ b/csit/suites/openflowplugin/Bug_Validation/7335.robot @@ -63,6 +63,6 @@ Initialization Phase Final Phase [Documentation] Stops mininet. - BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API} MininetKeywords.Stop Mininet And Exit ${mininet_conn_id} RequestsLibrary.Delete All Sessions diff --git a/csit/suites/openflowplugin/Bug_Validation/7349.robot b/csit/suites/openflowplugin/Bug_Validation/7349.robot index 03507c9376..b8fae2d0d4 100644 --- a/csit/suites/openflowplugin/Bug_Validation/7349.robot +++ b/csit/suites/openflowplugin/Bug_Validation/7349.robot @@ -66,6 +66,6 @@ Initialization Phase Final Phase [Documentation] Stops mininet. - BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API} MininetKeywords.Stop Mininet And Exit ${mininet_conn_id} RequestsLibrary.Delete All Sessions diff --git a/csit/suites/openflowplugin/Bug_Validation/8723.robot b/csit/suites/openflowplugin/Bug_Validation/8723.robot index 31d2a6b0bc..f916e6f4da 100644 --- a/csit/suites/openflowplugin/Bug_Validation/8723.robot +++ b/csit/suites/openflowplugin/Bug_Validation/8723.robot @@ -58,7 +58,7 @@ Initialization Phase Final Phase [Documentation] Stops mininet. - BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API} MininetKeywords.Stop Mininet And Exit ${mininet_conn_id} RequestsLibrary.Delete All Sessions diff --git a/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot b/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot index 72fb547582..07af6fe270 100644 --- a/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot +++ b/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot @@ -93,7 +93,7 @@ Start Suite End Suite [Documentation] Run at end of the suite - RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API} KarafKeywords.Issue_Command_On_Karaf_Console ... log:set INFO org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeReconciliationImpl SSHLibrary.Close All Connections diff --git a/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot b/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot index 3e6fc6b6c3..235be68ac6 100644 --- a/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot +++ b/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot @@ -500,7 +500,7 @@ Final Phase [Documentation] Delete all sessions. ${command}= BuiltIn.Set Variable sudo iptables -v -F BuiltIn.Run Keyword And Ignore Error ClusterManagement.Run_Bash_Command_On_List_Or_All ${command} - BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API} RequestsLibrary.Delete All Sessions Add Groups And Flows On Member @@ -536,15 +536,15 @@ Remove Single Group And Flow On Member [Arguments] ${member_index}=1 ${session}= Resolve_Http_Session_For_Member member_index=${member_index} FOR ${switch} IN RANGE 1 ${switches+1} - RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... ${session} - ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1 - RequestsLibrary.Delete Request + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1 + RequestsLibrary.DELETE On Session ... ${session} - ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1 - RequestsLibrary.Delete Request + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1 + RequestsLibrary.DELETE On Session ... ${session} - ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000 + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000 END Check Flow Stats Are Not Frozen @@ -561,12 +561,12 @@ Extract Flow Duration [Documentation] Extract duration for flow 1 in switch 1. [Arguments] ${member_index} ${session}= Resolve_Http_Session_For_Member member_index=${member_index} - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... ${session} - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=1?content=nonconfig + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=1?content=nonconfig ... headers=${headers} Log ${resp.content} - ${json_resp}= RequestsLibrary.To_Json ${resp.content} + ${json_resp}= Utils.Json Parse From String ${resp.content} ${flow_list}= Collections.Get_From_Dictionary ${json_resp} flow-node-inventory:flow ${flow_stats}= Collections.Get_From_Dictionary ... ${flow_list}[0] diff --git a/csit/suites/openflowplugin/Flows_Additional_TCs/010_Lithium_Rps_Calls_Ovs.robot b/csit/suites/openflowplugin/Flows_Additional_TCs/010_Lithium_Rps_Calls_Ovs.robot index d95b6350f7..5c112e399f 100644 --- a/csit/suites/openflowplugin/Flows_Additional_TCs/010_Lithium_Rps_Calls_Ovs.robot +++ b/csit/suites/openflowplugin/Flows_Additional_TCs/010_Lithium_Rps_Calls_Ovs.robot @@ -20,23 +20,23 @@ ${send_echo_url} /rests/operations/sal-echo:send-echo *** Test Cases *** Sending Barrier [Documentation] Test to send barrier - ${resp}= RequestsLibrary.Post Request + ${resp}= RequestsLibrary.POST On Session ... session - ... ${send_barrier_url} + ... url=${send_barrier_url} ... data=${RPC_SEND_BARRIER_DATA} ... headers=${HEADERS_XML} + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Sending Echo [Documentation] Test to send echo - ${resp}= RequestsLibrary.Post Request + ${resp}= RequestsLibrary.POST On Session ... session - ... ${send_echo_url} + ... url=${send_echo_url} ... data=${RPC_SEND_ECHO_DATA} ... headers=${HEADERS_XML} + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 *** Keywords *** diff --git a/csit/suites/openflowplugin/Flows_Additional_TCs/020_Lithium_Rps_Calls_Cpqd.robot b/csit/suites/openflowplugin/Flows_Additional_TCs/020_Lithium_Rps_Calls_Cpqd.robot index 11ae3dd927..a22d47a2cd 100644 --- a/csit/suites/openflowplugin/Flows_Additional_TCs/020_Lithium_Rps_Calls_Cpqd.robot +++ b/csit/suites/openflowplugin/Flows_Additional_TCs/020_Lithium_Rps_Calls_Cpqd.robot @@ -20,13 +20,13 @@ ${start} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --to *** Test Cases *** Sending Update Table [Documentation] Test to send table update request - ${resp}= RequestsLibrary.Post Request + ${resp}= RequestsLibrary.POST On Session ... session - ... ${send_update_table_url} + ... url=${send_update_table_url} ... data=${RPC_SEND_UPDATE_TABLE_DATA} ... headers=${HEADERS_XML} + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 *** Keywords *** diff --git a/csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot b/csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot index ae400fa848..6342eb8e40 100644 --- a/csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot +++ b/csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot @@ -59,10 +59,8 @@ Final Phase Delete Flow [Documentation] Removes used flow - ${resp}= RequestsLibrary.Delete Request + ${resp}= RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... expected_status=200 Log ${resp.content} - ${msg}= Set Variable - ... Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. - Should Be Equal As Strings ${resp.status_code} 200 msg=${msg} diff --git a/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot b/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot index e7f3bcc9f1..4430b615eb 100644 --- a/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot +++ b/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot @@ -222,10 +222,11 @@ Check Config Flow Presence Flow Presence Config Flow ${headers}= Create Dictionary Accept=application/xml - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} ... headers=${headers} + ... expected_status=anything Log ${resp} Log ${resp.content} IF ${resp.status_code}!=200 RETURN ${False} ${EMPTY} @@ -245,10 +246,11 @@ Check Operational Table Presence Flow Presence Operational Table ${headers}= Create Dictionary Accept=application/xml - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}?${RFC8040_OPERATIONAL_CONTENT} + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}?${RFC8040_OPERATIONAL_CONTENT} ... headers=${headers} + ... expected_status=anything Log ${resp} Log ${resp.content} IF ${resp.status_code}!=200 RETURN ${False} ${EMPTY} @@ -258,22 +260,18 @@ Flow Presence Operational Table Add Flow Log ${data} - ${resp}= RequestsLibrary.Put Request + ${resp}= RequestsLibrary.PUT On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} ... headers=${HEADERS_XML} ... data=${data} - ${msg}= Set Variable - ... Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. - Should Be Equal As Strings ${resp.status_code} 200 msg=${msg} + ... expected_status=200 Delete Flow - ${resp}= RequestsLibrary.Delete Request + ${resp}= RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} - ${msg}= Set Variable - ... Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. - Should Be Equal As Strings ${resp.status_code} 200 msg=${msg} + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} + ... expected_status=200 Delete All Flows [Documentation] Deletes all flows diff --git a/csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot b/csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot index 7a9e154de9..e225af3683 100644 --- a/csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot +++ b/csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot @@ -38,21 +38,20 @@ Add a group [Tags] push ${body} OperatingSystem.Get File ${GROUP} Set Suite Variable ${body} - ${resp} RequestsLibrary.Put Request + ${resp} RequestsLibrary.PUT On Session ... session - ... ${REST_CONTEXT}/flow-node-inventory:group=1 + ... url=${REST_CONTEXT}/flow-node-inventory:group=1 ... headers=${HEADERS_XML} ... data=${body} Log ${resp.content} - BuiltIn.Should_Match "${resp.status_code}" "20?" Verify after adding group config [Documentation] Get the group stat in config - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session ... ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT} + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} ${GROUP_NAME} Verify after adding group operational @@ -71,22 +70,21 @@ Add a flow that includes a group [Tags] push ${body} OperatingSystem.Get File ${FLOW} Set Suite Variable ${body} - ${resp} RequestsLibrary.Put Request + ${resp} RequestsLibrary.PUT On Session ... session - ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1 + ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1 ... headers=${HEADERS_XML} ... data=${body} Log ${resp.content} - BuiltIn.Should_Match "${resp.status_code}" "20?" Verify after adding flow config [Documentation] Verify the flow [Tags] get - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT} + ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT} + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} ${FLOW_NAME} Verify after adding flow operational @@ -101,28 +99,32 @@ Verify after adding flow operational Remove the flow [Documentation] Remove the flow - ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1 - Should Be Equal As Strings ${resp.status_code} 200 + ${resp} RequestsLibrary.DELETE On Session + ... session + ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1 + ... expected_status=200 Verify after deleting flow [Documentation] Verify the flow removal [Tags] get - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT} + ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT} Should Not Contain ${resp.content} ${FLOW_NAME} Delete the group [Documentation] Remove the group [Tags] delete - ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:group=1 + ${resp} RequestsLibrary.DELETE On Session + ... session + ... url=${REST_CONTEXT}/flow-node-inventory:group=1 + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Verify after deleting group [Documentation] Verify the flow removal [Tags] get - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT} + ... url=${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT} Should Not Contain ${resp.content} ${GROUP_NAME} diff --git a/csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot b/csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot index d56e32e484..9b21516ffd 100644 --- a/csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot +++ b/csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot @@ -38,19 +38,20 @@ Add a meter [Tags] push ${body} OperatingSystem.Get File ${METER} Set Suite Variable ${body} - ${resp} RequestsLibrary.Put Request + ${resp} RequestsLibrary.PUT On Session ... session - ... ${REST_CONTEXT}/meter=1 + ... url=${REST_CONTEXT}/meter=1 ... headers=${HEADERS_XML} ... data=${body} Log ${resp.content} - BuiltIn.Should_Match "${resp.status_code}" "20?" Verify after adding meter config [Documentation] Get the meter stat in config - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT} + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} ${METER_NAME} Verify after adding meter operational @@ -69,22 +70,21 @@ Add a flow that includes a meter [Tags] push ${body} OperatingSystem.Get File ${FLOW} Set Suite Variable ${body} - ${resp} RequestsLibrary.Put Request + ${resp} RequestsLibrary.PUT On Session ... session - ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2 + ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=2 ... headers=${HEADERS_XML} ... data=${body} Log ${resp.content} - BuiltIn.Should_Match "${resp.status_code}" "20?" Verify after adding flow config [Documentation] Verify the flow [Tags] get - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT} + ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT} + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} ${FLOW_NAME} Verify after adding flow operational @@ -99,26 +99,27 @@ Verify after adding flow operational Remove the flow [Documentation] Remove the flow - ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2 - Should Be Equal As Strings ${resp.status_code} 200 + ${resp} RequestsLibrary.DELETE On Session + ... session + ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=2 + ... expected_status=200 Verify after deleting flow [Documentation] Verify the flow removal [Tags] get - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT} + ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT} Should Not Contain ${resp.content} ${FLOW_NAME} Delete the meter [Documentation] Remove the meter [Tags] delete - ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/meter=1 + ${resp} RequestsLibrary.DELETE On Session session url=${REST_CONTEXT}/meter=1 expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Verify after deleting meter [Documentation] Verify the flow removal [Tags] get - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT} + ${resp} RequestsLibrary.GET On Session session url=${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT} Should Not Contain ${resp.content} ${METER_NAME} diff --git a/csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot b/csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot index 6956e6ce47..d0146177f6 100644 --- a/csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot +++ b/csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot @@ -22,11 +22,11 @@ Get list of nodes Get nodeconnector for the root node [Documentation] Get the inventory for the root node ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT} + ... url=${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.text} Get nodeconnector for a node @@ -47,8 +47,7 @@ Get Stats for a node *** Keywords *** Check Every Nodes [Arguments] ${numnodes} - ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API} - Should Be Equal As Strings ${resp.status_code} 200 + ${resp} RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_NODES_API} expected_status=200 FOR ${IND} IN RANGE 1 ${numnodes+1} Should Contain ${resp.text} openflow:${IND} END @@ -56,11 +55,11 @@ Check Every Nodes Check Every Nodes Stats [Arguments] ${numnodes} FOR ${IND} IN RANGE 1 ${numnodes+1} - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} + ... url=${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.text} flow-capable-node-connector-statistics Should Contain ${resp.text} flow-table-statistics END @@ -68,11 +67,11 @@ Check Every Nodes Stats Check Every Nodes Nodeconnector [Arguments] ${numnodes} FOR ${IND} IN RANGE 2 ${numnodes+1} - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} + ... url=${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.text} END diff --git a/csit/suites/openflowplugin/Inventory_Scalability_OF10/020__restconf_topology.robot b/csit/suites/openflowplugin/Inventory_Scalability_OF10/020__restconf_topology.robot index 157e736e9e..90ced470cc 100644 --- a/csit/suites/openflowplugin/Inventory_Scalability_OF10/020__restconf_topology.robot +++ b/csit/suites/openflowplugin/Inventory_Scalability_OF10/020__restconf_topology.robot @@ -44,8 +44,11 @@ Get Links Count *** Keywords *** Verify Element Count [Arguments] ${URI} ${xpath_location} ${expected_count} - ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} + ... headers=${ACCEPT_XML} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${count} Get Element Count ${resp.text} xpath=${xpath_location} Should Be Equal As Numbers ${count} ${expected_count} diff --git a/csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot b/csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot index 6956e6ce47..116720e8c9 100644 --- a/csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot +++ b/csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot @@ -22,11 +22,11 @@ Get list of nodes Get nodeconnector for the root node [Documentation] Get the inventory for the root node ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT} + ... url=${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.text} Get nodeconnector for a node @@ -47,8 +47,7 @@ Get Stats for a node *** Keywords *** Check Every Nodes [Arguments] ${numnodes} - ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API} - Should Be Equal As Strings ${resp.status_code} 200 + ${resp} RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_NODES_API} expected_status=200 FOR ${IND} IN RANGE 1 ${numnodes+1} Should Contain ${resp.text} openflow:${IND} END @@ -56,11 +55,11 @@ Check Every Nodes Check Every Nodes Stats [Arguments] ${numnodes} FOR ${IND} IN RANGE 1 ${numnodes+1} - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} + ... url=${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.text} flow-capable-node-connector-statistics Should Contain ${resp.text} flow-table-statistics END @@ -68,11 +67,10 @@ Check Every Nodes Stats Check Every Nodes Nodeconnector [Arguments] ${numnodes} FOR ${IND} IN RANGE 2 ${numnodes+1} - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} + ... url=${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.text} END diff --git a/csit/suites/openflowplugin/Inventory_Scalability_OF13/020__restconf_topology.robot b/csit/suites/openflowplugin/Inventory_Scalability_OF13/020__restconf_topology.robot index 157e736e9e..90ced470cc 100644 --- a/csit/suites/openflowplugin/Inventory_Scalability_OF13/020__restconf_topology.robot +++ b/csit/suites/openflowplugin/Inventory_Scalability_OF13/020__restconf_topology.robot @@ -44,8 +44,11 @@ Get Links Count *** Keywords *** Verify Element Count [Arguments] ${URI} ${xpath_location} ${expected_count} - ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} + ... headers=${ACCEPT_XML} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 ${count} Get Element Count ${resp.text} xpath=${xpath_location} Should Be Equal As Numbers ${count} ${expected_count} diff --git a/csit/suites/openflowplugin/MD_SAL_NSF_OF10/020_restconf_topology.robot b/csit/suites/openflowplugin/MD_SAL_NSF_OF10/020_restconf_topology.robot index 143b7c9ccb..4a47359ae5 100644 --- a/csit/suites/openflowplugin/MD_SAL_NSF_OF10/020_restconf_topology.robot +++ b/csit/suites/openflowplugin/MD_SAL_NSF_OF10/020_restconf_topology.robot @@ -25,7 +25,7 @@ Get RESTCONF Topology ... Check For Elements At URI ... ${RFC8040_OPERATIONAL_TOPO_API} ... ${node_list} - ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} + ${resp} RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} Log ${resp.text} List all the links @@ -98,10 +98,12 @@ Add Port *** Keywords *** Verify Links [Arguments] ${expected_links} - ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${result} To JSON ${resp.text} + ${result} Utils.Json Parse From String ${resp.text} Log ${result} ${content} Get From Dictionary ${result} network-topology:topology ${topology} Get From List ${content} 0 diff --git a/csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot b/csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot index 9e735dde9f..dfbab85e3c 100644 --- a/csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot +++ b/csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot @@ -20,19 +20,18 @@ ${BODY2} *** Test Cases *** Add a flow - Output to physical port# [Documentation] Push a flow through REST-API - ${resp} RequestsLibrary.Put Request + ${resp} RequestsLibrary.PUT On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152 ... headers=${HEADERS_XML} ... data=${BODY2} - BuiltIn.Should_Match "${resp.status_code}" "20?" Verify after adding flow config - Output to physical port# [Documentation] Verify the flow - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config - Should Be Equal As Strings ${resp.status_code} 200 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config + ... expected_status=200 Should Contain ${resp.text} 152 Verify after adding flow operational - Output to physical port# @@ -47,17 +46,17 @@ Verify after adding flow operational - Output to physical port# Remove a flow - Output to physical port# [Documentation] Remove a flow - ${resp} RequestsLibrary.Delete Request + ${resp} RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152 - Should Be Equal As Strings ${resp.status_code} 204 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152 + ... expected_status=204 Verify after deleting flow config - Output to physical port# [Documentation] Verify the flow - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config - Should Be Equal As Strings ${resp.status_code} 200 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config + ... expected_status=200 Should Not Contain ${resp.text} 152 # Standing bug #368 - This has been fixed diff --git a/csit/suites/openflowplugin/MD_SAL_NSF_OF13/020_restconf_topology.robot b/csit/suites/openflowplugin/MD_SAL_NSF_OF13/020_restconf_topology.robot index 129e642990..b6334ed9b2 100644 --- a/csit/suites/openflowplugin/MD_SAL_NSF_OF13/020_restconf_topology.robot +++ b/csit/suites/openflowplugin/MD_SAL_NSF_OF13/020_restconf_topology.robot @@ -25,7 +25,7 @@ Get RESTCONF Topology ... Check For Elements At URI ... ${RFC8040_OPERATIONAL_TOPO_API} ... ${node_list} - ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} + ${resp} RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} Log ${resp.text} List all the links @@ -98,10 +98,12 @@ Add Port *** Keywords *** Verify Links [Arguments] ${expected_links} - ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} + ... expected_status=200 Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${result} To JSON ${resp.text} + ${result} Utils.Json Parse From String ${resp.text} Log ${result} ${content} Get From Dictionary ${result} network-topology:topology ${topology} Get From List ${content} 0 diff --git a/csit/suites/openflowplugin/MD_SAL_NSF_OF13/040_restconf_frm.robot b/csit/suites/openflowplugin/MD_SAL_NSF_OF13/040_restconf_frm.robot index 1080e741e1..f33538f448 100644 --- a/csit/suites/openflowplugin/MD_SAL_NSF_OF13/040_restconf_frm.robot +++ b/csit/suites/openflowplugin/MD_SAL_NSF_OF13/040_restconf_frm.robot @@ -22,19 +22,18 @@ ${BODY2} *** Test Cases *** Add a flow - Sending IPv4 Dest Address and Eth type [Documentation] Push a flow through REST-API - ${resp} RequestsLibrary.Put Request + ${resp} RequestsLibrary.PUT On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139 ... headers=${HEADERS_XML} ... data=${BODY1} - BuiltIn.Should_Match "${resp.status_code}" "20?" Verify after adding flow config - Sending IPv4 Dest Address and Eth type [Documentation] Verify the flow - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config - Should Be Equal As Strings ${resp.status_code} 200 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config + ... expected_status=200 Should Contain ${resp.text} 139 Verify after adding flow operational - Sending IPv4 Dest Address and Eth type @@ -49,19 +48,19 @@ Verify after adding flow operational - Sending IPv4 Dest Address and Eth type Modify a flow - Output to physical port# [Documentation] Push a flow through REST-API - ${resp} RequestsLibrary.Put Request + ${resp} RequestsLibrary.PUT On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139 ... headers=${HEADERS_XML} ... data=${BODY2} - Should Be Equal As Strings ${resp.status_code} 204 + ... expected_status=204 Verify after modifying flow config - Output to physical port# [Documentation] Verify the flow - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config - Should Be Equal As Strings ${resp.status_code} 200 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config + ... expected_status=200 Should Contain ${resp.text} 10.0.20.1 Verify after modifying flow operational - Output to physical port# @@ -76,17 +75,17 @@ Verify after modifying flow operational - Output to physical port# Remove a flow - Output to physical port# [Documentation] Remove a flow - ${resp} RequestsLibrary.Delete Request + ${resp} RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139 - Should Be Equal As Strings ${resp.status_code} 204 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139 + ... expected_status=204 Verify after deleting flow config - Output to physical port# [Documentation] Verify the flow - ${resp} RequestsLibrary.Get Request + ${resp} RequestsLibrary.GET On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config - Should Be Equal As Strings ${resp.status_code} 200 + ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config + ... expected_status=200 Should Not Contain ${resp.text} 139 Verify after deleting flow operational - Output to physical port# diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/010_Rest_Config_Flows.robot b/csit/suites/openflowplugin/Performance_Flow_Config/010_Rest_Config_Flows.robot index bd5032e2a3..d095b03110 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/010_Rest_Config_Flows.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/010_Rest_Config_Flows.robot @@ -56,9 +56,9 @@ Start Http Session Are Switches Connected [Documentation] Checks Topology Contains a fix number ${switches} of switces. [Arguments] ${switches} - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... tcsession - ... ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} + ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} ... headers=${ACCEPT_XML} Log ${resp.content} ${count}= XML.Get Element Count ${resp.content} xpath=node diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/020_Stats_Collection_Gauss.robot b/csit/suites/openflowplugin/Performance_Flow_Config/020_Stats_Collection_Gauss.robot index 9a28988358..ac447ccfe2 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/020_Stats_Collection_Gauss.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/020_Stats_Collection_Gauss.robot @@ -71,7 +71,7 @@ Stop Switches Are Switches Connected Topo [Documentation] Checks wheather switches are connected to controller - ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} Log ${resp.content} ${count}= Get Element Count ${resp.content} xpath=node Should Be Equal As Numbers ${count} ${swnr} diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/030_Stats_Collection_Linear.robot b/csit/suites/openflowplugin/Performance_Flow_Config/030_Stats_Collection_Linear.robot index ab77cd3915..b8947ed080 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/030_Stats_Collection_Linear.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/030_Stats_Collection_Linear.robot @@ -71,7 +71,7 @@ Stop Switches Are Switches Connected Topo [Documentation] Checks wheather switches are connected to controller - ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} Log ${resp.content} ${count}= Get Element Count ${resp.content} xpath=node Should Be Equal As Numbers ${count} ${swnr} diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/040_Stats_Collection_One.robot b/csit/suites/openflowplugin/Performance_Flow_Config/040_Stats_Collection_One.robot index 86961c60a4..03b57c6279 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/040_Stats_Collection_One.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/040_Stats_Collection_One.robot @@ -71,7 +71,7 @@ Stop Switches Are Switches Connected Topo [Documentation] Checks wheather switches are connected to controller - ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} Log ${resp.content} ${count}= Get Element Count ${resp.content} xpath=node Should Be Equal As Numbers ${count} ${swnr} diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/050_Stats_Collection_FirstTable.robot b/csit/suites/openflowplugin/Performance_Flow_Config/050_Stats_Collection_FirstTable.robot index 862b8e1ecf..c7445d35f5 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/050_Stats_Collection_FirstTable.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/050_Stats_Collection_FirstTable.robot @@ -71,7 +71,7 @@ Stop Switches Are Switches Connected Topo [Documentation] Checks wheather switches are connected to controller - ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} Log ${resp.content} ${count}= Get Element Count ${resp.content} xpath=node Should Be Equal As Numbers ${count} ${swnr} diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/060_Stats_Collection_Basic16kScenario.robot b/csit/suites/openflowplugin/Performance_Flow_Config/060_Stats_Collection_Basic16kScenario.robot index e8567aae71..3bd4e15766 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/060_Stats_Collection_Basic16kScenario.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/060_Stats_Collection_Basic16kScenario.robot @@ -122,7 +122,7 @@ Delete Http Session Are Switches Connected Topo [Documentation] Checks wheather switches are connected to controller - ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} Log ${resp.content} ${count}= Get Element Count ${resp.content} xpath=node Should Be Equal As Numbers ${count} ${swnr} @@ -133,6 +133,6 @@ Check Flows Inventory Should Be True ${res} Check No Switches Inventory - ${resp}= Get Request session ${RFC8040_OPERATIONAL_NODES_API} + ${resp}= GET On Session session ${RFC8040_OPERATIONAL_NODES_API} Log ${resp.content} Should Be Equal As Strings '${resp.content}' '{"nodes":{}}' diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/070_Stats_Collection_100k_WithMininetRestart.robot b/csit/suites/openflowplugin/Performance_Flow_Config/070_Stats_Collection_100k_WithMininetRestart.robot index bcfd60119d..8a6335f4c0 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/070_Stats_Collection_100k_WithMininetRestart.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/070_Stats_Collection_100k_WithMininetRestart.robot @@ -92,8 +92,7 @@ Check Flows Are Operational Again Deconfigure Flows [Documentation] Flows deconfiguration - ${resp}= Delete Request session ${RFC8040_NODES_API} - Should Be Equal As Numbers ${resp.status_code} 204 + ${resp}= DELETE On Session session url=${RFC8040_NODES_API} expected_status=204 Check No Flows In Operational Last [Documentation] Operational datastore to be without any flows @@ -146,7 +145,7 @@ Delete Http Session And Store Plot Data Are Switches Connected Topo [Documentation] Checks wheather switches are connected to controller - ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} Log ${resp.content} ${count}= Get Element Count ${resp.content} xpath=node Should Be Equal As Numbers ${count} ${swnr} diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/080_Rpc_100k_Flows_Configuration_Time_Measure.robot b/csit/suites/openflowplugin/Performance_Flow_Config/080_Rpc_100k_Flows_Configuration_Time_Measure.robot index c980e41a9c..97a9163e1d 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/080_Rpc_100k_Flows_Configuration_Time_Measure.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/080_Rpc_100k_Flows_Configuration_Time_Measure.robot @@ -118,7 +118,7 @@ Delete Http Session And Store Plot Data Are Switches Connected Topo [Documentation] Checks wheather switches are connected to controller - ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} + ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML} Log ${resp.content} ${count}= Get Element Count ${resp.content} xpath=node Should Be Equal As Numbers ${count} ${swnr} diff --git a/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot b/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot index 69eaa53a59..9cc2df1b88 100644 --- a/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot +++ b/csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot @@ -117,7 +117,7 @@ Delete Http Session And Store Plot Data Are Switches Connected Topo [Documentation] Checks wheather switches are connected to controller - ${resp}= Get Request session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML} + ${resp}= GET On Session session url=${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML} Log ${resp.content} ${count}= Get Element Count ${resp.content} xpath=node Should Be Equal As Numbers ${count} ${swnr} diff --git a/csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot b/csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot index 3329a39e4b..8b019d6db4 100644 --- a/csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot +++ b/csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot @@ -93,15 +93,15 @@ Check Linear Topology After Mininet Reconnects Remove Flows And Groups After Mininet Reconnects [Documentation] Remove some groups and flows while network is down. FOR ${switch} IN RANGE 1 ${switches+1} - RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1 - RequestsLibrary.Delete Request + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1 + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1 - RequestsLibrary.Delete Request + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1 + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000 + ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000 END Check Flows In Operational DS After Mininet Reconnects @@ -176,7 +176,7 @@ Final Phase [Documentation] Delete all sessions. ${command} BuiltIn.Set Variable sudo iptables -v -F Utils.Run Command On Controller cmd=${command} - BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API} + BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API} RequestsLibrary.Delete All Sessions Disconnect Controller Mininet -- 2.36.6 From a2f6aa23e240c9a70eef3d44b76c42147acbb2ca Mon Sep 17 00:00:00 2001 From: Yaroslav Lastivka Date: Thu, 28 Mar 2024 00:30:56 +0200 Subject: [PATCH 10/16] Migrate request invocations (ovsdb) The '* Request' and 'To Json' RequestsLibrary keywords have been deprecated. Replace '* Request' keywords with '* On Session'. 'OVSDB.Log Request' is a duplicate of 'Utils.Log Content' - replace the former with the latter. 'To Json', when pretty_print is false, is replaced with 'Utils.Json Parse from String'. JIRA: INTTEST-141 Change-Id: Ia0b98e5f68de460d363464372b59ef0c209c52af Signed-off-by: Yaroslav Lastivka Signed-off-by: Sangwook Ha --- csit/libraries/OVSDB.robot | 95 ++++++++++--------- .../010__configure_1_ovsdb_node.robot | 71 ++++++++------ .../020__connection_manager.robot | 26 +++-- .../030__configure_exit_ovsdb_node.robot | 24 +++-- .../040__Vxlan_Extension_Test.robot | 1 - .../Southbound_Domain/Bug_Validation.robot | 71 ++++++++------ 6 files changed, 162 insertions(+), 126 deletions(-) diff --git a/csit/libraries/OVSDB.robot b/csit/libraries/OVSDB.robot index 5c24845d77..a50a4aacf3 100644 --- a/csit/libraries/OVSDB.robot +++ b/csit/libraries/OVSDB.robot @@ -21,16 +21,6 @@ ${DEFAULT_PING_COUNT} 3 *** Keywords *** -Log Request - [Arguments] ${resp_content} - IF '''${resp_content}''' != '${EMPTY}' - ${resp_json} = RequestsLibrary.To Json ${resp_content} pretty_print=True - ELSE - ${resp_json} = BuiltIn.Set Variable ${EMPTY} - END - BuiltIn.Log ${resp_json} - RETURN ${resp_json} - Create OVSDB Node [Arguments] ${node_ip} ${port}=${OVSDB_NODE_PORT} ${body} = OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_node.json @@ -39,8 +29,8 @@ Create OVSDB Node ${uri} = Builtin.Set Variable ${RFC8040_TOPO_OVSDB1_API} BuiltIn.Log URI is ${uri} BuiltIn.Log data: ${body} - ${resp} = RequestsLibrary.Post Request session ${uri} data=${body} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.POST On Session session url=${uri} data=${body} expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Connect To Ovsdb Node @@ -52,15 +42,17 @@ Connect To Ovsdb Node ${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_API}${node_ip}%3A${port} BuiltIn.Log URI is ${uri} BuiltIn.Log data: ${body} - ${resp} = RequestsLibrary.Put Request session ${uri} data=${body} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Disconnect From Ovsdb Node [Documentation] This request will disconnect the OVSDB node from the controller [Arguments] ${node_ip} ${port}=${OVSDB_NODE_PORT} - ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}${node_ip}%3A${port} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + ${resp} = RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_API}${node_ip}%3A${port} + ... expected_status=204 Add Bridge To Ovsdb Node [Documentation] This will create a bridge and add it to the OVSDB node. @@ -76,17 +68,17 @@ Add Bridge To Ovsdb Node ${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_API}${node_id_}%2Fbridge%2F${bridge} BuiltIn.Log URI is ${uri} BuiltIn.Log data: ${body} - ${resp} = RequestsLibrary.Put Request session ${uri} data=${body} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Delete Bridge From Ovsdb Node [Documentation] This request will delete the bridge node from the OVSDB [Arguments] ${node_id} ${bridge} - ${resp} = RequestsLibrary.Delete Request + ${resp} = RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_API}${node_id}%2Fbridge%2F${bridge} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + ... url=${RFC8040_SOUTHBOUND_NODE_API}${node_id}%2Fbridge%2F${bridge} + ... expected_status=204 Add Termination Point [Documentation] Using the json data body file as a template, a REST config request is made to @@ -98,7 +90,11 @@ Add Termination Point ${body} = String.Replace String ${body} vxlanport ${tp_name} ${node_id_} = BuiltIn.Evaluate """${node_id}""".replace("/","%2F").replace(":","%3A") ${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_API}${node_id_}%2Fbridge%2F${bridge} - ${resp} = RequestsLibrary.Put Request session ${uri}/termination-point=${tp_name} data=${body} + ${resp} = RequestsLibrary.PUT On Session + ... session + ... url=${uri}/termination-point=${tp_name} + ... data=${body} + ... expected_status=anything BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Add Vxlan To Bridge @@ -133,10 +129,12 @@ Get OVSDB UUID ... node-id stripped of "ovsdb://uuid/". If not found, ${EMPTY} will be returned. [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_http_session}=session ${uuid} = Set Variable ${EMPTY} - ${resp} = RequestsLibrary.Get Request ${controller_http_session} ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 - ${resp_json} = RequestsLibrary.To Json ${resp.text} + ${resp} = RequestsLibrary.GET On Session + ... ${controller_http_session} + ... url=${RFC8040_OPERATIONAL_TOPO_OVSDB1_API} + ... expected_status=200 + Utils.Log Content ${resp.text} + ${resp_json} = Utils.Json Parse From String ${resp.text} ${topologies} = Collections.Get From Dictionary ${resp_json} network-topology:topology ${topology} = Collections.Get From List ${topologies} 0 ${node_list} = Collections.Get From Dictionary ${topology} node @@ -281,16 +279,22 @@ Get Port Metadata Log Config And Operational Topology [Documentation] For debugging purposes, this will log both config and operational topo data stores - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - ${resp} = RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_CONFIG_TOPO_API} + ... expected_status=anything + Utils.Log Content ${resp.text} + ${resp} = RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_OPERATIONAL_TOPO_API} + ... expected_status=anything + Utils.Log Content ${resp.text} Config and Operational Topology Should Be Empty [Documentation] This will check that only the expected output is there for both operational and config ... topology data stores. Empty probably means that only ovsdb:1 is there. - ${config_resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - ${operational_resp} = RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API} + ${config_resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} + ${operational_resp} = RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} BuiltIn.Should Contain ${config_resp.text} {"topology-id":"ovsdb:1"} BuiltIn.Should Contain ${operational_resp.text} {"topology-id":"ovsdb:1"} @@ -311,8 +315,8 @@ Modify Multi Port Body ${uri} = Builtin.Set Variable ${RFC8040_TOPO_API} BuiltIn.Log URI is ${uri} BuiltIn.Log data: ${body} - ${resp} = RequestsLibrary.Put Request session ${uri} data=${body} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} RETURN ${body} @@ -323,8 +327,8 @@ Create Qos ${body} = Replace String ${body} QOS-1 ${qos} BuiltIn.Log URI is ${uri} BuiltIn.Log data: ${body} - ${resp} = RequestsLibrary.Put Request session ${uri} data=${body} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Create Queue @@ -334,8 +338,8 @@ Create Queue ${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${queue} BuiltIn.Log URI is ${uri} BuiltIn.Log data: ${body} - ${resp} = RequestsLibrary.Put Request session ${uri} data=${body} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Update Qos @@ -344,14 +348,18 @@ Update Qos ${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS} BuiltIn.Log URL is ${uri} BuiltIn.Log data: ${body} - ${resp} = RequestsLibrary.Put Request session ${uri} data=${body} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Create Qos Linked Queue ${body} = OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/bug_7160/create_qoslinkedqueue.json - ${resp} = RequestsLibrary.Put Request session ${RFC8040_SOUTHBOUND_NODE_HOST1_API} data=${body} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.PUT On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API} + ... data=${body} + ... expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Add OVS Logging @@ -401,9 +409,8 @@ Suite Teardown [Arguments] ${uris}=@{EMPTY} OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP} FOR ${uri} IN @{uris} - RequestsLibrary.Delete Request session ${uri} + RequestsLibrary.DELETE On Session session url=${uri} expected_status=anything END - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} OVSDB.Log Config And Operational Topology RequestsLibrary.Delete All Sessions diff --git a/csit/suites/ovsdb/Southbound_Domain/010__configure_1_ovsdb_node.robot b/csit/suites/ovsdb/Southbound_Domain/010__configure_1_ovsdb_node.robot index 4067abaa91..1f3be3d216 100644 --- a/csit/suites/ovsdb/Southbound_Domain/010__configure_1_ovsdb_node.robot +++ b/csit/suites/ovsdb/Southbound_Domain/010__configure_1_ovsdb_node.robot @@ -54,9 +54,8 @@ Create a Bridge Get Config Topology with Bridge [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200 + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${resp.text} ${BRIDGE} Get Operational Topology with Bridge @@ -87,10 +86,10 @@ Get Operational Topology with Port Delete the Port [Documentation] This request will delete the port node from the bridge node and data store. - ${resp} = RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT} + ... expected_status=204 Get Operational Topology after Deletion of Port [Documentation] This request will fetch the operational topology after the Port is deleted @@ -105,8 +104,10 @@ Get Operational Topology after Deletion of Port Delete the Bridge [Documentation] This request will delete the bridge node from the config data store. - ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE} + ... expected_status=204 Get Operational Topology after Deletion of Bridge [Documentation] This request will fetch the operational topology after the Bridge is deleted @@ -121,9 +122,8 @@ Get Operational Topology after Deletion of Bridge Verify Config Still Has OVS Info [Documentation] This will fetch the configuration topology from configuration data store to verify the node is still in the data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200 + Utils.Log Content ${resp.text} BuiltIn.Wait Until Keyword Succeeds ... 8s ... 2s @@ -134,8 +134,7 @@ Verify Config Still Has OVS Info Delete the OVSDB Node [Documentation] This request will delete the OVSDB node - ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API} expected_status=204 Get Operational Topology to make sure the connection has been deleted [Documentation] This request will fetch the operational topology from the connected OVSDB nodes @@ -175,9 +174,8 @@ Get Operational Topology After Node Reconnect Get Config Topology After Reconnect [Documentation] This will fetch the configuration topology from configuration data store after reconnect - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200 + Utils.Log Content ${resp.text} BuiltIn.Wait Until Keyword Succeeds ... 8s ... 2s @@ -208,8 +206,11 @@ Update QOS with a Linked queue entry to a OVSDB Node Get QOS Config Topology with port [Documentation] This will fetch the configuration topology from configuration data store to verify the QOS is added to the data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_CONFIG_TOPO_API} + ... expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} BuiltIn.Should Contain ${resp.text} ${QOS} @@ -226,8 +227,11 @@ Get QOS Operational Topology with port Get Queue Config Topology with port [Documentation] This request will fetch the configuration topology from configuration data store to verify the Queue is added to the data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_CONFIG_TOPO_API} + ... expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} BuiltIn.Should Contain ${resp.text} ${QUEUE} @@ -244,34 +248,43 @@ Get Queue Operational Topology with port Delete a Queue entry from a Qos entry [Documentation] This request will Delete a Queue entry from a Qos entry - ${resp} = RequestsLibrary.Delete Request + ${resp} = RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}/queue-list=0 + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}/queue-list=0 + ... expected_status=anything BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Delete a QoS entry from a node [Documentation] This request will Delete a QoS entry from a node. - ${resp} = RequestsLibrary.Delete Request + ${resp} = RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS} + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS} + ... expected_status=anything BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Delete a Queue entry from an ovsdb node [Documentation] This request will Delete a Queue entry from an ovsdb node - ${resp} = RequestsLibrary.Delete Request + ${resp} = RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${QUEUE} + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${QUEUE} + ... expected_status=anything BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Delete the OVSDB Node HOST1 [Documentation] This request will delete the OVSDB node - ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_HOST1_API} + ${resp} = RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API} + ... expected_status=anything BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Get Config Topology to verify that deleted configurations are cleaned from config datastore [Documentation] This request will fetch the configuration topology from configuration data store to verify OVSDB NODE is deleted frrom the configuration data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} + ${resp} = RequestsLibrary.GET On Session + ... session + ... url=${RFC8040_CONFIG_TOPO_API} + ... expected_status=anything + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} BuiltIn.Should Not Contain ${resp.text} ovsdb:HOST1 diff --git a/csit/suites/ovsdb/Southbound_Domain/020__connection_manager.robot b/csit/suites/ovsdb/Southbound_Domain/020__connection_manager.robot index 04de1db840..dd737adae1 100644 --- a/csit/suites/ovsdb/Southbound_Domain/020__connection_manager.robot +++ b/csit/suites/ovsdb/Southbound_Domain/020__connection_manager.robot @@ -61,9 +61,8 @@ Get Operational Topology to verify the bridge has been added Get Config Topology to verify the manually added bridge is not added to the config datastore [Documentation] This request will fetch the configuration topology from configuration data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200 + Utils.Log Content ${resp.text} BuiltIn.Should Not Contain ${resp.text} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}/bridge/${BRIDGE1} Create a Bridge through controller @@ -83,9 +82,8 @@ Get Operational Topology to verify the bridge has been added through rest call Get Config Topology to verify the entry added to the config datastore [Documentation] This request will fetch the configuration topology from configuration data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200 + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2} Create bridge of already added bridge @@ -94,9 +92,8 @@ Create bridge of already added bridge Get Config Topology to verify the entry of existing bridge added to the config datastore [Documentation] This request will fetch the configuration topology from configuration data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200 + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE1} Delete bridge manually @@ -115,17 +112,16 @@ Get Operational Topology to verify the bridge has been deleted manually Config Topology Still Contains Bridge [Documentation] This request will fetch the configuration topology from configuration data store - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200 + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2} Delete the Bridge through rest call [Documentation] This request will delete the bridge node from the config data store. - ${resp} = RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2} + ... expected_status=204 Get Operational Topology after Deletion of Bridge [Documentation] This request will fetch the operational topology after the Bridge is deleted diff --git a/csit/suites/ovsdb/Southbound_Domain/030__configure_exit_ovsdb_node.robot b/csit/suites/ovsdb/Southbound_Domain/030__configure_exit_ovsdb_node.robot index ea60bd2b44..36f889ad33 100644 --- a/csit/suites/ovsdb/Southbound_Domain/030__configure_exit_ovsdb_node.robot +++ b/csit/suites/ovsdb/Southbound_Domain/030__configure_exit_ovsdb_node.robot @@ -125,10 +125,10 @@ Get Operational Topology with Port Delete the Port1 [Documentation] This request will delete the port node from the bridge node and data store. - ${resp} = RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT1} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT1} + ... expected_status=204 Get Operational Topology after deletion of Port1 [Documentation] This request will fetch the operational topology after the Port is added to the bridge @@ -143,10 +143,10 @@ Get Operational Topology after deletion of Port1 Delete the Port2 [Documentation] This request will delete the port node from the bridge node and data store. - ${resp} = RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT2} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT2} + ... expected_status=204 Get Operational Topology after Deletion of Port2 [Documentation] This request will fetch the operational topology after the Port is deleted @@ -161,8 +161,10 @@ Get Operational Topology after Deletion of Port2 Delete the Bridge [Documentation] This request will delete the bridge node from the config data store. - ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE} + ... expected_status=204 Get Operational Topology after Deletion of Bridge [Documentation] This request will fetch the operational topology after the Bridge is deleted @@ -177,8 +179,10 @@ Get Operational Topology after Deletion of Bridge Delete the OVSDB Node [Documentation] This request will delete the OVSDB node - ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 204 + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API} + ... expected_status=204 Get Operational Topology after Deletion of OVSDB Node [Documentation] This request will fetch the operational topology after the OVSDB node is deleted diff --git a/csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot b/csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot index cb085c2568..3941296db5 100644 --- a/csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot +++ b/csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot @@ -169,6 +169,5 @@ Suite Teardown [Documentation] Cleans up test environment, close existing sessions. OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP} OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_2_IP} - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} OVSDB.Log Config And Operational Topology RequestsLibrary.Delete All Sessions diff --git a/csit/suites/ovsdb/Southbound_Domain/Bug_Validation.robot b/csit/suites/ovsdb/Southbound_Domain/Bug_Validation.robot index f7e5d07681..7b9fe519b0 100644 --- a/csit/suites/ovsdb/Southbound_Domain/Bug_Validation.robot +++ b/csit/suites/ovsdb/Southbound_Domain/Bug_Validation.robot @@ -66,7 +66,7 @@ Bug 7414 Same Endpoint Name ... ${TOOLS_SYSTEM_2_IP} ... ${TOOLS_SYSTEM_IP} [Teardown] BuiltIn.Run Keywords Test Teardown - ... AND RequestsLibrary.Delete Request session ${RFC8040_TOPO_API} data=${body} + ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_TOPO_API} data=${body} expected_status=anything Bug 7414 Different Endpoint Name [Documentation] This test case is supplemental to the other test case for bug 7414. Even when the other @@ -104,7 +104,7 @@ Bug 7414 Different Endpoint Name ... ${TOOLS_SYSTEM_2_IP} ... ${TOOLS_SYSTEM_IP} [Teardown] BuiltIn.Run Keywords Test Teardown - ... AND RequestsLibrary.Delete Request session ${RFC8040_TOPO_API} data=${body} + ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_TOPO_API} data=${body} expected_status=anything Bug 5221 [Documentation] In the case that an ovs node is rebooted, or the ovs service is @@ -154,8 +154,8 @@ Bug 5221 ... ${list} ... pretty_print_json=True [Teardown] BuiltIn.Run Keywords Test Teardown - ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${bridge} - ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API} + ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${bridge} expected_status=anything + ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API} expected_status=anything Bug 5177 [Documentation] This test case will recreate the bug using the same basic steps as @@ -172,9 +172,8 @@ Bug 5177 BuiltIn.Set Suite Variable ${OVSDB_UUID} ${node} = BuiltIn.Set Variable uuid/${OVSDB_UUID} OVSDB.Add Bridge To Ovsdb Node ${node} ${TOOLS_SYSTEM_IP} ${BRIDGE} 0000000000005177 - ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API} - OVSDB.Log Request ${resp.text} - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200 + Utils.Log Content ${resp.text} BuiltIn.Should Contain ${resp.text} ${node}/bridge/${BRIDGE} Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT} @{list} = BuiltIn.Create List ${BRIDGE} @@ -208,8 +207,8 @@ Bug 4794 ... Shard.*shard-topology-operational An exception occurred while preCommitting transaction # TODO: Bug 5178 [Teardown] BuiltIn.Run Keywords Test Teardown - ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}${node_id}%2Fbridge%2F${BRIDGE} - ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}${node_id} + ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_API}${node_id}%2Fbridge%2F${BRIDGE} expected_status=anything + ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_API}${node_id} expected_status=anything Bug 8280 [Documentation] Any config created for a bridge (e.g. added ports) should be reconciled when a bridge is @@ -237,8 +236,8 @@ Bug 8280 Utils.Check For Elements At URI ${RFC8040_CONFIG_TOPO_API} ${config_store_elements} pretty_print_json=True BuiltIn.Wait Until Keyword Succeeds 5s 1s Verify Ovs-vsctl Output show Port "port2" [Teardown] BuiltIn.Run Keywords Test Teardown - ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE} - ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2} + ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE} expected_status=anything + ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2} expected_status=anything Bug 7160 [Documentation] If this bug is reproduced, it's possible that the operational store will be @@ -257,22 +256,26 @@ Bug 7160 OVSDB.Log Config And Operational Topology OVSDB.Create Qos Linked Queue OVSDB.Log Config And Operational Topology - ${resp} = RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${qos}/queue-list=0 + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${qos}/queue-list=0 OVSDB.Log Config And Operational Topology - ${resp} = RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${qos} + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${qos} OVSDB.Log Config And Operational Topology - ${resp} = RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${queue} + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${queue} OVSDB.Log Config And Operational Topology - ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_HOST1_API} + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API} OVSDB.Log Config And Operational Topology Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager - RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API} + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API} OVSDB.Log Config And Operational Topology BuiltIn.Wait Until Keyword Succeeds 5s 1s OVSDB.Config and Operational Topology Should Be Empty @@ -296,16 +299,30 @@ Suite Teardown [Documentation] Cleans up test environment, close existing sessions. Clean All Ovs Nodes # Best effort to clean config store, by deleting all the types of nodes that are used in this suite - RequestsLibrary.Delete Request + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE} + ... expected_status=anything + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID} + ... expected_status=anything + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE} + ... expected_status=anything + RequestsLibrary.DELETE On Session + ... session + ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2} + ... expected_status=anything + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE} - RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID} - RequestsLibrary.Delete Request + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE} + ... expected_status=anything + RequestsLibrary.DELETE On Session ... session - ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE} - RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2} - RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE} - RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API} + ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API} + ... expected_status=anything OVSDB.Log Config And Operational Topology Delete All Sessions -- 2.36.6 From 48de7cbfd2e7a0433b3d02567bc73ca1b881fbaf Mon Sep 17 00:00:00 2001 From: Yaroslav Lastivka Date: Wed, 27 Mar 2024 23:22:25 +0200 Subject: [PATCH 11/16] Migrate 'Get Request' invocations (l2switch) 'Get Request' has been deprecated. Replace it with 'GET On Session'. Also, update the RESTCONF URLs to follow the RFC 8040 format. JIRA: INTTEST-141 Change-Id: Ie391e64a59f9fe950ddfbda2da1f7825351d40c2 Signed-off-by: Yaroslav Lastivka Signed-off-by: Sangwook Ha --- .../010__restconf_inventory.robot | 26 ++++++++++++------- .../020__restconf_topology.robot | 9 ++++--- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot b/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot index 155e1c31cd..b4692f5003 100644 --- a/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot +++ b/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot @@ -11,7 +11,7 @@ Suite Teardown Delete All Sessions *** Variables *** -${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes +${REST_CONTEXT} /rests/data/opendaylight-inventory:nodes *** Test Cases *** @@ -25,9 +25,11 @@ Get list of nodes Get nodeconnector for the root node [Documentation] Get the inventory for the root node ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT} - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:1 + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_CONTEXT}/node=openflow%3A1?content=nonconfig + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content} Get nodeconnector for a node @@ -48,8 +50,10 @@ Get Stats for a node *** Keywords *** Check Every Nodes [Arguments] ${numnodes} - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} - Should Be Equal As Strings ${resp.status_code} 200 + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_CONTEXT}?content=nonconfig + ... expected_status=200 FOR ${IND} IN RANGE 1 ${numnodes+1} Should Contain ${resp.content} openflow:${IND} END @@ -57,9 +61,11 @@ Check Every Nodes Check Every Nodes Stats [Arguments] ${numnodes} FOR ${IND} IN RANGE 1 ${numnodes+1} - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_CONTEXT}/node=openflow%3A${IND}?content=nonconfig + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} flow-capable-node-connector-statistics Should Contain ${resp.content} flow-table-statistics END @@ -67,9 +73,11 @@ Check Every Nodes Stats Check Every Nodes Nodeconnector [Arguments] ${numnodes} FOR ${IND} IN RANGE 2 ${numnodes+1} - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_CONTEXT}/node=openflow%3A${IND}?content=nonconfig + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} END diff --git a/csit/suites/l2switch/Inventory_Scalability_OF13/020__restconf_topology.robot b/csit/suites/l2switch/Inventory_Scalability_OF13/020__restconf_topology.robot index e4d3258c73..7381f6fe76 100644 --- a/csit/suites/l2switch/Inventory_Scalability_OF13/020__restconf_topology.robot +++ b/csit/suites/l2switch/Inventory_Scalability_OF13/020__restconf_topology.robot @@ -12,7 +12,7 @@ Suite Teardown Delete All Sessions *** Variables *** -${REST_CONTEXT} /restconf/operational/network-topology:network-topology/topology/flow:1 +${REST_CONTEXT} /rests/data/network-topology:network-topology/topology=flow%3A1?content=nonconfig *** Test Cases *** @@ -35,8 +35,11 @@ Get Links Count *** Keywords *** Verify Element Count [Arguments] ${URI} ${xpath_location} ${expected_count} - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} headers=${ACCEPT_XML} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${REST_CONTEXT} + ... headers=${ACCEPT_XML} + ... expected_status=200 Log ${resp.content} - Should Be Equal As Strings ${resp.status_code} 200 ${count} Get Element Count ${resp.content} xpath=${xpath_location} Should Be Equal As Numbers ${count} ${expected_count} -- 2.36.6 From a540b1bb07744ecb03503701d8a40879a349da4a Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Sun, 31 Mar 2024 17:43:48 -0700 Subject: [PATCH 12/16] Migrate 'To Json' (daexim) There is one place that uses the deprecated 'RequestLibrary.To Json' keyword. Replace it with 'Utils.Json Parse From String'. JIRA: INTTEST-141 Change-Id: I2be3445629abbe6e105476ed8f2f99c416ed555e Signed-off-by: Sangwook Ha --- csit/libraries/DaeximKeywords.robot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csit/libraries/DaeximKeywords.robot b/csit/libraries/DaeximKeywords.robot index cc1aa1c202..f1b2721464 100644 --- a/csit/libraries/DaeximKeywords.robot +++ b/csit/libraries/DaeximKeywords.robot @@ -7,6 +7,7 @@ Resource ClusterManagement.robot Resource ../variables/daexim/DaeximVariables.robot Resource ../variables/Variables.robot Resource SSHKeywords.robot +Resource Utils.robot *** Keywords *** @@ -234,7 +235,7 @@ Fetch Status Information From Netconf Endpoint [Arguments] ${endpoint} ${host_index} ${resp} ClusterManagement.Get From Member ${NETCONF_NODE_URL}=${endpoint} ${host_index} ${output1} Builtin.Set Variable ${resp} - ${output} RequestsLibrary.To Json ${output1} + ${output} Utils.Json Parse From String ${output1} Builtin.Log ${output} ${status} Collections.Get From Dictionary ... ${output['network-topology:node'][0]} -- 2.36.6 From 832e5adf5bb038985bf5cb6f2ccd896b794b768f Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Sun, 31 Mar 2024 20:07:59 -0700 Subject: [PATCH 13/16] Migrate request invocations (netconf) NetconfCallHome.robot is still using deprecated '* Request' keywords from RequestsLibrary. Replace them with '* On Session'. JIRA: INTTEST-141 Change-Id: Ief00e4e55e4b967a47d065063f93f3dbe646eb31 Signed-off-by: Sangwook Ha --- csit/libraries/NetconfCallHome.robot | 53 +++++++++++++++++++++------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/csit/libraries/NetconfCallHome.robot b/csit/libraries/NetconfCallHome.robot index 415f7cdae5..8a1779d7bf 100644 --- a/csit/libraries/NetconfCallHome.robot +++ b/csit/libraries/NetconfCallHome.robot @@ -72,11 +72,12 @@ Register keys and certificates in ODL controller ... return_stderr=True ${template} OperatingSystem.Get File ${ADD_KEYSTORE_ENTRY_REQ} ${body} Replace String ${template} {base64-client-key} ${base64-client-key} - ${resp} RequestsLibrary.Post Request + ${resp} RequestsLibrary.POST On Session ... session - ... ${netconf_keystore_url}:add-keystore-entry + ... url=${netconf_keystore_url}:add-keystore-entry ... data=${body} ... headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} ${client-key} ${stderr} SSHLibrary.Execute_Command ... sed -u '1d; $d' ./configuration-files/certs/client.key | sed -z 's!\\n!\\\\n!g' @@ -89,11 +90,12 @@ Register keys and certificates in ODL controller ${template} OperatingSystem.Get File ${ADD_PRIVATE_KEY_REQ} ${body} Replace String ${template} {client-key} ${client-key} ${body} Replace String ${body} {certificate-chain} ${certificate-chain} - ${resp} RequestsLibrary.Post Request + ${resp} RequestsLibrary.POST On Session ... session - ... ${netconf_keystore_url}:add-private-key + ... url=${netconf_keystore_url}:add-private-key ... data=${body} ... headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} ${ca-certificate} ${stderr} SSHLibrary.Execute_Command ... sed -u '1d; $d' ./configuration-files/certs/ca.pem | sed -z 's!\\n!\\\\n!g' @@ -106,11 +108,12 @@ Register keys and certificates in ODL controller ${template} OperatingSystem.Get File ${ADD_TRUSTED_CERTIFICATE} ${body} Replace String ${template} {ca-certificate} ${ca-certificate} ${body} Replace String ${body} {device-certificate} ${device-certificate} - ${resp} RequestsLibrary.Post Request + ${resp} RequestsLibrary.POST On Session ... session - ... ${netconf_keystore_url}:add-trusted-certificate + ... url=${netconf_keystore_url}:add-trusted-certificate ... data=${body} ... headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Register global credentials for SSH call-home devices (APIv1) @@ -119,7 +122,12 @@ Register global credentials for SSH call-home devices (APIv1) ${template} OperatingSystem.Get File ${CREATE_GLOBAL_CREDENTIALS_REQ} ${body} Replace String ${template} {username} ${username} ${body} Replace String ${body} {password} ${password} - ${resp} RequestsLibrary.Put Request session ${global_config_url} data=${body} headers=${HEADERS} + ${resp} RequestsLibrary.PUT On Session + ... session + ... url=${global_config_url} + ... data=${body} + ... headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Register SSH call-home device in ODL controller (APIv1) @@ -134,7 +142,12 @@ Register SSH call-home device in ODL controller (APIv1) ${body} Replace String ${body} {username} ${username} ${body} Replace String ${body} {password} ${password} ${body} Replace String ${body} {hostkey} ${hostkey} - ${resp} RequestsLibrary.Post Request session ${whitelist} data=${body} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${whitelist} + ... data=${body} + ... headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Get create device request template (APIv1) @@ -157,7 +170,12 @@ Register SSH call-home device in ODL controller (APIv2) ${body} Replace String ${body} {username} ${username} ${body} Replace String ${body} {password} ${password} ${body} Replace String ${body} {hostkey} ${hostkey} - ${resp} RequestsLibrary.Post Request session ${whitelist} data=${body} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${whitelist} + ... data=${body} + ... headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Get create device request template (APIv2) @@ -175,7 +193,12 @@ Register TLS call-home device in ODL controller (APIv2) ${body} Replace String ${template} {device_name} ${device_name} ${body} Replace String ${body} {key_id} ${key_id} ${body} Replace String ${body} {certificate_id} ${certificate_id} - ${resp} RequestsLibrary.Post Request session ${whitelist} data=${body} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${whitelist} + ... data=${body} + ... headers=${HEADERS} + ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Pull Netopeer2 Docker Image @@ -239,8 +262,14 @@ Test Teardown ... return_stderr=True ... return_rc=True SSHLibrary.Execute_Command rm -rf ./configuration-files - ${resp} RequestsLibrary.Delete_On_Session session ${whitelist} - ${resp} RequestsLibrary.Delete_On_Session session ${netconf_keystore_data_url} + ${resp} RequestsLibrary.Delete_On_Session + ... session + ... url=${whitelist} + ... expected_status=anything + ${resp} RequestsLibrary.Delete_On_Session + ... session + ... url=${netconf_keystore_data_url} + ... expected_status=anything Suite Setup [Documentation] Get the suite ready for callhome test cases. -- 2.36.6 From 7df40c8c0ac70da634e98ef506471a9aa0c475be Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Sun, 31 Mar 2024 21:02:19 -0700 Subject: [PATCH 14/16] Migrate 'Get Request' (bgpcep) There are a couple places in bgpcep test suites where deprecated 'Get Request' RequestsLibrary keyword is used. Replace it with 'GET On Session'. Also, use 'anything' instead of 'any' and do not remove 'alias=' for the session argument to make them more consistent across all the test suites. JIRA: INTTEST-141 Change-Id: Id8bf71a5477cdfb5d6181016a614bbc8f7dfc083 Signed-off-by: Sangwook Ha --- csit/libraries/BgpOperations.robot | 12 ++++----- csit/libraries/ExaBgpLib.robot | 3 ++- csit/libraries/GoBgpLib.robot | 4 +-- csit/libraries/PcepOperations.robot | 6 ++--- csit/libraries/PrefixCounting.robot | 2 +- csit/libraries/TemplatedRequests.robot | 2 +- csit/libraries/Utils.robot | 6 ++++- .../bgpcep/bgpflowspec/010_bgp_flowspec.robot | 2 +- .../020_bgp_functional_multipath.robot | 2 +- .../bgpfunct/030_bgp_functional_evpn.robot | 26 +++++++++---------- ...p_functional_rt_constrain_validation.robot | 2 +- 11 files changed, 36 insertions(+), 31 deletions(-) diff --git a/csit/libraries/BgpOperations.robot b/csit/libraries/BgpOperations.robot index 1a9591cb10..ad3d40e640 100644 --- a/csit/libraries/BgpOperations.robot +++ b/csit/libraries/BgpOperations.robot @@ -273,7 +273,7 @@ AddNeighbor To BGP Configuration On ODL Get BGP Configuration On ODL [Documentation] Get bgp configuration [Arguments] ${odl_session} - ${resp} = RequestsLibrary.GET On Session alias=${odl_session} url=${CONFIG_API}/ebgp:bgp/ + ${resp} = RequestsLibrary.GET On Session ${odl_session} url=${CONFIG_API}/ebgp:bgp/ Log ${resp.text} RETURN ${resp.text} @@ -281,7 +281,7 @@ Delete BGP Configuration On ODL [Documentation] Delete BGP [Arguments] ${odl_session} ${resp} = RequestsLibrary.DELETE On Session - ... alias=${odl_session} + ... ${odl_session} ... url=${CONFIG_API}/ebgp:bgp/ ... expected_status=200 Log ${resp.text} @@ -314,7 +314,7 @@ Check_Example_Bgp_Rib_Content [Documentation] Check the example-bgp-rib content for string [Arguments] ${session} ${substr} ${error_message}=${JSONKEYSTR} not found, but expected. ${response} = RequestsLibrary.GET On Session - ... alias=${session} + ... ${session} ... url=${REST_API}/${BGP_RIB_URI}?content=nonconfig BuiltIn.Log ${response.status_code} BuiltIn.Log ${response.text} @@ -324,7 +324,7 @@ Check_Example_Bgp_Rib_Does_Not_Contain [Documentation] Check the example-bgp-rib does not contain the string [Arguments] ${session} ${substr} ${error_message}=${JSONKEYSTR} found, but not expected. ${response} = RequestsLibrary.GET On Session - ... alias=${session} + ... ${session} ... url=${REST_API}/${BGP_RIB_URI}?content=nonconfig BuiltIn.Log ${response.status_code} BuiltIn.Log ${response.text} @@ -334,7 +334,7 @@ Check_Example_IPv4_Topology_Content [Documentation] Check the example-ipv4-topology content for string [Arguments] ${session} ${string_to_check}=${EMPTY} ${response} = RequestsLibrary.GET On Session - ... alias=${session} + ... ${session} ... url=${REST_API}/${BGP_TOPOLOGY_URI}?content=nonconfig BuiltIn.Log ${response.status_code} BuiltIn.Log ${response.text} @@ -344,7 +344,7 @@ Check_Example_IPv4_Topology_Does_Not_Contain [Documentation] Check the example-ipv4-topology does not contain the string [Arguments] ${session} ${string_to_check} ${response} = RequestsLibrary.GET On Session - ... alias=${session} + ... ${session} ... url=${REST_API}/${BGP_TOPOLOGY_URI}?content=nonconfig BuiltIn.Log ${response.status_code} BuiltIn.Log ${response.text} diff --git a/csit/libraries/ExaBgpLib.robot b/csit/libraries/ExaBgpLib.robot index b1bf48c12d..2c47b30810 100644 --- a/csit/libraries/ExaBgpLib.robot +++ b/csit/libraries/ExaBgpLib.robot @@ -77,8 +77,9 @@ Verify_ExaBgps_Connection ${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 - ... alias=${session} + ... ${session} ... url=${peer_check_url}${exabgp_ip}?content=nonconfig + ... expected_status=anything BuiltIn.Log ${rsp.content} BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code} diff --git a/csit/libraries/GoBgpLib.robot b/csit/libraries/GoBgpLib.robot index 986f3079f1..e2d931ed3c 100644 --- a/csit/libraries/GoBgpLib.robot +++ b/csit/libraries/GoBgpLib.robot @@ -75,8 +75,8 @@ Verify_GoBgps_Connection ... ${ALLOWED_STATUS_CODES} ... ${DELETED_STATUS_CODES} ${rsp}= RequestsLibrary.GET On Session - ... alias=${session} + ... ${session} ... url=${peer_check_url}${gobgp_ip}?content=nonconfig - ... expected_status=any + ... expected_status=anything BuiltIn.Log ${rsp.content} BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code} diff --git a/csit/libraries/PcepOperations.robot b/csit/libraries/PcepOperations.robot index 1a37c05948..4dae800afd 100644 --- a/csit/libraries/PcepOperations.robot +++ b/csit/libraries/PcepOperations.robot @@ -24,7 +24,7 @@ ${PCEP_VAR_FOLDER} ${CURDIR}/../variables/tcpmd5user Setup_Pcep_Operations [Documentation] Creates Requests session to be used by subsequent keywords. RequestsLibrary.Create_Session - ... alias=pcep_session + ... pcep_session ... url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... headers=${HEADERS_XML} ... auth=${AUTH} @@ -59,10 +59,10 @@ Operate_Xml_Lsp_Return_Json [Arguments] ${uri_part} ${xml_data} ${uri_path}= BuiltIn.Set_Variable /rests/operations/${uri_part} ${response}= RequestsLibrary.POST On Session - ... alias=pcep_session + ... pcep_session ... url=${uri_path} ... data=${xml_data} - ... expected_status=any + ... expected_status=anything Log ${xml_data} Should Contain ${ALLOWED_STATUS_CODES} ${response.status_code} RETURN ${response.text} diff --git a/csit/libraries/PrefixCounting.robot b/csit/libraries/PrefixCounting.robot index 2d410d2981..9465e41925 100644 --- a/csit/libraries/PrefixCounting.robot +++ b/csit/libraries/PrefixCounting.robot @@ -38,7 +38,7 @@ Get_Ipv4_Topology ${response} = RequestsLibrary.GET On Session ... ${session} ... url=${PC_NW_TOPOLOGY}=${topology}?content=nonconfig - ... expected_status=any + ... expected_status=anything IF ${response.status_code} != 200 Fail Get on ${topology} returned status code ${response.status_code} with message: ${response.text} END diff --git a/csit/libraries/TemplatedRequests.robot b/csit/libraries/TemplatedRequests.robot index ea7a795e6d..73fc5ab08a 100644 --- a/csit/libraries/TemplatedRequests.robot +++ b/csit/libraries/TemplatedRequests.robot @@ -151,7 +151,7 @@ Create_Default_Session ... This Keyword is in this Resource only so that user do not need to call RequestsLibrary directly. [Arguments] ${url}=http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ${auth}=${AUTH} ${timeout}=${DEFAULT_TIMEOUT_HTTP} ${max_retries}=0 RequestsLibrary.Create_Session - ... alias=default + ... default ... url=${url} ... auth=${auth} ... timeout=${timeout} diff --git a/csit/libraries/Utils.robot b/csit/libraries/Utils.robot index ddcc2f7f98..17077d466c 100644 --- a/csit/libraries/Utils.robot +++ b/csit/libraries/Utils.robot @@ -469,7 +469,11 @@ No Content From URI ... ${headers}. If the request returns a HTTP error, fails. Otherwise ... returns the data obtained by the request. [Arguments] ${session} ${uri} ${headers}=${NONE} - ${resp}= RequestsLibrary.Get On Session ${session} url=${uri} expected_status=any headers=${headers} + ${resp}= RequestsLibrary.Get On Session + ... ${session} + ... url=${uri} + ... headers=${headers} + ... expected_status=anything IF ${resp.status_code} == 404 or ${resp.status_code} == 409 RETURN Builtin.Log ${resp.text} Builtin.Fail The request failed with code ${resp.status_code} diff --git a/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot b/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot index 52d267b2e2..ef3930ab6b 100644 --- a/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot +++ b/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot @@ -129,7 +129,7 @@ Verify_Flowspec_Data Normalize_And_Compare [Documentation] Verify empty flowspec data - ${rsp} RequestsLibrary.Get_Request ${CONFIG_SESSION} ${FLOWSPEC_URL} + ${rsp} RequestsLibrary.GET On Session ${CONFIG_SESSION} url=${FLOWSPEC_URL} TemplatedRequests.Normalize_Jsons_With_Bits_And_Compare ... ${EXP0} ... ${rsp.content} diff --git a/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot b/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot index 5fc04cb164..3691d790e8 100644 --- a/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot +++ b/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot @@ -197,7 +197,7 @@ Store_Rib_Configuration Log_Loc_Rib_Operational ${rsp} RequestsLibrary.GET On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=/rests/data/bgp-rib:bgp-rib/rib=example-bgp-rib/loc-rib?content=nonconfig BuiltIn.Log ${rsp.content} diff --git a/csit/suites/bgpcep/bgpfunct/030_bgp_functional_evpn.robot b/csit/suites/bgpcep/bgpfunct/030_bgp_functional_evpn.robot index 3f5eb2c47f..efac5aad93 100644 --- a/csit/suites/bgpcep/bgpfunct/030_bgp_functional_evpn.robot +++ b/csit/suites/bgpcep/bgpfunct/030_bgp_functional_evpn.robot @@ -321,14 +321,14 @@ Odl_To_Play_Template BuiltIn.Log ${withdraw_hex} BgpRpcClient.play_clean ${resp} = RequestsLibrary.POST On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=${EVPN_CONF_URL} ... data=${data_xml} ... headers=${HEADERS_XML} ... expected_status=201 BuiltIn.Log ${resp.content} ${resp} = RequestsLibrary.GET On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=${EVPN_CONF_URL}?content=config ... headers=${HEADERS_XML} BuiltIn.Log ${resp.content} @@ -363,12 +363,12 @@ Play_To_Odl_Template Verify_Test_Preconditions ${resp} = RequestsLibrary.GET On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=${EVPN_CONF_URL}?content=config - ... expected_status=any + ... expected_status=anything BuiltIn.Should_Contain ${DELETED_STATUS_CODES} ${resp.status_code} ${resp} = RequestsLibrary.GET On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=${EVPN_FAMILY_LOC_RIB} ... headers=${HEADERS} TemplatedRequests.Normalize_Jsons_And_Compare ${EMPTY_ROUTES} ${resp.content} @@ -376,22 +376,22 @@ Verify_Test_Preconditions Remove_Configured_Routes [Documentation] Removes the route if present. First GET is for debug purposes. ${resp} = RequestsLibrary.GET On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=${EVPN_LOC_RIB} ... headers=${HEADERS} - ... expected_status=any + ... expected_status=anything BuiltIn.Log ${resp.content} BuiltIn.Should_Contain ${ALLOWED_DELETE_STATUS_CODES} ${resp.status_code} ${resp} = RequestsLibrary.GET On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=${EVPN_CONF_URL}?content=config ... headers=${HEADERS} - ... expected_status=any + ... expected_status=anything BuiltIn.Log ${resp.content} BuiltIn.Should_Contain ${ALLOWED_DELETE_STATUS_CODES} ${resp.status_code} IF ${resp.status_code} in ${DELETED_STATUS_CODES} RETURN ${resp} = RequestsLibrary.DELETE On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=${EVPN_CONF_URL} ... expected_status=204 @@ -405,10 +405,10 @@ Get_Update_Content [Documentation] Gets received data from odl's peer [Arguments] ${expected_status_codes} ${resp} = RequestsLibrary.GET On Session - ... alias=${CONFIG_SESSION} + ... ${CONFIG_SESSION} ... url=${EVPN_LOC_RIB} ... headers=${HEADERS_XML} - ... expected_status=any + ... expected_status=anything BuiltIn.Log ${resp.content} BuiltIn.Should_Contain ${expected_status_codes} ${resp.status_code} ${update} = BgpRpcClient.play_get @@ -418,6 +418,6 @@ Get_Update_Content Loc_Rib_Presence [Documentation] Verifies if loc-rib contains expected data [Arguments] ${exp_content} - ${resp} = RequestsLibrary.GET On Session alias=${CONFIG_SESSION} url=${EVPN_LOC_RIB} headers=${HEADERS} + ${resp} = RequestsLibrary.GET On Session ${CONFIG_SESSION} url=${EVPN_LOC_RIB} headers=${HEADERS} BuiltIn.Log_Many ${exp_content} ${resp.content} TemplatedRequests.Normalize_Jsons_And_Compare ${exp_content} ${resp.content} diff --git a/csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot b/csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot index 9b5f00dd40..72697ec7db 100644 --- a/csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot +++ b/csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot @@ -285,7 +285,7 @@ Verify_Reported_Data [Arguments] ${url} ${exprspfile} ${expresponse} = OperatingSystem.Get File ${exprspfile} BuiltIn.Log expected_response: ${expresponse} - ${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${url} + ${rsp} = RequestsLibrary.GET On Session ${CONFIG_SESSION} url=${url} BuiltIn.Log actual_response: ${rsp} BuiltIn.Log actual_response_content: ${rsp.content} TemplatedRequests.Normalize_Jsons_And_Compare ${expresponse} ${rsp.content} -- 2.36.6 From c88ead2b4a65ba004398ad07cfe033ae1e467b17 Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Sun, 31 Mar 2024 21:12:36 -0700 Subject: [PATCH 15/16] Reformat '* On Session' keywords (aaa) Use a line per argument when the keyword does not fit in a single line to make the format more consistent across the test suites. Change-Id: I674441ee2fa639cdad03f5d6da71716cdda79c94 Signed-off-by: Sangwook Ha --- csit/libraries/AAAKeywords.robot | 5 +- .../aaa/keystone/010__keystone_authn.robot | 105 ++++++++++++++---- 2 files changed, 88 insertions(+), 22 deletions(-) diff --git a/csit/libraries/AAAKeywords.robot b/csit/libraries/AAAKeywords.robot index 33e56505ec..0ea0618828 100644 --- a/csit/libraries/AAAKeywords.robot +++ b/csit/libraries/AAAKeywords.robot @@ -87,7 +87,10 @@ Get User From IDM DB [Arguments] ${user_id}=${EMPTY} Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTPORT} ${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded - ${resp}= RequestsLibrary.GET On Session httpbin url=${idmurl}/users/${user_id} headers=${headers} + ${resp}= RequestsLibrary.GET On Session + ... httpbin + ... url=${idmurl}/users/${user_id} + ... headers=${headers} ... expected_status=200 Log ${resp.text} RETURN ${resp} diff --git a/csit/suites/aaa/keystone/010__keystone_authn.robot b/csit/suites/aaa/keystone/010__keystone_authn.robot index 3927d727a7..f01c62eaae 100644 --- a/csit/suites/aaa/keystone/010__keystone_authn.robot +++ b/csit/suites/aaa/keystone/010__keystone_authn.robot @@ -48,10 +48,16 @@ Successful Authentication Including Domain ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_SDN_DOMAIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} @@ -69,10 +75,16 @@ Successful Authentication Without Domain ... ... - URL "/restconf/operational/ietf-restconf-monitoring:restconf-state" is not specified neither in shiro.ini nor in MDSAL Dynamic Authorization so no specific role is required Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_CSC_SDN} headers=${HEADERS} - ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} @@ -88,10 +100,16 @@ Unsuccessful Authentication Wrong User ... ... Due to authentication fails, authorization is not evaluated Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_INVALID} headers=${HEADERS} - ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} @@ -108,10 +126,16 @@ UnSuccessful Authentication Without Domain ... ... Due to authentication fails, authorization is not evaluated Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_SDN} headers=${HEADERS} - ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} @@ -133,10 +157,16 @@ Unsuccessful Authentication Wrong Domain ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_SDN_WRONG_DOM} ... headers=${HEADERS} - ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} @@ -156,10 +186,16 @@ Unsuccessful Basic Authorization ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_CSC_NO_ADMIN} ... headers=${HEADERS} - ${resp_ok} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp_ok} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp_ok.status_code} - ${resp_nook} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp_nook} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code} @@ -179,10 +215,16 @@ Unsuccessful Dynamic Authorization ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_CSC_NO_ADMIN} ... headers=${HEADERS} - ${resp_nook} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp_nook} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code} - ${resp_nook} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp_nook} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code} @@ -210,10 +252,16 @@ Unsuccessful Dynamic Authorization 2 ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_SDN_DOMAIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} Create Session @@ -221,10 +269,16 @@ Unsuccessful Dynamic Authorization 2 ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_CSC_NO_ADMIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} @@ -241,10 +295,16 @@ Unsuccessful No Keystone Connection ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_SDN_DOMAIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} + ${resp} RequestsLibrary.POST On Session + ... session + ... url=${URI_CERTIFICATE} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} Create Session @@ -252,7 +312,10 @@ Unsuccessful No Keystone Connection ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ... auth=${AUTH_CSC_NO_ADMIN} ... headers=${HEADERS} - ${resp} RequestsLibrary.GET On Session session url=${URI_RESTCONF} headers=${HEADERS} + ${resp} RequestsLibrary.GET On Session + ... session + ... url=${URI_RESTCONF} + ... headers=${HEADERS} ... expected_status=anything Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code} ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS} -- 2.36.6 From 02dd570f7544c8cd6eb17bda775de9bccc89f923 Mon Sep 17 00:00:00 2001 From: Yaroslav Lastivka Date: Wed, 27 Mar 2024 16:35:50 +0200 Subject: [PATCH 16/16] Migrate Get Requests invocations(libraries) The 'Get Request' RequestsLibrary keyword has been deprecated. 'Get Request' has been replaced by 'GET On Session'. JIRA: INTTEST-141 Change-Id: I2128046b5a97126ad33927b099f605fc92715e81 Signed-off-by: Yaroslav Lastivka --- csit/libraries/DIDMKeywords.robot | 3 +-- csit/libraries/DatastoreCRUD.robot | 2 +- csit/libraries/OVSDB.robot | 2 +- csit/libraries/SxpBindingOriginsLib.robot | 4 ++-- csit/libraries/SxpClusterLib.robot | 9 ++++---- csit/libraries/SxpLib.robot | 12 +++++----- csit/libraries/TopoprocessingKeywords.robot | 3 +-- csit/libraries/VtnMaKeywords.robot | 25 +++++++++++---------- 8 files changed, 29 insertions(+), 31 deletions(-) diff --git a/csit/libraries/DIDMKeywords.robot b/csit/libraries/DIDMKeywords.robot index 9905ee117a..f61c1784c3 100644 --- a/csit/libraries/DIDMKeywords.robot +++ b/csit/libraries/DIDMKeywords.robot @@ -12,8 +12,7 @@ Resource ../variables/openflowplugin/Variables.robot *** Keywords *** Check DIDM Registered With Device [Documentation] Check for DIDM registered with the device - ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API} - Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= RequestsLibrary.GET On Session session ${RFC8040_OPERATIONAL_NODES_API} expected_status=200 Log ${resp.text} Should Contain ${resp.text} didm RETURN ${resp.text} diff --git a/csit/libraries/DatastoreCRUD.robot b/csit/libraries/DatastoreCRUD.robot index dd591fe3e8..558f92ff39 100644 --- a/csit/libraries/DatastoreCRUD.robot +++ b/csit/libraries/DatastoreCRUD.robot @@ -34,7 +34,7 @@ Read Records ... http://${controller_ip}:${RESTCONFPORT}${CONFIG_API} ... headers=${HEADERS} ... auth=${AUTH} - ${resp}= RequestsLibrary.Get Request session ${node} + ${resp}= RequestsLibrary.GET On Session session ${node} RETURN ${resp.json()} Update Records diff --git a/csit/libraries/OVSDB.robot b/csit/libraries/OVSDB.robot index a50a4aacf3..166ce964f0 100644 --- a/csit/libraries/OVSDB.robot +++ b/csit/libraries/OVSDB.robot @@ -293,7 +293,7 @@ Log Config And Operational Topology Config and Operational Topology Should Be Empty [Documentation] This will check that only the expected output is there for both operational and config ... topology data stores. Empty probably means that only ovsdb:1 is there. - ${config_resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} + ${config_resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} ${operational_resp} = RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} BuiltIn.Should Contain ${config_resp.text} {"topology-id":"ovsdb:1"} BuiltIn.Should Contain ${operational_resp.text} {"topology-id":"ovsdb:1"} diff --git a/csit/libraries/SxpBindingOriginsLib.robot b/csit/libraries/SxpBindingOriginsLib.robot index b41da8071d..b09e8c8ff4 100644 --- a/csit/libraries/SxpBindingOriginsLib.robot +++ b/csit/libraries/SxpBindingOriginsLib.robot @@ -28,8 +28,8 @@ Revert To Default Binding Origins Configuration Get Binding Origins [Documentation] Gets all binding origins via RPC from configuration [Arguments] ${session}=session - ${resp} = RequestsLibrary.Get Request ${session} /restconf/config/sxp-config:binding-origins - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ${resp} = RequestsLibrary.GET On Session ${session} /restconf/config/sxp-config:binding-origins + ... expected_status=200 RETURN ${resp} Add Binding Origin diff --git a/csit/libraries/SxpClusterLib.robot b/csit/libraries/SxpClusterLib.robot index dec6a0f8b1..99fd137ae7 100644 --- a/csit/libraries/SxpClusterLib.robot +++ b/csit/libraries/SxpClusterLib.robot @@ -129,10 +129,9 @@ Clean SXP Cluster Check Cluster Node Started [Documentation] Verify that SxpNode has data written to Operational datastore and Node is running on one of cluster nodes [Arguments] ${node} ${port}=64999 ${ip}=${node} - ${resp} = RequestsLibrary.Get Request + ${resp} = RequestsLibrary.GET On Session ... ${CONTROLLER_SESSION} - ... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/ - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/ expected_status=200 ${started} = BuiltIn.Set Variable ${False} FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} ${rc} = Utils.Run Command On Remote System @@ -148,10 +147,10 @@ Check Cluster Node Started Check Cluster Node Stopped [Documentation] Verify that SxpNode has data removed from Operational datastore and Node is stopped [Arguments] ${node} ${port}=64999 ${ip}=${node} - ${resp} = RequestsLibrary.Get Request + ${resp} = RequestsLibrary.GET On Session ... ${CONTROLLER_SESSION} ... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/ - BuiltIn.Should Be Equal As Strings ${resp.status_code} 404 + ... expected_status=404 ${stopped} = BuiltIn.Set Variable ${False} FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} ${rc} = Utils.Run Command On Remote System diff --git a/csit/libraries/SxpLib.robot b/csit/libraries/SxpLib.robot index 7ee57de389..7a3a431029 100644 --- a/csit/libraries/SxpLib.robot +++ b/csit/libraries/SxpLib.robot @@ -362,20 +362,20 @@ Setup SXP Environment Check Node Started [Documentation] Verify that SxpNode has data writen to Operational datastore and is running [Arguments] ${node} ${port}=64999 ${system}=${node} ${session}=session ${ip}=${node} - ${resp} = RequestsLibrary.Get Request + ${resp} = RequestsLibrary.GET On Session ... ${session} ... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/ - BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + ... expected_status=200 ${rc} = Get Node Running Status ${node} ${port} ${system} ${session} ${ip} BuiltIn.Should Be Equal As Strings ${rc} 0 Check Node Stopped [Documentation] Verify that SxpNode has data removed from Operational datastore and is not running [Arguments] ${node} ${port}=64999 ${system}=${node} ${session}=session ${ip}=${node} - ${resp} = RequestsLibrary.Get Request + ${resp} = RequestsLibrary.GET On Session ... ${session} ... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/ - BuiltIn.Should Be Equal As Strings ${resp.status_code} 404 + ... expected_status=404 ${rc} = Get Node Running Status ${node} ${port} ${system} ${session} ${ip} BuiltIn.Should Be Equal As Strings ${rc} 1 @@ -403,7 +403,7 @@ Clean SXP Environment Get Routing Configuration From Controller [Documentation] Get Routing configuration from config DS [Arguments] ${session} - ${resp} = RequestsLibrary.Get Request + ${resp} = RequestsLibrary.GET On Session ... ${session} ... /restconf/config/sxp-cluster-route:sxp-cluster-route/ ... headers=${ACCEPT_XML} @@ -424,7 +424,7 @@ Put Routing Configuration To Controller Clean Routing Configuration To Controller [Documentation] Delete Routing configuration from Config DS [Arguments] ${session} - ${resp} = RequestsLibrary.Get Request + ${resp} = RequestsLibrary.GET On Session ... ${session} ... /restconf/config/sxp-cluster-route:sxp-cluster-route/ ... headers=${ACCEPT_XML} diff --git a/csit/libraries/TopoprocessingKeywords.robot b/csit/libraries/TopoprocessingKeywords.robot index 6f60263945..b6ddab7094 100644 --- a/csit/libraries/TopoprocessingKeywords.robot +++ b/csit/libraries/TopoprocessingKeywords.robot @@ -35,8 +35,7 @@ Basic Request Put Basic Request Get [Documentation] Send a simple HTTP GET request to a given URL [Arguments] ${overlay_topology_url} - ${resp} Get Request session ${OPERATIONAL_API}/${overlay_topology_url} - Should Be Equal As Strings ${resp.status_code} 200 + ${resp} Get On Session session ${OPERATIONAL_API}/${overlay_topology_url} expected_status=200 RETURN ${resp} Send Basic Delete Request diff --git a/csit/libraries/VtnMaKeywords.robot b/csit/libraries/VtnMaKeywords.robot index 03b5020d40..e299f33560 100644 --- a/csit/libraries/VtnMaKeywords.robot +++ b/csit/libraries/VtnMaKeywords.robot @@ -101,16 +101,14 @@ Stop SuiteVtnMaTest Fetch vtn list [Documentation] Check if VTN Manager is up. - ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn:vtns - Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= RequestsLibrary.GET On Session session restconf/operational/vtn:vtns expected_status=200 Fetch vtn switch inventory [Documentation] Check if Switch is detected. [Arguments] ${sw_name} - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session - ... restconf/operational/vtn-inventory:vtn-nodes/vtn-node/${sw_name} - Should Be Equal As Strings ${resp.status_code} 200 + ... restconf/operational/vtn-inventory:vtn-nodes/vtn-node/${sw_name} expected_status=200 Collect Debug Info [Documentation] Check if Switch is detected. @@ -243,7 +241,7 @@ Add a pathmap Get a pathmap [Documentation] Get a pathmap for a vtn. - ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn-path-map:global-path-maps + ${resp}= RequestsLibrary.GET On Session session restconf/operational/vtn-path-map:global-path-maps FOR ${pathElement} IN @{PATHMAP_ATTR} should Contain ${resp.text} ${pathElement} END @@ -260,7 +258,7 @@ Add a pathpolicy Get a pathpolicy [Documentation] Get a pathpolicy for a vtn. [Arguments] ${pathpolicy_id} - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session ... restconf/operational/vtn-path-policy:vtn-path-policies/vtn-path-policy/${pathpolicy_id} FOR ${pathpolicyElement} IN @{PATHPOLICY_ATTR} @@ -349,10 +347,10 @@ Start vlan_topo Get flow [Documentation] Get data flow. [Arguments] ${vtn_name} - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session ... restconf/operational/vtn-flow-impl:vtn-flows/vtn-flow-table/${vtn_name} - Should Be Equal As Strings ${resp.status_code} 200 + ... expected_status=200 Remove a portmap [Documentation] Remove a portmap for a interface of a vbridge @@ -519,16 +517,19 @@ Add a flowcondition Get flowconditions [Documentation] Retrieve the list of flowconditions created - ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn-flow-condition:vtn-flow-conditions - Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= RequestsLibrary.Get On Session + ... session + ... restconf/operational/vtn-flow-condition:vtn-flow-conditions + ... expected_status=200 Get flowcondition [Documentation] Retrieve the flowcondition by name and to check the removed flowcondition we added "retrieve" argument to differentiate the status code, ... since after removing flowcondition name the status will be different compare to status code when the flowcondition name is present. [Arguments] ${flowcond_name} ${retrieve} - ${resp}= RequestsLibrary.Get Request + ${resp}= RequestsLibrary.GET On Session ... session ... restconf/operational/vtn-flow-condition:vtn-flow-conditions/vtn-flow-condition/${flowcond_name} + ... expected_status=anything IF '${retrieve}' == 'retrieve' Should Be Equal As Strings ${resp.status_code} 200 ELSE -- 2.36.6