Migrate Get Requests invocations(libraries) 09/111109/7 master
authorYaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Wed, 27 Mar 2024 14:35:50 +0000 (16:35 +0200)
committerYaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Mon, 8 Apr 2024 10:29:11 +0000 (13:29 +0300)
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 <yaroslav.lastivka@pantheon.tech>
csit/libraries/DIDMKeywords.robot
csit/libraries/DatastoreCRUD.robot
csit/libraries/OVSDB.robot
csit/libraries/SxpBindingOriginsLib.robot
csit/libraries/SxpClusterLib.robot
csit/libraries/SxpLib.robot
csit/libraries/TopoprocessingKeywords.robot
csit/libraries/VtnMaKeywords.robot

index 9905ee117a9d0e1f7e15a0b6b58da6058e8583f8..f61c1784c3e8955f114e8183c0e58f66554b8949 100644 (file)
@@ -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}
index dd591fe3e8b3f0c5ad24d785561cbbb412f96307..558f92ff39e526389bdbfee2e9916fc065212a37 100644 (file)
@@ -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
index a50a4aacf337cd991e3cf89305a1542e8388b5ce..166ce964f02341da186b0a1b850f72dbf2372658 100644 (file)
@@ -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"}
index b41da8071d463c9eeaff9b13b8c21796665a8fcd..b09e8c8ff4f73dd14ce5ff6c78b926d005989816 100644 (file)
@@ -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
index dec6a0f8b17b22ac3a6a65a5e356d54b0a591f27..99fd137ae7c33efdff1675a2c9a72a5f7dd06d62 100644 (file)
@@ -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
index 7ee57de3898f5dfb4a0bfae9d185141357034e59..7a3a431029f541fdff86c61a58f5b6e3b7d18dc7 100644 (file)
@@ -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}
index 6f60263945ac97ec707791ae27864bfcd4f7c5c1..b6ddab7094c44c1f90dba373546d8b1ff28038f3 100644 (file)
@@ -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
index 03b5020d400c1fff086fc176632e37166fe2e163..e299f335603a71253caf0455a7c3a0451b68f517 100644 (file)
@@ -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