Migrate request invocations (openflowplugin) 26/111126/8
authorYaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Wed, 27 Mar 2024 22:17:36 +0000 (00:17 +0200)
committerSangwook Ha <sangwook.ha@verizon.com>
Fri, 5 Apr 2024 17:49:36 +0000 (10:49 -0700)
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 <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
38 files changed:
csit/libraries/BulkomaticKeywords.robot
csit/libraries/ClusterOpenFlow.robot
csit/libraries/DataModels.robot
csit/libraries/FlowLib.robot
csit/libraries/SwitchUtils.robot
csit/libraries/Utils.robot
csit/libraries/WorkflowsOpenFlow.robot
csit/suites/openflowplugin/Bug_Validation/6917.robot
csit/suites/openflowplugin/Bug_Validation/7258.robot
csit/suites/openflowplugin/Bug_Validation/7335.robot
csit/suites/openflowplugin/Bug_Validation/7349.robot
csit/suites/openflowplugin/Bug_Validation/8723.robot
csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot
csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot
csit/suites/openflowplugin/Flows_Additional_TCs/010_Lithium_Rps_Calls_Ovs.robot
csit/suites/openflowplugin/Flows_Additional_TCs/020_Lithium_Rps_Calls_Cpqd.robot
csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot
csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot
csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot
csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot
csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot
csit/suites/openflowplugin/Inventory_Scalability_OF10/020__restconf_topology.robot
csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot
csit/suites/openflowplugin/Inventory_Scalability_OF13/020__restconf_topology.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF10/020_restconf_topology.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF13/020_restconf_topology.robot
csit/suites/openflowplugin/MD_SAL_NSF_OF13/040_restconf_frm.robot
csit/suites/openflowplugin/Performance_Flow_Config/010_Rest_Config_Flows.robot
csit/suites/openflowplugin/Performance_Flow_Config/020_Stats_Collection_Gauss.robot
csit/suites/openflowplugin/Performance_Flow_Config/030_Stats_Collection_Linear.robot
csit/suites/openflowplugin/Performance_Flow_Config/040_Stats_Collection_One.robot
csit/suites/openflowplugin/Performance_Flow_Config/050_Stats_Collection_FirstTable.robot
csit/suites/openflowplugin/Performance_Flow_Config/060_Stats_Collection_Basic16kScenario.robot
csit/suites/openflowplugin/Performance_Flow_Config/070_Stats_Collection_100k_WithMininetRestart.robot
csit/suites/openflowplugin/Performance_Flow_Config/080_Rpc_100k_Flows_Configuration_Time_Measure.robot
csit/suites/openflowplugin/Performance_Flow_Config/090_BulkMaticConfigDsSetup_100k.robot
csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot

index 302c913fa50fe1f48d00fa000d353557e4a7d840..83f9dfa51616b97da10e00c1db0d8de64bd2c793 100644 (file)
@@ -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}
 
index 1a0460d59107b08bfac710a4f1901cd7f5fefc68..ede359edd84f3e5941c346c28aa7921b99e2c7dc 100644 (file)
@@ -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}
index 3b8994a1c9bede0ab14758394d108c97181e5afc..69e4c6a1cba9e6160afa73a1ac96e55c9be19df0 100644 (file)
@@ -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}
index 18c163e2f0b4227530d03efbc623bc4b5398d0a9..d58f9bc8c097e63cbb8b94f01e308d44dfacad4f 100644 (file)
@@ -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]
index be60c0838003a4b7df711471bec043155974f67a..c64f26005a1bc81b08043d9ca79bac6167d4fbca 100644 (file)
@@ -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}
 
index a9e2ae840ad74e73937238aa6147bb937b6b1e6d..ddcc2f7f98c7a0d67e473aa32cf2cb7d28d71631 100644 (file)
@@ -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}
 
index dac5fe89fc4c8323013e3e6ef01b9bc924a7f29c..2ad987e5d10153c607b0acab557f98dd8c503fc2 100644 (file)
@@ -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
index 1b6808b391f53fc860a71a491381bffe8196cd32..95ebdce233e9f91fec53c631c09f2d4c3271513b 100644 (file)
@@ -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}
index 7f7d99c8eff071e497ca92105ad0a79542e80391..9cd8534587a8039fc1d09fb4e8398ef793287141 100644 (file)
@@ -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
index caa34b28424df0b8bf60a26f38fbbdb13f8cd5f3..7642b349354197cd2f7e9d08c68a3ae302e2421d 100644 (file)
@@ -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
index 03507c93768624f6e3299dbe468c113e074d9298..b8fae2d0d402d4cd1d497841bc528d682414b9cd 100644 (file)
@@ -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
index 31d2a6b0bcf5e8f0c940ccee5c87e028e3df3154..f916e6f4dabf91fe63ddadf05ae6436023d64a1e 100644 (file)
@@ -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
 
