From 744758a2a996c3921faed61dfcbcf2589b3e150b Mon Sep 17 00:00:00 2001 From: Sangwook Ha Date: Tue, 23 Nov 2021 01:57:01 -0800 Subject: [PATCH] Add module to the augmented node in the URL path Phosphorus/Sulfur now require module name for augmented data node in the URL path. Update the URLs for OpenFlow Plugin tests to include the module name (flow-node-inventory) for the augmented nodes (table, group). Set the expected status code for add/update/delete flow RPC to 204 when the stream is at least Phosphorus, instead of 200, because the status code for the empty RPC response is 204 since Phosphorus. Add missing stream-specific keywords in CompareStream.robot up to Sulfur. Signed-off-by: Sangwook Ha Change-Id: Ib2dcb163b001cc23becd29dabd1c23a38c479dfb --- csit/libraries/ClusterOpenFlow.robot | 4 +- csit/libraries/CompareStream.robot | 88 ++++++++++++++++++- csit/libraries/FlowLib.robot | 55 +++++++----- .../openflowplugin/Bug_Validation/7335.robot | 2 +- .../010_bundle_resync.robot | 2 +- .../010_Group_Flows.robot | 8 +- .../030_Flow_Update_Test.robot | 4 +- .../010__SM_add_upd_del_flows.robot | 12 +-- .../005__openflow_group.robot | 20 ++--- .../010__openflow_meter.robot | 10 +-- .../MD_SAL_NSF_OF10/040_restconf_frm.robot | 12 +-- .../MD_SAL_NSF_OF13/040_restconf_frm.robot | 18 ++-- .../Reconciliation/010_Group_Flows.robot | 6 +- .../openflowplugin/add-flow/location.uri | 2 +- 14 files changed, 166 insertions(+), 77 deletions(-) diff --git a/csit/libraries/ClusterOpenFlow.robot b/csit/libraries/ClusterOpenFlow.robot index 38c034494a..0fd46fb894 100644 --- a/csit/libraries/ClusterOpenFlow.robot +++ b/csit/libraries/ClusterOpenFlow.robot @@ -13,8 +13,8 @@ Resource ../variables/openflowplugin/Variables.robot *** Variables *** @{SHARD_OPER_LIST} inventory topology default entity-ownership @{SHARD_CONF_LIST} inventory topology default -${config_table_0} ${RFC8040_NODES_API}/node=openflow%3A1/table=0 -${operational_table_0} ${RFC8040_NODES_API}/node=openflow%3A1/table=0?${RFC8040_OPERATIONAL_CONTENT} +${config_table_0} ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0 +${operational_table_0} ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?${RFC8040_OPERATIONAL_CONTENT} ${operational_port_1} ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT} *** Keywords *** diff --git a/csit/libraries/CompareStream.robot b/csit/libraries/CompareStream.robot index 00721e9bc2..148d75c911 100644 --- a/csit/libraries/CompareStream.robot +++ b/csit/libraries/CompareStream.robot @@ -61,19 +61,29 @@ Set_Variable_If_At_Least_Sodium Set_Variable_If_At_Least_Magnesium [Arguments] ${value_if_true} ${value_if_false} - [Documentation] Compare magnesium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is atleast magnesium, return ${value_if_false} otherwise. + [Documentation] Compare magnesium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least magnesium, return ${value_if_false} otherwise. BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least magnesium ${value_if_true} ${value_if_false} Set_Variable_If_At_Least_Aluminium [Arguments] ${value_if_true} ${value_if_false} - [Documentation] Compare aluminium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is atleast aluminium, return ${value_if_false} otherwise. + [Documentation] Compare aluminium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least aluminium, return ${value_if_false} otherwise. BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least aluminium ${value_if_true} ${value_if_false} Set_Variable_If_At_Least_Silicon [Arguments] ${value_if_true} ${value_if_false} - [Documentation] Compare silicon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is atleast silicon, return ${value_if_false} otherwise. + [Documentation] Compare silicon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least silicon, return ${value_if_false} otherwise. BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least silicon ${value_if_true} ${value_if_false} +Set_Variable_If_At_Least_Phosphorus + [Arguments] ${value_if_true} ${value_if_false} + [Documentation] Compare phosphorus to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least phosphorus, return ${value_if_false} otherwise. + BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least phosphorus ${value_if_true} ${value_if_false} + +Set_Variable_If_At_Least_Sulfur + [Arguments] ${value_if_true} ${value_if_false} + [Documentation] Compare sulfur to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least sulfur, return ${value_if_false} otherwise. + BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least sulfur ${value_if_true} ${value_if_false} + Set_Variable_If_At_Most_Carbon [Arguments] ${value_if_true} ${value_if_false} [Documentation] Compare carbon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most carbon, @@ -122,6 +132,24 @@ Set_Variable_If_At_Most_Aluminium ... return ${value_if_false} otherwise. BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most aluminium ${value_if_true} ${value_if_false} +Set_Variable_If_At_Most_Silicon + [Arguments] ${value_if_true} ${value_if_false} + [Documentation] Compare silicon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most silicon, + ... return ${value_if_false} otherwise. + BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most silicon ${value_if_true} ${value_if_false} + +Set_Variable_If_At_Most_Phosphorus + [Arguments] ${value_if_true} ${value_if_false} + [Documentation] Compare phosphorus to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most phosphorus, + ... return ${value_if_false} otherwise. + BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most phosphorus ${value_if_true} ${value_if_false} + +Set_Variable_If_At_Most_Sulfur + [Arguments] ${value_if_true} ${value_if_false} + [Documentation] Compare sulfur to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most sulfur, + ... return ${value_if_false} otherwise. + BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most sulfur ${value_if_true} ${value_if_false} + CompareStream__Convert_Input [Arguments] @{arguments} [Documentation] Splits arguments into args and kwargs is used in Run_Keyword_If_At_Least_Else and Run_Keyword_If_At_Most_Else. @@ -276,6 +304,12 @@ Run_Keyword_If_At_Least_Phosphorus ... run ${kw_name} @{varargs} &{kwargs} and return its value. BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least phosphorus ${kw_name} @{varargs} &{kwargs} +Run_Keyword_If_At_Least_Sulfur + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare sulfur to ${ODL_STREAM} and in case ${ODL_STREAM} is at least sulfur, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least sulfur ${kw_name} @{varargs} &{kwargs} + Run_Keyword_If_At_Most_Carbon [Arguments] ${kw_name} @{varargs} &{kwargs} [Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is at most carbon, @@ -330,6 +364,18 @@ Run_Keyword_If_At_Most_Silicon ... run ${kw_name} @{varargs} &{kwargs} and return its value. BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most silicon ${kw_name} @{varargs} &{kwargs} +Run_Keyword_If_At_Most_Phosphorus + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare phosphorus to ${ODL_STREAM} and in case ${ODL_STREAM} is at most phosphorus, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most phosphorus ${kw_name} @{varargs} &{kwargs} + +Run_Keyword_If_At_Most_Sulfur + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare sulfur to ${ODL_STREAM} and in case ${ODL_STREAM} is at most sulfur, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most sulfur ${kw_name} @{varargs} &{kwargs} + Run_Keyword_If_More_Than_Carbon [Arguments] ${kw_name} @{varargs} &{kwargs} [Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is more than carbon, @@ -378,6 +424,24 @@ Run_Keyword_If_More_Than_Aluminium ... run ${kw_name} @{varargs} &{kwargs} and return its value. BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than aluminium ${kw_name} @{varargs} &{kwargs} +Run_Keyword_If_More_Than_Silicon + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is more than silicon, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than silicon ${kw_name} @{varargs} &{kwargs} + +Run_Keyword_If_More_Than_Phosphorus + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare phosphorus to ${ODL_STREAM} and in case ${ODL_STREAM} is more than phosphorus, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than phosphorus ${kw_name} @{varargs} &{kwargs} + +Run_Keyword_If_More_Than_Sulfur + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare sulfur to ${ODL_STREAM} and in case ${ODL_STREAM} is more than sulfur, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than sulfur ${kw_name} @{varargs} &{kwargs} + Run_Keyword_If_Less_Than_Carbon [Arguments] ${kw_name} @{varargs} &{kwargs} [Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than carbon, @@ -420,8 +484,26 @@ Run_Keyword_If_Less_Than_Magnesium ... run ${kw_name} @{varargs} &{kwargs} and return its value. BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than magnesium ${kw_name} @{varargs} &{kwargs} +Run_Keyword_If_Less_Than_Aluminium + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare aluminium to ${ODL_STREAM} and in case ${ODL_STREAM} is less than aluminium, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than aluminium ${kw_name} @{varargs} &{kwargs} + Run_Keyword_If_Less_Than_Silicon [Arguments] ${kw_name} @{varargs} &{kwargs} [Documentation] Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than silicon, ... run ${kw_name} @{varargs} &{kwargs} and return its value. BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than silicon ${kw_name} @{varargs} &{kwargs} + +Run_Keyword_If_Less_Than_Phosphorus + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare phosphorus to ${ODL_STREAM} and in case ${ODL_STREAM} is less than phosphorus, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than phosphorus ${kw_name} @{varargs} &{kwargs} + +Run_Keyword_If_Less_Than_Sulfur + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare sulfur to ${ODL_STREAM} and in case ${ODL_STREAM} is less than sulfur, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than sulfur ${kw_name} @{varargs} &{kwargs} diff --git a/csit/libraries/FlowLib.robot b/csit/libraries/FlowLib.robot index 819f99db6f..8e5f7e5cd2 100644 --- a/csit/libraries/FlowLib.robot +++ b/csit/libraries/FlowLib.robot @@ -10,8 +10,9 @@ Library ScaleClient.py Library FlowLib.py Library XmlComparator.py Library Common.py -Variables ../variables/Variables.py +Resource CompareStream.robot Resource ../variables/openflowplugin/Variables.robot +Variables ../variables/Variables.py *** Keywords *** Check No Switches In Inventory @@ -107,7 +108,7 @@ Check Number Of Groups Check Flow Stats Are Available [Arguments] ${node_id} ${flows} [Documentation] A GET on the /node=${node_id} inventory API is made and flow stats string is checked for existence. - ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/table=2 + ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=2 Log ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 Should Contain X Times ${resp.text} priority ${flows} @@ -133,7 +134,7 @@ Add Table Miss Flows ${switches}= Convert To Integer ${switches} ${data}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/table_miss_flow.json FOR ${switch} IN RANGE 1 ${switches+1} - TemplatedRequests.Put As Json To Uri ${RFC8040_NODES_API}/node=openflow%3A${switch}/table=0/flow=default ${data} session + TemplatedRequests.Put As Json To Uri ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=default ${data} session END Check Table Miss Flows @@ -141,7 +142,7 @@ Check Table Miss Flows [Documentation] Check table miss flows in switches. ${switches}= Convert To Integer ${switches} FOR ${switch} IN RANGE 1 ${switches+1} - TemplatedRequests.Get As Json From Uri ${RFC8040_NODES_API}/node=openflow%3A${switch}/table=0/flow=default session + TemplatedRequests.Get As Json From Uri ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=default session END Create Inventory Flow @@ -275,10 +276,10 @@ Remove Flow XML Element Add Group To Controller And Verify [Arguments] ${group_body} ${node_id} ${group_id} [Documentation] Push group through REST-API and verify in data-store - ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=${node_id}/group=${group_id} headers=${HEADERS_XML} data=${group_body} + ${resp} RequestsLibrary.Put Request session ${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 session ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}?content=config headers=${ACCEPT_XML} + ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config headers=${ACCEPT_XML} Log ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 Compare Xml ${group_body} ${resp.text} @@ -286,10 +287,10 @@ Add Group To Controller And Verify Add Flow To Controller And Verify [Arguments] ${flow_body} ${node_id} ${table_id} ${flow_id} [Documentation] Push flow through REST-API and verify in data-store - ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id} headers=${HEADERS_XML} data=${flow_body} + ${resp} RequestsLibrary.Put Request session ${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 session ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id}?content=config headers=${ACCEPT_XML} + ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config headers=${ACCEPT_XML} Log ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 Compare Xml ${flow_body} ${resp.text} @@ -307,10 +308,10 @@ Verify Flow On Mininet Switch Remove Group From Controller And Verify [Arguments] ${node_id} ${group_id} [Documentation] Remove group and verify - ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=${node_id}/group=${group_id} + ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id} Log ${resp.text} Should Be Equal As Strings ${resp.status_code} 204 - ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}?content=config + ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config Builtin.Return_From_Keyword_If ${resp.status_code} == 404 or ${resp.status_code} == 409 Builtin.Log ${resp.text} Builtin.Fail The request failed with code ${resp.status_code} @@ -318,10 +319,10 @@ Remove Group From Controller And Verify Remove Flow From Controller And Verify [Arguments] ${node_id} ${table_id} ${flow_id} [Documentation] Remove flow and verify - ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id} + ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} Log ${resp.text} Should Be Equal As Strings ${resp.status_code} 204 - ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id}?content=config + ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config Builtin.Return_From_Keyword_If ${resp.status_code} == 404 or ${resp.status_code} == 409 Builtin.Log ${resp.text} Builtin.Fail The request failed with code ${resp.status_code} @@ -391,7 +392,7 @@ Flow Presence In Config Store [Documentation] Checks the config store for given flow. Returns True if present, otherwise returns False ... This keyword assumes that the global/suite variables are available (${table_id}, ${flow_id} and ${switch_idx} ${headers}= Create Dictionary Accept=application/xml - ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}?content=config headers=${headers} + ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config headers=${headers} Log ${resp} Log ${resp.text} Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY} @@ -404,7 +405,7 @@ Flow Presence In Operational Store [Documentation] Checks the operational store for given flow. Returns True if present, otherwise returns False ... This keyword assumes that the global/suite variables are available (${table_id}, ${flow_id} and ${switch_idx} ${headers}= Create Dictionary Accept=application/xml - ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id} headers=${headers} + ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id} headers=${headers} Log ${resp} Log ${resp.text} Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY} @@ -452,15 +453,17 @@ Add Flow Via RPC ${strxml}= Element To String ${req} ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:add-flow data=${strxml} Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 + ${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 [Arguments] ${node_id} ${table_id} ${flow_body} [Documentation] Configures a flow specified by given flow details (${node_id}, ${table_id}, ${flow_body}) using POST method Log ${flow_body} - ${resp}= RequestsLibrary.Post Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id} data=${flow_body} + ${resp}= RequestsLibrary.Post Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id} data=${flow_body} Log ${resp.text} - ${msg}= Set Variable Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id} failed, http response ${resp.status_code} received. + ${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 @@ -488,15 +491,17 @@ Update Flow Via RPC ${strxml}= Element To String ${xml} ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:update-flow data=${strxml} Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 + ${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 [Arguments] ${node_id} ${table_id} ${flow_id} ${flow_body} [Documentation] Updates a flow configuration by given flow details (${node_id}, ${table_id}, ${flow_body}) using PUT method Log ${flow_body} - ${resp}= RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id} data=${flow_body} + ${resp}= RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} data=${flow_body} Log ${resp.text} - ${msg}= Set Variable Updating flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. + ${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 @@ -514,20 +519,22 @@ Delete Flow Via RPC ${strxml}= Element To String ${req} ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:remove-flow data=${strxml} Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 + ${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 [Arguments] ${node_id} ${table_id} ${flow_id} [Documentation] Deletes a flow from configuration datastore specified by given flow details (${node_id}, ${table_id}, ${flow_body}) using DELETE method - ${resp}= RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id} + ${resp}= RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} Log ${resp.text} - ${msg}= Set Variable Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. + ${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 [Arguments] ${dpnid} ${table_id} ${flow_element} [Documentation] This verifies specific flow-id for particular table-id matching from the flow element - ${resp} = RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${dpnid}/table=${table_id}?content=config + ${resp} = RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${dpnid}/flow-node-inventory:table=${table_id}?content=config BuiltIn.Log ${resp.text} @{flow_id} = String.Get Regexp Matches ${resp.text} id\":\"(\\d+${flow_element}) 1 [Return] @{flow_id}[0] diff --git a/csit/suites/openflowplugin/Bug_Validation/7335.robot b/csit/suites/openflowplugin/Bug_Validation/7335.robot index 9c473e75bf..6098363c5d 100644 --- a/csit/suites/openflowplugin/Bug_Validation/7335.robot +++ b/csit/suites/openflowplugin/Bug_Validation/7335.robot @@ -30,7 +30,7 @@ Update Flow With Invalid Match And Check It Is Not In Operational DS FlowLib.Update Flow Via Restconf ${switch_idx} ${table_id} ${flow_id} ${data} FlowLib.Check Config Flow ${True} ${data} BuiltIn.Wait Until Keyword Succeeds 10s 1s Utils.No Content From URI session - ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}?content=nonconfig + ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=nonconfig [Teardown] Report_Failure_Due_To_Bug 7335 *** Keywords *** diff --git a/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot b/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot index 51238730bd..1f1a170512 100644 --- a/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot +++ b/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot @@ -115,4 +115,4 @@ Push Groups Via Restcall ${node_id} BuiltIn.Set Variable openflow%3A${switch_idx} ${group_id} BuiltIn.Set Variable ${GROUP_ID[${index}]} FlowLib.Add Group To Controller And Verify ${GROUP_BODY} ${node_id} ${group_id} - Wait Until Keyword Succeeds 5s 1s Utils.Get URI And Verify ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}?content=nonconfig + Wait Until Keyword Succeeds 5s 1s Utils.Get URI And Verify ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=nonconfig diff --git a/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot b/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot index 7dde5d13e9..9458cd99bf 100644 --- a/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot +++ b/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot @@ -400,9 +400,9 @@ Remove Single Group And Flow On Member [Documentation] Remove 1 group 1&2 and 1 flow in every switch. ${session} = Resolve_Http_Session_For_Member member_index=${member_index} FOR ${switch} IN RANGE 1 ${switches+1} - RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/table=0/flow=1 - RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/group=1 - RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/group=1000 + RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1 + RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1 + RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000 END Check Flow Stats Are Not Frozen @@ -419,7 +419,7 @@ Extract Flow Duration [Arguments] ${member_index} [Documentation] Extract duration for flow 1 in switch 1. ${session} = Resolve_Http_Session_For_Member member_index=${member_index} - ${resp} RequestsLibrary.Get Request ${session} ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=1?content=nonconfig headers=${headers} + ${resp} RequestsLibrary.Get Request ${session} ${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} ${flow_list} = Collections.Get_From_Dictionary ${json_resp} flow-node-inventory:flow diff --git a/csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot b/csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot index 3ed3b61ac7..b6836def75 100644 --- a/csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot +++ b/csit/suites/openflowplugin/Flows_Additional_TCs/030_Flow_Update_Test.robot @@ -54,7 +54,7 @@ Final Phase Delete Flow [Documentation] Removes used flow - ${resp}= RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} + ${resp}= RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} Log ${resp.content} - ${msg}= Set Variable Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. + ${msg}= Set Variable Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. Should Be Equal As Strings ${resp.status_code} 200 msg=${msg} diff --git a/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot b/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot index 25f3b73f1c..85b34e9061 100644 --- a/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot +++ b/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot @@ -217,7 +217,7 @@ Check Config Flow Presence Flow Presence Config Flow ${headers}= Create Dictionary Accept=application/xml - ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} headers=${headers} + ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} headers=${headers} Log ${resp} Log ${resp.content} Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY} @@ -237,7 +237,7 @@ Check Operational Table Presence Flow Presence Operational Table ${headers}= Create Dictionary Accept=application/xml - ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}?${RFC8040_OPERATIONAL_CONTENT} headers=${headers} + ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}?${RFC8040_OPERATIONAL_CONTENT} headers=${headers} Log ${resp} Log ${resp.content} Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY} @@ -247,13 +247,13 @@ Flow Presence Operational Table Add Flow Log ${data} - ${resp}= RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/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}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. + ${resp}= RequestsLibrary.Put Request session ${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} Delete Flow - ${resp}= RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} - ${msg}= Set Variable Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received. + ${resp}= RequestsLibrary.Delete Request 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} Delete All Flows diff --git a/csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot b/csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot index 4aa0189096..746581b9fc 100644 --- a/csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot +++ b/csit/suites/openflowplugin/Groups_Meters_OF13/005__openflow_group.robot @@ -29,13 +29,13 @@ Add a group [Tags] Push ${body} OperatingSystem.Get File ${GROUP} Set Suite Variable ${body} - ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT}/group=1 headers=${HEADERS_XML} data=${body} + ${resp} RequestsLibrary.Put Request session ${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 session ${REST_CONTEXT}/group=1?${RFC8040_CONFIG_CONTENT} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} ${GROUP_NAME} @@ -44,21 +44,21 @@ Verify after adding group operational [Documentation] Get the group stat in operational ${elements}= Create List group-statistics ref-count packet-count byte-count buckets ... weight group-select - Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/group=1?${RFC8040_OPERATIONAL_CONTENT} ${elements} + Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_OPERATIONAL_CONTENT} ${elements} Add a flow that includes a group [Documentation] Push a flow through RESTCONF [Tags] Push ${body} OperatingSystem.Get File ${FLOW} Set Suite Variable ${body} - ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT}/table=0/flow=1 headers=${HEADERS_XML} data=${body} + ${resp} RequestsLibrary.Put Request session ${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 session ${REST_CONTEXT}/table=0/flow=1?${RFC8040_CONFIG_CONTENT} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} ${FLOW_NAME} @@ -66,28 +66,28 @@ Verify after adding flow config Verify after adding flow operational [Documentation] Verify the flow ${elements}= Create List group-action group-id - Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/table=0/flow=1?${RFC8040_OPERATIONAL_CONTENT} ${elements} + Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_OPERATIONAL_CONTENT} ${elements} Remove the flow [Documentation] Remove the flow - ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/table=0/flow=1 + ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1 Should Be Equal As Strings ${resp.status_code} 200 Verify after deleting flow [Documentation] Verify the flow removal [Tags] Get - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/table=0/flow=1?${RFC8040_CONFIG_CONTENT} + ${resp} RequestsLibrary.Get Request session ${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}/group=1 + ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:group=1 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 session ${REST_CONTEXT}/group=1?${RFC8040_CONFIG_CONTENT} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT} Should Not Contain ${resp.content} ${GROUP_NAME} diff --git a/csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot b/csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot index 40152def47..d6289dd366 100644 --- a/csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot +++ b/csit/suites/openflowplugin/Groups_Meters_OF13/010__openflow_meter.robot @@ -51,14 +51,14 @@ Add a flow that includes a meter [Tags] Push ${body} OperatingSystem.Get File ${FLOW} Set Suite Variable ${body} - ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT}/table=0/flow=2 headers=${HEADERS_XML} data=${body} + ${resp} RequestsLibrary.Put Request session ${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 session ${REST_CONTEXT}/table=0/flow=2?${RFC8040_CONFIG_CONTENT} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 Should Contain ${resp.content} ${FLOW_NAME} @@ -66,17 +66,17 @@ Verify after adding flow config Verify after adding flow operational [Documentation] Verify the flow ${elements}= Create List meter-id flow - Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/table=0/flow=2?${RFC8040_OPERATIONAL_CONTENT} ${elements} + Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_OPERATIONAL_CONTENT} ${elements} Remove the flow [Documentation] Remove the flow - ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/table=0/flow=2 + ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2 Should Be Equal As Strings ${resp.status_code} 200 Verify after deleting flow [Documentation] Verify the flow removal [Tags] Get - ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/table=0/flow=2?${RFC8040_CONFIG_CONTENT} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT} Should Not Contain ${resp.content} ${FLOW_NAME} Delete the meter diff --git a/csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot b/csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot index 7514ad5f49..a052f3f637 100644 --- a/csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot +++ b/csit/suites/openflowplugin/MD_SAL_NSF_OF10/040_restconf_frm.robot @@ -15,28 +15,28 @@ ${BODY2} 22