Migrate 'Get Request' invocations (l2switch) 23/111123/6
authorYaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Wed, 27 Mar 2024 21:22:25 +0000 (23:22 +0200)
committerSangwook Ha <sangwook.ha@verizon.com>
Fri, 5 Apr 2024 17:49:36 +0000 (10:49 -0700)
'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 <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot
csit/suites/l2switch/Inventory_Scalability_OF13/020__restconf_topology.robot

index 155e1c31cdea360b8c7c5a1789a5fe0e68adf120..b4692f5003790745a59e8406788f9d611c9cff5e 100644 (file)
@@ -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
 
index e4d3258c73d345989ad0e8cc418478c0170f2cf2..7381f6fe76beb2d27ddbae0e1094fc1ee834a3ee 100644 (file)
@@ -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}