index 72fb5475821467b81829c51f50ac4751e0eab170..07af6fe270ca31bb494d29f8e9b9e38a31f77e11 100644 (file)
@@ -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
index 3e6fc6b6c3252c4120218241a2e6cdd36181f5bf..235be68ac667bf220caa09f18230105c79da9ad5 100644 (file)
@@ -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]
index d95b6350f77b69c7d579ffee4fcd295b6cc89ad6..5c112e399f5b0c9d0c421437fbc3b6bc79b030c1 100644 (file)
@@ -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 ***
index 11ae3dd927f31d4bab2ec1d35720249d8f7c26de..a22d47a2cd26a2450e187813dabf8d0ae2610c0f 100644 (file)
@@ -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 ***
index ae400fa848e8d94c2fb3e260a21d70c0323bb6ae..6342eb8e40d41086999ad8295b9443f9d6343fd1 100644 (file)
@@ -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}
index e7f3bcc9f1fff22e5a1a4c567ca3dbfd2c3862b1..4430b615eb5a761e58aa1ba1ba3732be2ce1824c 100644 (file)
@@ -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
index 7a9e154de9334ecaf049e1f2d6cd0b6c1eb0a243..e225af368351b19f6c6ebaa3972f7810cc868829 100644 (file)
@@ -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}
index d56e32e4848eec67e8f71868802462c9edc0666b..9b21516ffd0e4992adcec529306a687ae626ff47 100644 (file)
@@ -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}
index 6956e6ce472761bea7cc4f148fb4b89aacf5d799..d0146177f6517708e9f580e5019c7926dadbb7f5 100644 (file)
@@ -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
 
index 157e736e9e6c3e0b0d827a0f8de23798d5277e9d..90ced470cce727d372ae76773d3e238ef8604bb8 100644 (file)
@@ -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}
index 6956e6ce472761bea7cc4f148fb4b89aacf5d799..116720e8c96768c5d3f2efc8b7925f3dad6ef6ac 100644 (file)
@@ -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
 
index 157e736e9e6c3e0b0d827a0f8de23798d5277e9d..90ced470cce727d372ae76773d3e238ef8604bb8 100644 (file)
@@ -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}
index 143b7c9ccb02b30989d06c1e71e6e08f787890fb..4a47359ae5a6ff2a6beb8624f6db37d78dd37de5 100644 (file)
@@ -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
index 9e735dde9fc50512d8f91544c739e1cafe7aaf6f..dfbab85e3c582908a6b48c3e6fc45ac90a7d9294 100644 (file)
@@ -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
 
index 129e642990016a3967de839970c5de652c473add..b6334ed9b29c8edb5caa067927927d0cf07914cf 100644 (file)
@@ -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
index 1080e741e1e324fcd46e16c418a4633fd83d251f..f33538f448ea0f2c08796ecd7b9b838345997b71 100644 (file)
@@ -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#
index bd5032e2a3beef8c71f619a6506cd6c3adc7da53..d095b03110d9b31bb8163ec786dcf323b30c65f2 100644 (file)
@@ -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
index 9a289883586682e8a6f210c1e4694129ebebf6fa..ac447ccfe231115c8ce21d6815489ce4cb6aba07 100644 (file)
@@ -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}
index ab77cd39152fa2060c309116904ffeeb2f84c7f1..b8947ed0805799abf49d1bf34db2d137a9d2e885 100644 (file)
@@ -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}
index 86961c60a4ad349cbe4c65d502b4d88efe6fd0ae..03b57c6279bc017f1ec65a39fa12e78d78b0e0c4 100644 (file)
@@ -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}
index 862b8e1ecf5e151ebb4d368208a643a8c2817f64..c7445d35f55a3542ca191a5009bb802b57e40ccd 100644 (file)
@@ -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}
index e8567aae71024c897c0e5205820886313abde1ed..3bd4e15766d7f4a3ac9fd022a98fe75bfb51fe9e 100644 (file)
@@ -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":{}}'
index bcfd60119d9f95090898c22ed8c82833e9c02e1e..8a6335f4c0cdf4ef6c934c6eeb033cfeade7e5c7 100644 (file)
@@ -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}
index c980e41a9cbc975c8f4e5f1bde0bc44763cb6483..97a9163e1d2be35173dcf980a670c2ccb7f5e898 100644 (file)
@@ -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}
index 69eaa53a594c76ddc997e0d68110d260253487e2..9cc2df1b8825bd1cc3bb3740b76c2b66368b372f 100644 (file)
@@ -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}
index 3329a39e4b5e5e8afa08618940ad3f32af597090..8b019d6db45085ae4c438a557d09e88795b62455 100644 (file)
@@ -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