*** 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 ***
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,
... 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.
... 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,
... 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,
... 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,
... 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}
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
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}
${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
[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
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}
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}
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}
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}
[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}
[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}
${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
${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
${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]
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 ***
${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
[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
[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
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}
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}
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}
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
[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}
[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}
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}
[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}
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
*** Test Cases ***
Add a flow - Output to physical port#
[Documentation] Push a flow through REST-API
- ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=152 headers=${HEADERS_XML} data=${BODY2}
+ ${resp} RequestsLibrary.Put Request session ${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 session ${RFC8040_NODES_API}/node=openflow%3A1/table=0?content=config
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} 152
Verify after adding flow operational - Output to physical port#
[Documentation] Verify the flow
${elements}= Create List 10.0.20.1
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=152?content=nonconfig ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152?content=nonconfig ${elements}
Remove a flow - Output to physical port#
[Documentation] Remove a flow
- ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=152
+ ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
Should Be Equal As Strings ${resp.status_code} 204
Verify after deleting flow config - Output to physical port#
[Documentation] Verify the flow
- ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=0?content=config
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
Should Be Equal As Strings ${resp.status_code} 200
Should Not Contain ${resp.text} 152
# Standing bug #368 - This has been fixed
Verify after deleting flow operational - Output to physical port#
[Documentation] Verify the flow
${elements}= Create List 10.0.20.1
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=0?content=nonconfig ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=nonconfig ${elements}
*** Test Cases ***
Add a flow - Sending IPv4 Dest Address and Eth type
[Documentation] Push a flow through REST-API
- ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139 headers=${HEADERS_XML} data=${BODY1}
+ ${resp} RequestsLibrary.Put Request session ${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 session ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} 139
Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
[Documentation] Verify the flow
${elements}= Create List 10.0.10.1
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139?content=nonconfig ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig ${elements}
Modify a flow - Output to physical port#
[Documentation] Push a flow through REST-API
- ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139 headers=${HEADERS_XML} data=${BODY2}
+ ${resp} RequestsLibrary.Put Request session ${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
Verify after modifying flow config - Output to physical port#
[Documentation] Verify the flow
- ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} 10.0.20.1
Verify after modifying flow operational - Output to physical port#
[Documentation] Verify the flow
${elements}= Create List 10.0.20.1
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139?content=nonconfig ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139?content=nonconfig ${elements}
Remove a flow - Output to physical port#
[Documentation] Remove a flow
- ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139
+ ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
Should Be Equal As Strings ${resp.status_code} 204
Verify after deleting flow config - Output to physical port#
[Documentation] Verify the flow
- ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=config
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
Should Be Equal As Strings ${resp.status_code} 200
Should Not Contain ${resp.text} 139
Verify after deleting flow operational - Output to physical port#
[Documentation] Verify the flow
${elements}= Create List 10.0.20.1
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=nonconfig ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=nonconfig ${elements}
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 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 Flows In Operational DS After Mininet Reconnects
-/rests/data/opendaylight-inventory:nodes/node=$NODE/table=0
+/rests/data/opendaylight-inventory:nodes/node=$NODE/flow-node-inventory:table=0