Variables ../variables/Variables.py
*** Variables ***
-${ADD_BULK_CONFIG_NODES_API} /restconf/operations/sal-bulk-flow:flow-test
-${GET_BULK_CONFIG_NODES_API} /restconf/operations/sal-bulk-flow:read-flow-test
-${ADD_TABLE_NODEs_API} /restconf/operations/sal-bulk-flow:table-test
+${ADD_BULK_CONFIG_NODES_API} /rests/operations/sal-bulk-flow:flow-test
+${GET_BULK_CONFIG_NODES_API} /rests/operations/sal-bulk-flow:read-flow-test
+${ADD_TABLE_NODEs_API} /rests/operations/sal-bulk-flow:table-test
${jolokia_write_op_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/WriteOpStatus
${jolokia_read_op_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/ReadOpStatus
${jolokia_flow_count_status} /jolokia/read/org.opendaylight.openflowplugin.applications.bulk.o.matic:type=FlowCounter/FlowCount
Resource ../variables/Variables.robot
*** Variables ***
-${ENTITY_OWNER_URI} restconf/operational/entity-owners:entity-owners
${RESTCONF_URI} rests
${GC_LOG_PATH} ${KARAF_HOME}/data/log
${JAVA_HOME} ${EMPTY} # releng/builder scripts should provide correct value
Wait Until Keyword Succeeds 5s 1s Check_Json_Member_List_Or_All uri=${uri} expected_data=${data} member_index_list=${member_index_list}
[Return] ${response_text}
+Put_As_Json_And_Check_Member_List_Or_All_RFC8040
+ # FIXME: merge this keyword with Bierman02 version above when OVSDB test is migrated to RFC8040
+ [Arguments] ${uri} ${data} ${member_index} ${member_index_list}=${EMPTY}
+ [Documentation] Send a PUT with the supplied uri ${uri} and body ${data} to member ${member_index}.
+ ... Then check data is replicated in all or some members defined in ${member_index_list}.
+ ${response_text} = Put_As_Json_To_Member uri=${uri} data=${data} member_index=${member_index}
+ Wait Until Keyword Succeeds 5s 1s Check_Json_Member_List_Or_All uri=${uri}?content=config expected_data=${data} member_index_list=${member_index_list}
+ [Return] ${response_text}
+
Put_As_Json_To_Member
[Arguments] ${uri} ${data} ${member_index}
[Documentation] Send a PUT with the supplied uri and data to member ${member_index}.
Resource MininetKeywords.robot
Resource Utils.robot
Variables ../variables/Variables.py
+Resource ../variables/openflowplugin/Variables.robot
*** Variables ***
@{SHARD_OPER_LIST} inventory topology default entity-ownership
@{SHARD_CONF_LIST} inventory topology default
-${config_table_0} ${CONFIG_NODES_API}/node/openflow:1/table/0
-${operational_table_0} ${OPERATIONAL_NODES_API}/node/openflow:1/table/0
-${operational_port_1} ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1
+${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}
+${operational_port_1} ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT}
*** Keywords ***
Get InventoryConfig Shard Status
... Inventory should show 1x node_id per device 1x node_id per connector. Topology should show 2x node_id per device + 3x node_id per connector
... + 5x node_id per link termination. TODO: A Keyword that can calculate this based on mininet topology.
${dictionary} Create Dictionary openflow:1=4 openflow:2=5 openflow:3=5
- Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${OPERATIONAL_NODES_API} dictionary=${dictionary} member_index_list=${controller_index_list}
+ Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${RFC8040_OPERATIONAL_NODES_API} dictionary=${dictionary} member_index_list=${controller_index_list}
${dictionary} Create Dictionary openflow:1=21 openflow:2=19 openflow:3=19
Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${OPERATIONAL_TOPO_API} dictionary=${dictionary} member_index_list=${controller_index_list}
[Arguments] ${controller_index_list}=${EMPTY}
[Documentation] Check device is not in operational inventory or topology in all cluster instances in ${controller_index_list}.
${dictionary} Create Dictionary openflow=0
- CompareStream.Run_Keyword_If_At_Least_Neon Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_No_Content_Member_List_Or_All uri=${OPERATIONAL_NODES_API} member_index_list=${controller_index_list}
- CompareStream.Run_Keyword_If_At_Most_Fluorine Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${OPERATIONAL_NODES_API} dictionary=${dictionary}
+ CompareStream.Run_Keyword_If_At_Least_Neon Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_No_Content_Member_List_Or_All uri=${RFC8040_OPERATIONAL_NODES_API} member_index_list=${controller_index_list}
+ CompareStream.Run_Keyword_If_At_Most_Fluorine Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${RFC8040_OPERATIONAL_NODES_API} dictionary=${dictionary}
... member_index_list=${controller_index_list}
${dictionary} Create Dictionary openflow=0
- Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${OPERATIONAL_TOPO_API} dictionary=${dictionary} member_index_list=${controller_index_list}
+ Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${RFC8040_OPERATIONAL_TOPO_API} dictionary=${dictionary} member_index_list=${controller_index_list}
Add Sample Flow And Verify
[Arguments] ${controller_index} ${controller_index_list}=${EMPTY}
# replicating some of the matches in the flows section. Same comment applies for further keywords.
Run Keyword If '${ODL_OF_PLUGIN}' == 'helium' Set Test Variable &{dictionary} 10.0.1.0/24=2 "output-node-connector":"1"=1
Run Keyword If '${ODL_OF_PLUGIN}' == 'lithium' Set Test Variable &{dictionary} 10.0.1.0/24=1 "output-node-connector":"1"=1
- ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All ${config_table_0}/flow/1 ${body} ${controller_index} ${controller_index_list}
+ ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All_RFC8040 ${config_table_0}/flow=1 ${body} ${controller_index} ${controller_index_list}
Wait Until Keyword Succeeds 15s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${operational_table_0} dictionary=${dictionary} member_index_list=${controller_index_list}
Verify Sample Flow
${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/sample_flow_2.json
Run Keyword If '${ODL_OF_PLUGIN}' == 'helium' Set Test Variable &{dictionary} 10.0.1.0/24=2 "output-node-connector":"2"=1
Run Keyword If '${ODL_OF_PLUGIN}' == 'lithium' Set Test Variable &{dictionary} 10.0.1.0/24=1 "output-node-connector":"2"=1
- ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All ${config_table_0}/flow/1 ${body} ${controller_index} ${controller_index_list}
+ ClusterManagement.Put_As_Json_And_Check_Member_List_Or_All_RFC8040 ${config_table_0}/flow=1 ${body} ${controller_index} ${controller_index_list}
Wait Until Keyword Succeeds 15s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${operational_table_0} dictionary=${dictionary} member_index_list=${controller_index_list}
Delete Sample Flow And Verify
[Arguments] ${controller_index} ${controller_index_list}=${EMPTY}
[Documentation] Delete sample flow in Owner and verify it gets removed from all instances.
${dictionary}= Create Dictionary 10.0.1.0/24=0
- ClusterManagement.Delete_And_Check_Member_List_Or_All ${config_table_0}/flow/1 ${controller_index} ${controller_index_list}
+ ClusterManagement.Delete_And_Check_Member_List_Or_All ${config_table_0}/flow=1 ${controller_index} ${controller_index_list}
Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${operational_table_0} dictionary=${dictionary} member_index_list=${controller_index_list}
Send RPC Add Sample Flow And Verify
${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/add_flow_rpc.json
Run Keyword If '${ODL_OF_PLUGIN}' == 'helium' Set Test Variable &{dictionary} 10.0.1.0/24=2
Run Keyword If '${ODL_OF_PLUGIN}' == 'lithium' Set Test Variable &{dictionary} 10.0.1.0/24=1
- ClusterManagement.Post_As_Json_To_Member uri=/restconf/operations/sal-flow:add-flow data=${body} member_index=${controller_index}
+ ClusterManagement.Post_As_Json_To_Member uri=/rests/operations/sal-flow:add-flow data=${body} member_index=${controller_index}
Wait Until Keyword Succeeds 15s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${operational_table_0} dictionary=${dictionary} member_index_list=${controller_index_list}
Send RPC Delete Sample Flow And Verify
[Documentation] Delete sample flow in ${controller_index} and verify it gets removed from all instances in ${controller_index_list}.
${body}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/delete_flow_rpc.json
${dictionary}= Create Dictionary 10.0.1.0/24=0
- ClusterManagement.Post_As_Json_To_Member uri=/restconf/operations/sal-flow:remove-flow data=${body} member_index=${controller_index}
+ ClusterManagement.Post_As_Json_To_Member uri=/rests/operations/sal-flow:remove-flow data=${body} member_index=${controller_index}
Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${operational_table_0} dictionary=${dictionary} member_index_list=${controller_index_list}
Take OpenFlow Device Link Down and Verify
[Arguments] ${switches} ${member_index}=1
[Documentation] Check Linear topology.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_TOPO_API}
+ ${resp} RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
[Arguments] ${switches} ${member_index}=1
[Documentation] Check no switch is in topology
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_TOPO_API}
+ ${resp} RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
[Arguments] ${flows} ${member_index}=1
[Documentation] Check number of flows in the inventory.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp}= RequestsLibrary.Get Request ${session} ${OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "priority"
[Arguments] ${groups} ${member_index}=1
[Documentation] Check number of groups in the inventory.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp}= RequestsLibrary.Get Request ${session} ${OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${group_count}= Get Count ${resp.text} "group-type"
Library RequestsLibrary
Variables ../variables/Variables.py
Resource ./Utils.robot
+Resource ../variables/openflowplugin/Variables.robot
*** Keywords ***
Check DIDM Registered With Device
[Documentation] Check for DIDM registered with the device
- ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
Should Be Equal As Strings ${resp.status_code} 200
Log ${resp.text}
Should Contain ${resp.text} didm
*** Keywords ***
Get Model Dump
- [Arguments] ${controller_ip} ${data_models}=@{internal_data_models}
+ [Arguments] ${controller_ip} ${data_models}=@{internal_data_models} ${restconf_root}=restconf
[Documentation] Will output a list of mdsal models using ${data_models} list
# 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
# pass a timeout to restconf
Create Session model_dump_session http://${controller_ip}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} timeout=1 max_retries=0
FOR ${model} IN @{data_models}
- ${resp}= RequestsLibrary.Get Request model_dump_session restconf/${model}
+ ${resp}= RequestsLibrary.Get Request model_dump_session ${restconf_root}/${model}
${pretty_output}= To Json ${resp.text} pretty_print=True
Log ${pretty_output}
END
Library XmlComparator.py
Library Common.py
Variables ../variables/Variables.py
+Resource ../variables/openflowplugin/Variables.robot
*** Keywords ***
Check No Switches In Inventory
[Arguments] ${switches}
[Documentation] Check no switch is in inventory
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.text}
FOR ${switch} IN RANGE 1 ${switches+1}
Should Not Contain ${resp.text} "openflow:${switch}"
Check No Switches In Topology
[Arguments] ${switches}
[Documentation] Check no switch is in topology
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
[Arguments] ${switches}
[Documentation] Check all switches and stats in operational inventory
FOR ${switch} IN RANGE 1 ${switches+1}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}/node/openflow:${switch}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} flow-capable-node-connector-statistics
Check Switches In Topology
[Arguments] ${switches}
[Documentation] Check switches are in the topology.
- ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "node-id":"openflow:
Check Number Of Links
[Arguments] ${links}
[Documentation] Check number of links in the topolgy.
- ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "link-id":"openflow:
Check Linear Topology
[Arguments] ${switches}
[Documentation] Check Linear topology.
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
Check Number Of Flows
[Arguments] ${flows}
[Documentation] Check number of flows in the inventory.
- ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "priority"
Check Number Of Groups
[Arguments] ${groups}
[Documentation] Check number of groups in the inventory.
- ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${group_count}= Get Count ${resp.text} "group-type"
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 ${OPERATIONAL_NODES_API}/node/${node_id}/table/2
+ [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
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain X Times ${resp.text} priority ${flows}
Check Number Of Hosts
[Arguments] ${hosts}
[Documentation] Check number of hosts in topology
- ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "node-id":"host:
Check No Hosts
[Documentation] Check if all hosts are deleted from inventory
- ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
Should Be Equal As Strings ${resp.status_code} 200
Should Not Contain ${resp.text} "node-id":"host:
${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 ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/default ${data} session
+ TemplatedRequests.Put As Json To Uri ${RFC8040_NODES_API}/node=openflow%3A${switch}/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 ${OPERATIONAL_NODES_API}/node/openflow:${switch}/table/0/flow/default session
+ TemplatedRequests.Get As Json From Uri ${RFC8040_NODES_API}/node=openflow%3A${switch}/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 ${CONFIG_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}/group=${group_id} headers=${HEADERS_XML} data=${group_body}
Log ${resp.text}
BuiltIn.Should_Match "${resp.status_code}" "20?"
- ${resp} RequestsLibrary.Get Request session ${CONFIG_NODES_API}/node/${node_id}/group/${group_id} headers=${ACCEPT_XML}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/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 ${CONFIG_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}/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 ${CONFIG_NODES_API}/node/${node_id}/table/${table_id}/flow/${flow_id} headers=${ACCEPT_XML}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=${node_id}/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 ${CONFIG_NODES_API}/node/${node_id}/group/${group_id}
+ ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
- ${resp} RequestsLibrary.Get Request session ${CONFIG_NODES_API}/node/${node_id}/group/${group_id}
+ 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
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 ${CONFIG_NODES_API}/node/${node_id}/table/${table_id}/flow/${flow_id}
+ ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=${node_id}/table=${table_id}/flow=${flow_id}
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
- ${resp} RequestsLibrary.Get Request session ${CONFIG_NODES_API}/node/${node_id}/table/${table_id}/flow/${flow_id}
+ 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
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}
Log Flow XML is ${flow.xml}
write dpctl dump-flows -O OpenFlow13
${switchoutput} Read Until >
- ${headers}= Create Dictionary Content-Type=application/yang.data+xml
- ${resp} RequestsLibrary.Post Request session restconf/operations/sal-flow:remove-flow data=${flow.xml} headers=${headers}
+ ${headers}= Create Dictionary Content-Type=application/yang-data+xml
+ ${resp} RequestsLibrary.Post Request session rests/operations/sal-flow:remove-flow data=${flow.xml} headers=${headers}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- ${resp}= RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.text}
Should Not Contain ${resp.text} "output-node-connector": "CONTROLLER",
${strings_to_check_for}= Create List CONTROLLER
[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 ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} headers=${headers}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/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 ${OPERATIONAL_NODES_API}/node/openflow:${switch_idx}/table/${table_id} headers=${headers}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id} headers=${headers}
Log ${resp}
Log ${resp.text}
Return From Keyword If ${resp.status_code}!=200 ${False} ${EMPTY}
Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory
Log Element ${req}
${strxml}= Element To String ${req}
- ${resp}= RequestsLibrary.Post Request session /restconf/operations/sal-flow:add-flow data=${strxml}
+ ${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
[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 ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id} data=${flow_body}
+ ${resp}= RequestsLibrary.Post Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id} data=${flow_body}
Log ${resp.text}
- ${msg}= Set Variable Adding flow for ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 204 msg=${msg}
+ ${msg}= Set Variable Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/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
[Arguments] ${node_id} ${configured_flow_body} ${updating_flow_body}
Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory
Log Element ${xml}
${strxml}= Element To String ${xml}
- ${resp}= RequestsLibrary.Post Request session /restconf/operations/sal-flow:update-flow data=${strxml}
+ ${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
[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 ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id} data=${flow_body}
+ ${resp}= RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id} data=${flow_body}
Log ${resp.text}
- ${msg}= Set Variable Updating flow for ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
+ ${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.
+ Should Be Equal As Strings ${resp.status_code} 204 msg=${msg}
Delete Flow Via RPC
[Arguments] ${node_id} ${xmlroot}
Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory
Log Element ${req}
${strxml}= Element To String ${req}
- ${resp}= RequestsLibrary.Post Request session /restconf/operations/sal-flow:remove-flow data=${strxml}
+ ${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
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 ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id}
+ ${resp}= RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A${node_id}/table=${table_id}/flow=${flow_id}
Log ${resp.text}
- ${msg}= Set Variable Delete flow for ${CONFIG_NODES_API}/node/openflow:${node_id}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
+ ${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.
+ 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 ${CONFIG_NODES_API}/node/openflow:${dpnid}/table/${table_id}
+ ${resp} = RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${dpnid}/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]
Resource Tcpdump.robot
Resource Utils.robot
Resource ../variables/Variables.robot
+Resource ../variables/openflowplugin/Variables.robot
Resource ../variables/netvirt/Variables.robot
Variables ../variables/netvirt/Modules.py
Verify Expected Default Tables On Nodes
[Arguments] ${node_ips}=@{OS_ALL_IPS}
[Documentation] Verify if Default Table Entries are programmed on all Nodes
- ${resp} = RequestsLibrary.Get Request session ${CONFIG_NODES_API}
+ ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_NODES_API}
Utils.Log Content ${resp.text}
${failed_node_list} = BuiltIn.Create List
FOR ${node_ip} IN @{node_ips}
_spreads = ["gauss", "linear", "first"] # possible defined spreads at the moment
_default_flow_template_json = { # templease used for config datastore
- u"flow": [
+ "flow": [
{
- u"hard-timeout": 65000,
- u"idle-timeout": 65000,
- u"cookie_mask": 4294967295,
- u"flow-name": u"FLOW-NAME-TEMPLATE",
- u"priority": 2,
- u"strict": False,
- u"cookie": 0,
- u"table_id": 0,
- u"installHw": False,
- u"id": u"FLOW-ID-TEMPLATE",
- u"match": {
- u"ipv4-destination": u"0.0.0.0/32",
- u"ethernet-match": {u"ethernet-type": {u"type": 2048}},
+ "hard-timeout": 65000,
+ "idle-timeout": 65000,
+ "cookie_mask": 4294967295,
+ "flow-name": "FLOW-NAME-TEMPLATE",
+ "priority": 2,
+ "strict": False,
+ "cookie": 0,
+ "table_id": 0,
+ "installHw": False,
+ "id": "FLOW-ID-TEMPLATE",
+ "match": {
+ "ipv4-destination": "0.0.0.0/32",
+ "ethernet-match": {"ethernet-type": {"type": 2048}},
},
- u"instructions": {
- u"instruction": [
+ "instructions": {
+ "instruction": [
{
- u"order": 0,
- u"apply-actions": {
- u"action": [{u"drop-action": {}, u"order": 0}]
- },
+ "order": 0,
+ "apply-actions": {"action": [{"drop-action": {}, "order": 0}]},
}
]
},
fl1 = flows[0]
sw, tab, fl, ip = fl1
url = "http://" + cntl + ":" + "8181"
- url += "/restconf/config/opendaylight-inventory:nodes/node/openflow:" + str(sw)
- url += "/table/" + str(tab) + "/flow/" + str(fl)
+ url += "/rests/data/opendaylight-inventory:nodes/node=openflow%3A" + str(sw)
+ url += "/table=" + str(tab) + "/flow=" + str(fl)
flow = copy.deepcopy(template["flow"][0])
flow["cookie"] = fl
flow["flow-name"] = "TestFlow-%d" % fl
req = requests.Request(
"PUT",
url,
- headers={"Content-Type": "application/json"},
+ headers={"Content-Type": "application/yang-data+json"},
data=req_data,
auth=("admin", "admin"),
)
sw, tab, fl, ip = fl1
url = "http://" + cntl + ":" + "8181"
url += (
- "/restconf/config/opendaylight-inventory:nodes/node/openflow:"
+ "/rests/data/opendaylight-inventory:nodes/node=openflow%3A"
+ str(sw)
- + "/table/"
+ + "/table="
+ str(tab)
)
fdets = []
req = requests.Request(
"POST",
url,
- headers={"Content-Type": "application/json"},
+ headers={"Content-Type": "application/yang-data+json"},
data=req_data,
auth=("admin", "admin"),
)
fl1 = flows[0]
sw, tab, fl, ip = fl1
url = "http://" + cntl + ":" + "8181"
- url += "/restconf/config/opendaylight-inventory:nodes/node/openflow:" + str(sw)
- url += "/table/" + str(tab) + "/flow/" + str(fl)
+ url += "/rests/data/opendaylight-inventory:nodes/node=openflow%3A" + str(sw)
+ url += "/table=" + str(tab) + "/flow=" + str(fl)
req = requests.Request(
"DELETE",
url,
- headers={"Content-Type": "application/json"},
+ headers={"Content-Type": "application/yang-data+json"},
auth=("admin", "admin"),
)
return req
"""
f1 = flows[0]
sw, tab, fl, ip = f1
- url = "http://" + cntl + ":" + "8181/restconf/operations/sal-bulk-flow:" + method
+ url = "http://" + cntl + ":" + "8181/rests/operations/sal-bulk-flow:" + method
fdets = []
for sw, tab, fl, ip in flows:
flow = copy.deepcopy(template["input"]["bulk-flow-item"][0])
req = requests.Request(
"POST",
url,
- headers={"Content-Type": "application/json"},
+ headers={"Content-Type": "application/yang-data+json"},
data=req_data,
auth=("admin", "admin"),
)
"""
f1 = flows[0]
sw, tab, fl, ip = f1
- url = "http://" + cntl + ":" + "8181/restconf/operations/sal-bulk-flow:" + method
+ url = "http://" + cntl + ":" + "8181/rests/operations/sal-bulk-flow:" + method
fdets = []
for sw, tab, fl, ip in flows:
flow = copy.deepcopy(template["input"]["bulk-flow-item"][0])
req = requests.Request(
"POST",
url,
- headers={"Content-Type": "application/json"},
+ headers={"Content-Type": "application/yang-data+json"},
data=req_data,
auth=("admin", "admin"),
)
try:
rsp = ses.send(prep, timeout=5)
except requests.exceptions.Timeout:
+ print(f"*WARN* Timeout: {req.method} {req.url}")
counter[99] += 1
+ if counter[99] > 10:
+ print("*ERROR* Too many timeouts.")
+ break
continue
+ else:
+ if rsp.status_code not in [200, 201, 204]:
+ print(
+ f"*WARN* Status code {rsp.status_code}: {req.method} {req.url}\n{rsp.text}"
+ )
counter[rsp.status_code] += 1
res = {}
for i, v in enumerate(counter):
url = (
"http://"
+ controller
- + ":8181/restconf/operational/opendaylight-inventory:nodes"
+ + ":8181/rests/data/opendaylight-inventory:nodes?content=nonconfig"
)
rsp = requests.get(
url,
- headers={"Accept": "application/json"},
+ headers={"Accept": "application/yang-data+json"},
stream=False,
auth=("admin", "admin"),
)
if rsp.status_code != 200:
return None
inv = json.loads(rsp.content)
- if "nodes" not in inv:
+ if "opendaylight-inventory:nodes" not in inv:
return None
- if "node" not in inv["nodes"]:
+ if "node" not in inv["opendaylight-inventory:nodes"]:
return []
- inv = inv["nodes"]["node"]
+ inv = inv["opendaylight-inventory:nodes"]["node"]
switches = [sw for sw in inv if "openflow:" in sw["id"]]
return switches
Resource ${CURDIR}/SSHKeywords.robot
Resource ${CURDIR}/TemplatedRequests.robot
Resource ${CURDIR}/../variables/Variables.robot
+Resource ${CURDIR}/../variables/openflowplugin/Variables.robot
*** Variables ***
# TODO: Introduce ${tree_size} and use instead of 1 in the next line.
[Arguments] ${node} ${session}=session
[Documentation] A GET on the /node/${node} API is made and specific flow stat
... strings are checked for existence.
- ${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_NODES_API}/node/${node}
+ ${resp} RequestsLibrary.Get Request ${session} ${RFC8040_NODES_API}/node=${node}?${RFC8040_OPERATIONAL_CONTENT}
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
[Documentation] Will execute any tests to verify the controller is not having any null pointer eceptions.
Check Karaf Log File Does Not Have Messages ${controller_ip} java.lang.NullPointerException
+Verify Controller Has No Runtime Exceptions
+ [Arguments] ${controller_ip}=${ODL_SYSTEM_IP}
+ [Documentation] Will execute any tests to verify the controller is not having any runtime eceptions.
+ Check Karaf Log File Does Not Have Messages ${controller_ip} java.lang.RuntimeException
+
Get Epoch Time
[Arguments] ${time}
[Documentation] Get the Epoc time from MM/DD/YYYY HH:MM:SS
def _parse_stdout(stdout):
- """ Transforms stdout to dict """
+ """Transforms stdout to dict"""
text = stdout.replace(" ", "")
text = text.replace("\r", "")
pat = re.compile(r"(?P<key>\w+):(?P<value>.+)")
Return From Keyword If '${status}' == 'FAIL' ${status} Controller is dead ${host_discover_time}
${status} ${result} BuiltIn.Run Keyword And Ignore Error Utils.Verify Controller Has No Null Pointer Exceptions ${ODL_SYSTEM_IP}
Return From Keyword If '${status}' == 'FAIL' ${status} Controller has NPE ${host_discover_time}
+ ${status} ${result} BuiltIn.Run Keyword And Ignore Error Utils.Verify Controller Has No Runtime Exceptions ${ODL_SYSTEM_IP}
+ Return From Keyword If '${status}' == 'FAIL' ${status} Controller has RuntimeException ${topology_discover_time}
Log To Console Check number of hosts in topology is ${hosts}
${status} ${result} BuiltIn.Run Keyword And Ignore Error Wait Until Keyword Succeeds ${hosts} 2s FlowLib.Check Number Of Hosts
... ${hosts}
Resource MininetKeywords.robot
Resource KarafKeywords.robot
Resource ../variables/Variables.robot
+Resource ../variables/openflowplugin/Variables.robot
*** Variables ***
${log_level} ERROR
Return From Keyword If '${status}' == 'FAIL' ${status} Controller is dead ${topology_discover_time}
${status} ${result} Run Keyword And Ignore Error Utils.Verify Controller Has No Null Pointer Exceptions ${ODL_SYSTEM_IP}
Return From Keyword If '${status}' == 'FAIL' ${status} Controller has NPE ${topology_discover_time}
+ ${status} ${result} Run Keyword And Ignore Error Utils.Verify Controller Has No Runtime Exceptions ${ODL_SYSTEM_IP}
+ Return From Keyword If '${status}' == 'FAIL' ${status} Controller has RuntimeException ${topology_discover_time}
Log To Console Checking ${switches} switches
${status} ${result} Run Keyword And Ignore Error Wait Until Keyword Succeeds ${switches*2} 2s FlowLib.Check Switches In Inventory
... ${switches}
Return From Keyword If '${status}' == 'FAIL' ${status} Controller is dead ${topology_discover_time}
${status} ${result} Run Keyword And Ignore Error Utils.Verify Controller Has No Null Pointer Exceptions ${ODL_SYSTEM_IP}
Return From Keyword If '${status}' == 'FAIL' ${status} Controller has NPE ${topology_discover_time}
+ ${status} ${result} Run Keyword And Ignore Error Utils.Verify Controller Has No Runtime Exceptions ${ODL_SYSTEM_IP}
+ Return From Keyword If '${status}' == 'FAIL' ${status} Controller has RuntimeException ${topology_discover_time}
Log To Console Checking ${switches} switches
${status} ${result} Run Keyword And Ignore Error Wait Until Keyword Succeeds 30s 2s FlowLib.Check Switches In Inventory
... ${switches}
Workflow Teardown
[Documentation] Cleanup when workflow is interrupt
- Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
+ Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
Utils.Clean Mininet System
RequestsLibrary.Delete All Sessions
Suite Teardown Delete All Sessions
Library RequestsLibrary
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
Variables ../../../variables/Variables.py
*** Variables ***
*** Test Cases ***
Check Stats for node 1
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:1
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A1
Check Stats for node 2
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:2
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A2
Check Stats for node 3
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:3
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A3
Check No Host Is Present
[Documentation] Get the invnetory, should not contain any host address
@{list} Create List ${IP_1} ${IP_2} ${IP_3}
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_NODES_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_OPERATIONAL_NODES_API} ${list}
Ping All
[Documentation] Pingall, verify no packet loss
Check node 1 addresses
[Documentation] Get the address observations for node 1
@{list} Create List ${IP_2} ${IP_3}
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1 ${IP_1} 1
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_NODES_API}/node/openflow:1 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1?content=nonconfig ${IP_1} 1
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A1?content=nonconfig ${list}
Check node 2 addresses
[Documentation] Get the address observations for node 2
@{list} Create List ${IP_1} ${IP_3}
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2 ${IP_2} 1
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_NODES_API}/node/openflow:2 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_NODES_API}/node=openflow%3A2?content=nonconfig ${IP_2} 1
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A2?content=nonconfig ${list}
Check node 3 addresses
[Documentation] Get the address observations for node 3
@{list} Create List ${IP_1} ${IP_2}
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:3 ${IP_3} 1
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_NODES_API}/node/openflow:3 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_NODES_API}/node=openflow%3A3?content=nonconfig ${IP_3} 1
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A3?content=nonconfig ${list}
*** Keywords ***
Ping All Works Good
Library Collections
Library RequestsLibrary
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
Variables ../../../variables/Variables.py
*** Variables ***
*** Test Cases ***
Check Stats for node 1
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:1
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A1
Check Stats for node 2
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:2
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A2
Check Stats for node 3
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:3
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A3
Check Flows
[Documentation] Check all flows are present
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} "output-node-connector" 21
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} "output-node-connector" 21
Ping All Test
[Documentation] Ping all, verify no packet loss or duplicates
Suite Teardown Delete All Sessions
Library RequestsLibrary
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
Variables ../../../variables/Variables.py
*** Variables ***
*** Test Cases ***
Check Stats for node 1
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:1
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A1
Check Stats for node 2
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:2
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A2
Check Stats for node 3
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:3
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A3
Check Switch Links
[Documentation] Get the topology and check links
Write link s1 h1 down
Read Until mininet>
@{list} Create List "link-down":true
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?content=nonconfig ${list}
@{list} Create List ${MAC_1}
Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
Write link s1 h1 up
Read Until mininet>
@{list} Create List "link-down":false
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?content=nonconfig ${list}
Write pingall
Read Until mininet>
Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_TOPO_API} "node-id":"host:${MAC_1}" 1
Write sh ovs-vsctl add-port s1 s1-eth1 -- set interface s1-eth1 ofport=1
Read Until mininet>
@{list} Create List "link-down":false
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?content=nonconfig ${list}
Write pingall
Read Until mininet>
Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_TOPO_API} "node-id":"host:${MAC_1}" 1
Suite Teardown Utils.Stop Mininet
Library RequestsLibrary
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
Variables ../../../variables/Variables.py
*** Variables ***
*** Test Cases ***
Check Stats for node 1
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:1
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A1
Check Stats for node 2
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:2
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A2
Check Stats for node 3
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:3
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A3
Check Ports
[Documentation] Check all ports are present
@{list} Create List openflow:1:1 openflow:1:2 openflow:1:3 openflow:2:1 openflow:2:2
... openflow:2:3 openflow:3:1 openflow:3:2 openflow:3:3
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${list}
Check Ports STP status
[Documentation] Check the stp status of the ports (forwarding/discarding)
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} ${FORWARD} 4
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} ${DISCARD} 2
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${FORWARD} 4
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${DISCARD} 2
Check Flows
[Documentation] Check all flows are present
[Tags] bug 6984 bug
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} "output-node-connector" 16
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} "output-node-connector" 16
[Teardown] Report_Failure_Due_To_Bug 6984
Ping Test
Write link s1 s2 down
Read Until mininet>
@{list} Create List ${DISCARD}
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_NODES_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_OPERATIONAL_NODES_API} ${list}
Wait Until Keyword Succeeds 10s 2s Ping Works Good
Link Up
[Tags] exclude
Write link s1 s2 up
Read Until mininet>
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} ${FORWARD} 4
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} ${DISCARD} 2
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${FORWARD} 4
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${DISCARD} 2
# This sleep is needed because if the ping in the below WUKS is launched before the STP effectively removes the link,
# it produces a packet storm in mininet that makes the test unresponsive.
Sleep 1
[Tags] exclude
Write sh ovs-vsctl add-port s1 s1-eth2 -- set interface s1-eth2 ofport=2
Read Until mininet>
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} ${FORWARD} 4
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} ${DISCARD} 2
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${FORWARD} 4
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${DISCARD} 2
# This sleep is needed because if the ping in the below WUKS is launched before the STP effectively removes the link,
# it produces a packet storm in mininet that makes the test unresponsive.
Sleep 1
Resource ../../../libraries/MininetKeywords.robot
Resource ../../../libraries/FlowLib.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${XmlsDir} ${CURDIR}/../../../variables/xmls
BuiltIn.Wait Until Keyword Succeeds 10s 1s FlowLib.Check Datastore Presence ${flowfile} ${True} ${True}
... ${False} ${True}
Sleep 8
- [Teardown] BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
+ [Teardown] BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
Resource ../../../libraries/MininetKeywords.robot
Resource ../../../libraries/FlowLib.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${XmlsDir} ${CURDIR}/../../../variables/xmls
Final Phase
[Documentation] Stops mininet.
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
RequestsLibrary.Delete All Sessions
Resource ../../../libraries/MininetKeywords.robot
Resource ../../../libraries/FlowLib.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${XmlsDir} ${CURDIR}/../../../variables/xmls
FlowLib.Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile2}
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 ${OPERATIONAL_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+ 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
[Teardown] Report_Failure_Due_To_Bug 7335
*** Keywords ***
Final Phase
[Documentation] Stops mininet.
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
RequestsLibrary.Delete All Sessions
Resource ../../../libraries/MininetKeywords.robot
Resource ../../../libraries/FlowLib.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${XmlsDir} ${CURDIR}/../../../variables/xmls
Final Phase
[Documentation] Stops mininet.
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
RequestsLibrary.Delete All Sessions
Resource ../../../libraries/FlowLib.robot
Resource ../../../libraries/OVSDB.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${ODL_OF_PORT1} 6653
Final Phase
[Documentation] Stops mininet.
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
RequestsLibrary.Delete All Sessions
Resource ../../../variables/Variables.robot
Resource ../../../variables/netvirt/Variables.robot
Resource ../../../libraries/DataModels.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${XMLSDIR} ${CURDIR}/../../../../csit/variables/openflowplugin
@{GROUP_ID} 1 2 3
${FLAG_MSG} "bundle-based-reconciliation-enabled configuration property was changed to 'true'"
${STATIC_FLOW} table=91
-@{DATA_MODELS} config/opendaylight-inventory:nodes operational/opendaylight-inventory:nodes
+@{DATA_MODELS} data/opendaylight-inventory:nodes?${RFC8040_CONFIG_CONTENT} data/opendaylight-inventory:nodes?${RFC8040_OPERATIONAL_CONTENT}
*** Test Cases ***
TC01_Reconciliation check after switch restart
End Suite
[Documentation] Run at end of the suite
- RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
+ RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
KarafKeywords.Issue_Command_On_Karaf_Console log:set INFO org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeReconciliationImpl
SSHLibrary.Close All Connections
Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set-controller ${INTEGRATION_BRIDGE} tcp:${ODL_SYSTEM_IP}:6653
Utils.Run Command On Remote System ${ip} sudo ovs-vsctl set bridge ${INTEGRATION_BRIDGE} protocols=OpenFlow13
- Wait Until Keyword Succeeds 20s 2s DataModels.Get Model Dump ${ODL_SYSTEM_IP} ${DATA_MODELS}
+ Wait Until Keyword Succeeds 20s 2s DataModels.Get Model Dump ${ODL_SYSTEM_IP} ${DATA_MODELS} ${RFC8040_RESTCONF_ROOT}
Push Static Flow
[Arguments] ${ip}
Push Groups Via Restcall
[Arguments] ${switch_idx} ${index}
${GROUP_BODY} OperatingSystem.Get File ${XMLSDIR}/${GROUPFILE[${index}]}
- ${node_id} BuiltIn.Set Variable openflow:${switch_idx}
+ ${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 ${OPERATIONAL_NODES_API}/node/${node_id}/group/${group_id}
+ Wait Until Keyword Succeeds 5s 1s Utils.Get URI And Verify ${RFC8040_NODES_API}/node=${node_id}/group=${group_id}?content=nonconfig
Resource ../../../libraries/Utils.robot
Resource ../../../libraries/OvsManager.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${SWITCHES} 3
[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 ${CONFIG_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
RequestsLibrary.Delete All Sessions
Add Groups And Flows 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} ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1
- RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/group/1
- RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000
+ 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
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} ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/1 headers=${headers}
+ ${resp} RequestsLibrary.Get Request ${session} ${RFC8040_NODES_API}/node=openflow%3A1/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
${START_CMD} sudo mn --topo linear,${SWITCHES}
@{CONTROLLER_NODES} ${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP}
@{cntls_idx_list} ${1} ${2} ${3}
+${ENTITY_OWNER_URI} rests/data/entity-owners:entity-owners
*** Test Cases ***
Start Mininet To All Nodes
Check No Device Owners In Controller
[Documentation] Check there is no owners in controllers
${session} = Resolve_Http_Session_For_Member member_index=${active_member}
+ # FIXME: The URI only works for Silicon & earlier versions. This should be replaced with new RPC calls for Phosphorus.
${data} = TemplatedRequests.Get_As_Json_From_Uri uri=${ENTITY_OWNER_URI} session=${session}
#ofp-topology-manager entity is introduced in the OPNFLWPLUG-1022 bug fix, and this entity will
#always be present in the EOS output. All 3 controller nodes will be candidate, so EOS output will
Variables ../../../variables/ofplugin/RpcVariables.py
*** Variables ***
-${send_barrier_url} /restconf/operations/flow-capable-transaction:send-barrier
-${send_echo_url} /restconf/operations/sal-echo:send-echo
+${send_barrier_url} /rests/operations/flow-capable-transaction:send-barrier
+${send_echo_url} /rests/operations/sal-echo:send-echo
*** Test Cases ***
Sending Barrier
Variables ../../../variables/ofplugin/RpcVariables.py
*** Variables ***
-${send_update_table_url} /restconf/operations/sal-table:update-table
+${send_update_table_url} /rests/operations/sal-table:update-table
${start} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo tree,1 --switch user
*** Test Cases ***
Library SSHLibrary
Resource ../../../libraries/Utils.robot
Resource ../../../libraries/FlowLib.robot
+Resource ../../../variables/openflowplugin/Variables.robot
Variables ../../../variables/Variables.py
Library ../../../libraries/XmlComparator.py
Delete Flow
[Documentation] Removes used flow
- ${resp}= RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+ ${resp}= RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
Log ${resp.content}
- ${msg}= Set Variable Delete flow for ${CONFIG_NODES_API}/node/openflow:${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}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
# Lets wait for ofp to collect stats
END
${flows}= Get Length ${flowlist0}
- Wait Until Keyword Succeeds 30s 2s FlowLib.Check Flow Stats Are Available openflow:1 ${flows}
+ Wait Until Keyword Succeeds 30s 2s FlowLib.Check Flow Stats Are Available openflow%3A1 ${flows}
# Show switch content (for debug purposes if needed)
Write dpctl dump-flows -O OpenFlow13
Read Until mininet>
# Lets wait for ofp to collect stats
END
${flows}= Get Length ${flowlist0}
- Wait Until Keyword Succeeds 30s 2s FlowLib.Check Flow Stats Are Available openflow:1 ${flows}
+ Wait Until Keyword Succeeds 30s 2s FlowLib.Check Flow Stats Are Available openflow%3A1 ${flows}
# Show switch content (for debug purposes if needed)
Write dpctl dump-flows -O OpenFlow13
Read Until mininet>
Library Collections
Library XML
Library ../../../libraries/XmlComparator.py
-Variables ../../../variables/Variables.py
Library RequestsLibrary
Library ../../../libraries/Common.py
+Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${XmlsDir} ${CURDIR}/../../../variables/xmls
Flow Presence Config Flow
${headers}= Create Dictionary Accept=application/xml
- ${resp}= RequestsLibrary.Get Request session /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} headers=${headers}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/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 /restconf/operational/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id} headers=${headers}
+ ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/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 /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} headers=${HEADERS_XML} data=${data}
- ${msg}= Set Variable Adding flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${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}/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.
Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
Delete Flow
- ${resp}= RequestsLibrary.Delete Request session /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
- ${msg}= Set Variable Delete flow for /restconf/config/opendaylight-inventory:nodes/node/openflow:${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}/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.
Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
Delete All Flows
Library RequestsLibrary
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
Resource ../../../libraries/Utils.robot
*** Variables ***
-${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes/
-${REST_CONTEXT_CF} /restconf/config/opendaylight-inventory:nodes/node/openflow:1
-${REST_CONTEXT_OP} /restconf/operational/opendaylight-inventory:nodes/node/openflow:1
+${REST_CONTEXT} ${RFC8040_NODES_API}/node=openflow%3A1
${GROUP} ${CURDIR}/../../../variables/xmls/g4.xml
${FLOW} ${CURDIR}/../../../variables/xmls/f50.xml
${GROUP_NAME} Foo
Get list of nodes
[Documentation] Get the inventory to make sure openflow:1 comes up
${node_list}= Create List openflow:1
- Wait Until Keyword Succeeds 90s 1s Check For Elements At URI ${REST_CONTEXT_OP} ${node_list}
+ Wait Until Keyword Succeeds 90s 1s Check For Elements At URI ${REST_CONTEXT}?${RFC8040_OPERATIONAL_CONTENT} ${node_list}
Add a group
[Documentation] Add a group using RESTCONF
[Tags] Push
${body} OperatingSystem.Get File ${GROUP}
Set Suite Variable ${body}
- ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT_CF}/group/1 headers=${HEADERS_XML} data=${body}
+ ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT}/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_CF}/group/1
+ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/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_OP}/group/1 ${elements}
+ Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/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_CF}/table/0/flow/1 headers=${HEADERS_XML} data=${body}
+ ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT}/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_CF}/table/0/flow/1
+ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/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_OP}/table/0/flow/1 ${elements}
+ Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/table=0/flow=1?${RFC8040_OPERATIONAL_CONTENT} ${elements}
Remove the flow
[Documentation] Remove the flow
- ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT_CF}/table/0/flow/1
+ ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/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_CF}/table/0/flow/1
+ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/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_CF}/group/1
+ ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/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_CF}/group/1
+ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/group=1?${RFC8040_CONFIG_CONTENT}
Should Not Contain ${resp.content} ${GROUP_NAME}
Library RequestsLibrary
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
Resource ../../../libraries/Utils.robot
*** Variables ***
-${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes/
-${REST_CONTEXT_CF} /restconf/config/opendaylight-inventory:nodes/node/openflow:1
-${REST_CONTEXT_OP} /restconf/operational/opendaylight-inventory:nodes/node/openflow:1
+${REST_CONTEXT} ${RFC8040_NODES_API}/node=openflow%3A1
${METER} ${CURDIR}/../../../variables/xmls/m4.xml
${FLOW} ${CURDIR}/../../../variables/xmls/f51.xml
${METER_NAME} Foo
Get list of nodes
[Documentation] Get the inventory to make sure openflow:1 comes up
${node_list}= Create List openflow:1
- Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${REST_CONTEXT_OP} ${node_list}
+ Wait Until Keyword Succeeds 3s 1s Check For Elements At URI ${REST_CONTEXT}?${RFC8040_OPERATIONAL_CONTENT} ${node_list}
Add a meter
[Documentation] Add a meter using RESTCONF
[Tags] Push
${body} OperatingSystem.Get File ${METER}
Set Suite Variable ${body}
- ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT_CF}/meter/1 headers=${HEADERS_XML} data=${body}
+ ${resp} RequestsLibrary.Put Request session ${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_CF}/meter/1
+ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${METER_NAME}
[Documentation] Get the meter stat in operational
${elements}= Create List meter-statistics meter-kbps flow-count packet-in-count byte-in-count
... meter-band-stats meter-band-headers
- Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT_OP}/meter/1 ${elements}
+ Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/meter=1?${RFC8040_OPERATIONAL_CONTENT} ${elements}
Add a flow that includes a meter
[Documentation] Push a flow through RESTCONF
[Tags] Push
${body} OperatingSystem.Get File ${FLOW}
Set Suite Variable ${body}
- ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT_CF}/table/0/flow/2 headers=${HEADERS_XML} data=${body}
+ ${resp} RequestsLibrary.Put Request session ${REST_CONTEXT}/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_CF}/table/0/flow/2
+ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/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_OP}/table/0/flow/2 ${elements}
+ Wait Until Keyword Succeeds 6s 2s Check For Elements At URI ${REST_CONTEXT}/table=0/flow=2?${RFC8040_OPERATIONAL_CONTENT} ${elements}
Remove the flow
[Documentation] Remove the flow
- ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT_CF}/table/0/flow/2
+ ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/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_CF}/table/0/flow/2
+ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/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_CF}/meter/1
+ ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/meter=1
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_CF}/meter/1
+ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT}
Should Not Contain ${resp.content} ${METER_NAME}
Library RequestsLibrary
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
-${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
*** Test Cases ***
Get list of nodes
Get nodeconnector for the root node
[Documentation] Get the inventory for the root node
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:1
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
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}
*** Keywords ***
Check Every Nodes
[Arguments] ${numnodes}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${IND} IN RANGE 1 ${numnodes+1}
Should Contain ${resp.text} openflow:${IND}
Check Every Nodes Stats
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 1 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} flow-capable-node-connector-statistics
Check Every Nodes Nodeconnector
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 2 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.text}
Library RequestsLibrary
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
-${REST_CONTEXT} /restconf/operational/network-topology:network-topology/topology/flow:1
*** Test Cases ***
Get Nodes Count
${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
- Wait Until Keyword Succeeds 60s 2s Verify Element Count ${REST_CONTEXT} node ${numnodes}
+ Wait Until Keyword Succeeds 60s 2s Verify Element Count ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} node ${numnodes}
Get Links Count
[Documentation] Checks the number of links
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
${numlinks} Evaluate (${numnodes}-1)*2
- Wait Until Keyword Succeeds 60s 2s Verify Element Count ${REST_CONTEXT} link ${numlinks}
+ Wait Until Keyword Succeeds 60s 2s Verify Element Count ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} link ${numlinks}
*** Keywords ***
Verify Element Count
[Arguments] ${URI} ${xpath_location} ${expected_count}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} headers=${ACCEPT_XML}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Element Count ${resp.text} xpath=${xpath_location}
Library RequestsLibrary
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
-${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
*** Test Cases ***
Get list of nodes
Get nodeconnector for the root node
[Documentation] Get the inventory for the root node
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:1
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
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}
*** Keywords ***
Check Every Nodes
[Arguments] ${numnodes}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${IND} IN RANGE 1 ${numnodes+1}
Should Contain ${resp.text} openflow:${IND}
Check Every Nodes Stats
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 1 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} flow-capable-node-connector-statistics
Check Every Nodes Nodeconnector
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 2 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.text}
Library RequestsLibrary
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
-${REST_CONTEXT} /restconf/operational/network-topology:network-topology/topology/flow:1
*** Test Cases ***
Get Nodes Count
${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
- Wait Until Keyword Succeeds 60s 2s Verify Element Count ${REST_CONTEXT} node ${numnodes}
+ Wait Until Keyword Succeeds 60s 2s Verify Element Count ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} node ${numnodes}
Get Links Count
[Documentation] Checks the number of links
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
${numlinks} Evaluate (${numnodes}-1)*2
- Wait Until Keyword Succeeds 60s 2s Verify Element Count ${REST_CONTEXT} link ${numlinks}
+ Wait Until Keyword Succeeds 60s 2s Verify Element Count ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} link ${numlinks}
*** Keywords ***
Verify Element Count
[Arguments] ${URI} ${xpath_location} ${expected_count}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} headers=${ACCEPT_XML}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Element Count ${resp.text} xpath=${xpath_location}
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${VENDOR} Nicira, Inc.
*** Test Cases ***
Get list of nodes
[Documentation] Get the inventory
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${node_list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${node_list}
Check No Link Down
[Documentation] Check there is no link down. We have 8 ports in total: s1=2, s2=3, s3=3.
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} "link-down":false 8
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} "link-down":false 8
[Teardown] Report_Failure_Due_To_Bug 6595
Get node 1 inventory
[Documentation] Get the inventory for a node
${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:1:1
... openflow:1:2
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT} ${list}
Get node 2 inventory
[Documentation] Get the inventory for a node
${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:2:1
... openflow:2:2 openflow:2:3
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A2?${RFC8040_OPERATIONAL_CONTENT} ${list}
Get node 3 inventory
[Documentation] Get the inventory for a node
${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:3:1
... openflow:3:2 openflow:3:3
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:3 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A3?${RFC8040_OPERATIONAL_CONTENT} ${list}
Link Down
[Documentation] Take link s1-s2 down
Write link s1 s2 down
Read Until mininet>
@{list} Create List "link-down":true
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT} ${list}
Link Up
[Documentation] Take link s1-s2 up
Write link s1 s2 up
Read Until mininet>
@{list} Create List "link-down":false
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT} ${list}
Remove Port
[Documentation] Remove port s2-eth1
Write sh ovs-vsctl del-port s2 s2-eth1
Read Until mininet>
@{list} Create List openflow:2:1
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_NODES_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_OPERATIONAL_NODES_API} ${list}
Add Port
[Documentation] Add port s2-eth1, new id 4
Write sh ovs-vsctl add-port s2 s2-eth1
Read Until mininet>
@{list} Create List openflow:2:4
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${list}
Library RequestsLibrary
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
Resource ../../../libraries/Utils.robot
*** Variables ***
*** Test Cases ***
Get RESTCONF Topology
[Documentation] Get RESTCONF Topology and validate the result.
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${node_list}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_TOPO_API} ${node_list}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
List all the links
Write sh ovs-vsctl del-port s2 s2-eth2
Read Until mininet>
@{list} Create List openflow:2:2
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_OPERATIONAL_TOPO_API} ${list}
Add Port
[Documentation] Add port s2-eth2, new id 5
Write sh ovs-vsctl add-port s2 s2-eth2
Read Until mininet>
@{list} Create List openflow:2:5
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_TOPO_API} ${list}
*** Keywords ***
Verify Links
[Arguments] ${expected_links}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}/topology/flow:1
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${result} To JSON ${resp.text}
Log ${result}
- ${content} Get From Dictionary ${result} topology
+ ${content} Get From Dictionary ${result} network-topology:topology
${topology} Get From List ${content} 0
${links} Get From Dictionary ${topology} link
FOR ${expected_link} IN @{expected_links}
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
@{node_list} openflow:1 openflow:2 openflow:3
*** Test Cases ***
Get Stats for all nodes
[Documentation] Get the stats for all nodes
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${node_list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${node_list}
Get Stats for node 1
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:1
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A1
Get Stats for node 2
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:2
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A2
Get Stats for node 3
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:3
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A3
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${BODY2} <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.20.1/32</ipv4-destination></match><id>152</id><table_id>0</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>openflow:1:1</output-node-connector></output-action></action></apply-actions></instruction></instructions></flow>
*** Test Cases ***
Add a flow - Output to physical port#
[Documentation] Push a flow through REST-API
- ${resp} RequestsLibrary.Put Request session ${CONFIG_NODES_API}/node/openflow:1/table/0/flow/152 headers=${HEADERS_XML} data=${BODY2}
+ ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${CONFIG_NODES_API}/node/openflow:1/table/0
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/152 ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=0/flow=152?content=nonconfig ${elements}
Remove a flow - Output to physical port#
[Documentation] Remove a flow
- ${resp} RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:1/table/0/flow/152
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${CONFIG_NODES_API}/node/openflow:1/table/0
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${OPERATIONAL_NODES_API}/node/openflow:1/table/0 ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=0?content=nonconfig ${elements}
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${VENDOR} Nicira, Inc.
*** Test Cases ***
Get list of nodes
[Documentation] Get the inventory
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${node_list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${node_list}
Check No Link Down
[Documentation] Check there is no link down. We have 8 ports in total: s1=2, s2=3, s3=3.
- Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${OPERATIONAL_NODES_API} "link-down":false 8
+ Wait Until Keyword Succeeds 10s 2s Check For Specific Number Of Elements At URI ${RFC8040_OPERATIONAL_NODES_API} "link-down":false 8
Get node 1 inventory
[Documentation] Get the inventory for a node
${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:1:1
... openflow:1:2
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT} ${list}
Get node 2 inventory
[Documentation] Get the inventory for a node
${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:2:1
... openflow:2:2 openflow:2:3
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A2?${RFC8040_OPERATIONAL_CONTENT} ${list}
Get node 3 inventory
[Documentation] Get the inventory for a node
${list} Create List @{SW_CAPABILITIES} ${SW_VENDOR} ${SW_IPADDRESS} ${SW_HARDWARE} openflow:3:1
... openflow:3:2 openflow:3:3
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:3 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A3?${RFC8040_OPERATIONAL_CONTENT} ${list}
Link Down
[Documentation] Take link s1-s2 down
Write link s1 s2 down
Read Until mininet>
@{list} Create List "link-down":true
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT} ${list}
Link Up
[Documentation] Take link s1-s2 up
Write link s1 s2 up
Read Until mininet>
@{list} Create List "link-down":false
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${list}
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3 ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/node-connector=openflow%3A1%3A1?${RFC8040_OPERATIONAL_CONTENT} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A2/node-connector=openflow%3A2%3A3?${RFC8040_OPERATIONAL_CONTENT} ${list}
Remove Port
[Documentation] Remove port s2-eth1
Write sh ovs-vsctl del-port s2 s2-eth1
Read Until mininet>
@{list} Create List openflow:2:1
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_NODES_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_OPERATIONAL_NODES_API} ${list}
Add Port
[Documentation] Add port s2-eth1, new id 4
Write sh ovs-vsctl add-port s2 s2-eth1
Read Until mininet>
@{list} Create List openflow:2:4
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${list}
Library RequestsLibrary
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
Resource ../../../libraries/Utils.robot
*** Variables ***
*** Test Cases ***
Get RESTCONF Topology
[Documentation] Get RESTCONF Topology and validate the result.
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${node_list}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_TOPO_API} ${node_list}
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
List all the links
[Tags] exclude
Write sh ovs-vsctl del-port s2 s2-eth2
Read Until mininet>
- @{list} Create List openflow:2:2
- Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
+ @{list} Create List openflow%3A2%3A2
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_OPERATIONAL_TOPO_API} ${list}
Add Port
[Documentation] Add port s2-eth2, new id 5
[Tags] exclude
Write sh ovs-vsctl add-port s2 s2-eth2
Read Until mininet>
- @{list} Create List openflow:2:5
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
+ @{list} Create List openflow%3A2%3A5
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_TOPO_API} ${list}
*** Keywords ***
Verify Links
[Arguments] ${expected_links}
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API}/topology/flow:1
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${result} To JSON ${resp.text}
Log ${result}
- ${content} Get From Dictionary ${result} topology
+ ${content} Get From Dictionary ${result} network-topology:topology
${topology} Get From List ${content} 0
${links} Get From Dictionary ${topology} link
FOR ${expected_link} IN @{expected_links}
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
@{node_list} openflow:1 openflow:2 openflow:3
*** Test Cases ***
Get Stats for all nodes
[Documentation] Get the stats for all nodes
- Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${OPERATIONAL_NODES_API} ${node_list}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_OPERATIONAL_NODES_API} ${node_list}
Get Stats for node 1
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:1
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A1
Get Stats for node 2
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:2
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A2
Get Stats for node 3
[Documentation] Get the stats for a node
- Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow:3
+ Wait Until Keyword Succeeds 10s 2s Check Nodes Stats openflow%3A3
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${BODY1} <flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.10.1/32</ipv4-destination></match><id>139</id><table_id>2</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><dec-nw-ttl/></action></apply-actions></instruction></instructions></flow>
*** Test Cases ***
Add a flow - Sending IPv4 Dest Address and Eth type
[Documentation] Push a flow through REST-API
- ${resp} RequestsLibrary.Put Request session ${CONFIG_NODES_API}/node/openflow:1/table/2/flow/139 headers=${HEADERS_XML} data=${BODY1}
+ ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${CONFIG_NODES_API}/node/openflow:1/table/2
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${OPERATIONAL_NODES_API}/node/openflow:1/table/2/flow/139 ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/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 ${CONFIG_NODES_API}/node/openflow:1/table/2/flow/139 headers=${HEADERS_XML} data=${BODY2}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.Put Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${CONFIG_NODES_API}/node/openflow:1/table/2
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${OPERATIONAL_NODES_API}/node/openflow:1/table/2/flow/139 ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=2/flow=139?content=nonconfig ${elements}
Remove a flow - Output to physical port#
[Documentation] Remove a flow
- ${resp} RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:1/table/2/flow/139
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.Delete Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${CONFIG_NODES_API}/node/openflow:1/table/2
+ ${resp} RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A1/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 ${OPERATIONAL_NODES_API}/node/openflow:1/table/2 ${elements}
+ Wait Until Keyword Succeeds 10s 2s Check For Elements Not At URI ${RFC8040_NODES_API}/node=openflow%3A1/table=2?content=nonconfig ${elements}
Library XML
Library Process
Library RequestsLibrary
-Resource ../../../libraries/Utils.robot
Variables ../../../variables/Variables.py
+Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${switches} 25
Are Switches Connected
[Arguments] ${switches}
[Documentation] Checks Topology Contains a fix number ${switches} of switces.
- ${resp}= RequestsLibrary.Get Request tcsession /restconf/operational/network-topology:network-topology/topology/flow:1 headers=${ACCEPT_XML}
+ ${resp}= RequestsLibrary.Get Request tcsession ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.content}
${count}= XML.Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${switches}
Library Collections
Library XML
Library SSHLibrary
-Variables ../../../../csit/variables/Variables.py
Library RequestsLibrary
Library ../../../../csit/libraries/Common.py
Library ../../../../csit/libraries/ScaleClient.py
+Variables ../../../../csit/variables/Variables.py
+Resource ../../../../csit/variables/openflowplugin/Variables.robot
*** Variables ***
${swnr} 17
${flnr} 17000
${swspread} gauss
${tabspread} gauss
-${topourl} /restconf/operational/network-topology:network-topology/topology/flow:1
-${invurl} /restconf/operational/opendaylight-inventory:nodes
@{cntls} ${ODL_SYSTEM_IP}
*** Test Cases ***
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session /restconf/operational/network-topology:network-topology/topology/flow:1 headers=${ACCEPT_XML}
+ ${resp}= Get Request session ${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}
Library Collections
Library XML
Library SSHLibrary
-Variables ../../../../csit/variables/Variables.py
Library RequestsLibrary
Library ../../../../csit/libraries/Common.py
Library ../../../../csit/libraries/ScaleClient.py
+Variables ../../../../csit/variables/Variables.py
+Resource ../../../../csit/variables/openflowplugin/Variables.robot
*** Variables ***
${swnr} 17
${flnr} 17000
${swspread} linear
${tabspread} linear
-${topourl} /restconf/operational/network-topology:network-topology/topology/flow:1
-${invurl} /restconf/operational/opendaylight-inventory:nodes
@{cntls} ${ODL_SYSTEM_IP}
*** Test Cases ***
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session /restconf/operational/network-topology:network-topology/topology/flow:1 headers=${ACCEPT_XML}
+ ${resp}= Get Request session ${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}
Library Collections
Library XML
Library SSHLibrary
-Variables ../../../../csit/variables/Variables.py
Library RequestsLibrary
Library ../../../../csit/libraries/Common.py
Library ../../../../csit/libraries/ScaleClient.py
+Variables ../../../../csit/variables/Variables.py
+Resource ../../../../csit/variables/openflowplugin/Variables.robot
*** Variables ***
${swnr} 17
${flnr} 17000
${swspread} first
${tabspread} first
-${topourl} /restconf/operational/network-topology:network-topology/topology/flow:1
-${invurl} /restconf/operational/opendaylight-inventory:nodes
@{cntls} ${ODL_SYSTEM_IP}
*** Test Cases ***
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session /restconf/operational/network-topology:network-topology/topology/flow:1 headers=${ACCEPT_XML}
+ ${resp}= Get Request session ${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}
Library Collections
Library XML
Library SSHLibrary
-Variables ../../../../csit/variables/Variables.py
Library RequestsLibrary
Library ../../../../csit/libraries/Common.py
Library ../../../../csit/libraries/ScaleClient.py
+Variables ../../../../csit/variables/Variables.py
+Resource ../../../../csit/variables/openflowplugin/Variables.robot
*** Variables ***
${swnr} 17
${flnr} 17000
${swspread} linear
${tabspread} first
-${topourl} /restconf/operational/network-topology:network-topology/topology/flow:1
-${invurl} /restconf/operational/opendaylight-inventory:nodes
@{cntls} ${ODL_SYSTEM_IP}
*** Test Cases ***
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session /restconf/operational/network-topology:network-topology/topology/flow:1 headers=${ACCEPT_XML}
+ ${resp}= Get Request session ${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}
Library RequestsLibrary
Library ../../../libraries/Common.py
Library ../../../libraries/ScaleClient.py
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${swnr} 16
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 Request session ${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}
Should Be True ${res}
Check No Switches Inventory
- ${resp}= Get Request session ${OPERATIONAL_NODES_API}
+ ${resp}= Get Request session ${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.content}
Should Be Equal As Strings '${resp.content}' '{"nodes":{}}'
Library ../../../libraries/Common.py
Library ../../../libraries/ScaleClient.py
Resource ../../../libraries/WaitForFailure.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${swnr} 32
${res}= Configure Flows Bulk flow_details=${flows} controllers=@{cntls} nrthreads=${nrthreads} fpr=${fpr}
Log ${res}
Set Suite Variable ${flows}
- ${http204ok}= Create List ${204}
- ${validation}= Validate Responses ${res} ${http204ok}
+ ${http201ok}= Create List ${201}
+ ${validation}= Validate Responses ${res} ${http201ok}
Should Be True ${validation}
[Teardown] Save Setup Time setuptime ${starttime}
Deconfigure Flows
[Documentation] Flows deconfiguration
- ${resp}= Delete Request session ${CONFIG_NODES_API}
- Should Be Equal As Numbers ${resp.status_code} 200
+ ${resp}= Delete Request session ${RFC8040_NODES_API}
+ Should Be Equal As Numbers ${resp.status_code} 204
Check No Flows In Operational Last
[Documentation] Operational datastore to be without any flows
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 Request session ${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}
Library OperatingSystem
Library XML
Library SSHLibrary
-Variables ../../../variables/Variables.py
Library RequestsLibrary
Library ../../../libraries/Common.py
Library ../../../libraries/ScaleClient.py
+Variables ../../../variables/Variables.py
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${swnr} 63
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 Request session ${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}
Resource ../../../libraries/MininetKeywords.robot
Resource ../../../libraries/ClusterManagement.robot
Resource ../../../libraries/ClusterOpenFlow.robot
+Resource ../../../variables/openflowplugin/Variables.robot
Variables ../../../variables/Variables.py
*** Variables ***
Delete All Flows
[Documentation] 100K Flows deleted and verify.
${config_datastore_delete_start_time}= DateTime.Get Current Date result_format=timestamp
- ClusterManagement.Delete From Member ${CONFIG_NODES_API} 1
+ ClusterManagement.Delete From Member ${RFC8040_NODES_API} 1
${config_datastore_delete_end_time}= Get Current Date result_format=timestamp
${config_datastore_delete_time}= Subtract Date From Date ${config_datastore_delete_end_time} ${config_datastore_delete_start_time}
${config_datastore_delete_rate}= Evaluate ${flow_count} / ${config_datastore_delete_time}
Delete All Flows From Follower Node2
[Documentation] 100K Flows deleted via Follower Node2 and verify it gets applied in all instances.
${config_datastore_delete_start_time}= Get Current Date result_format=timestamp
- ClusterManagement.Delete From Member ${CONFIG_NODES_API} ${Follower_Node_2}
+ ClusterManagement.Delete From Member ${RFC8040_NODES_API} ${Follower_Node_2}
${config_datastore_delete_end_time}= Get Current Date result_format=timestamp
${config_datastore_delete_time}= Subtract Date From Date ${config_datastore_delete_end_time} ${config_datastore_delete_start_time}
${config_datastore_delete_rate}= Evaluate ${flow_count} / ${config_datastore_delete_time}
Resource ../../../libraries/FlowLib.robot
Resource ../../../libraries/Utils.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${SWITCHES} 3
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 ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1
- RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1
- RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000
+ 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
END
Check Flows In Operational DS After Mininet Reconnects
[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 ${CONFIG_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
RequestsLibrary.Delete All Sessions
Disconnect Controller Mininet
Variables ../../../variables/Variables.py
Library RequestsLibrary
Library ../../../libraries/Common.py
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${switch_idx} 1
Add Flow 1 To Controller1
Init Flow Variables 1 1 1
Log ${data}
- ${resp}= Put Request session1 ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} data=${data}
+ ${resp}= Put Request session1 ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} data=${data}
Log ${resp.content}
- ${msg}= Set Variable Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+ ${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.
Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
Add Flow 2 To Controller2
Init Flow Variables 1 2 2
Log ${data}
- ${resp}= Put Request session2 ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} data=${data}
+ ${resp}= Put Request session2 ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} data=${data}
Log ${resp.content}
- ${msg}= Set Variable Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+ ${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.
Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
Add Flow 3 To Controller3
Init Flow Variables 1 3 3
Log ${data}
- ${resp}= Put Request session3 ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} data=${data}
+ ${resp}= Put Request session3 ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id} data=${data}
Log ${resp.content}
- ${msg}= Set Variable Adding flow for ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id} failed, http response ${resp.status_code} received.
+ ${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.
Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
Show Switch Content After Add
Check Flow 1 Configured On Controller1
Init Flow Variables 1 1 1
- ${resp}= Get Controller Response session1 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 1 Operational On Controller1
Init Flow Variables 1 1 1
- ${resp}= Get Controller Response session1 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Check Flow 1 Configured On Controller2
Init Flow Variables 1 1 1
- ${resp}= Get Controller Response session2 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 1 Operational On Controller2
Init Flow Variables 1 1 1
- ${resp}= Get Controller Response session2 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Check Flow 1 Configured On Controller3
Init Flow Variables 1 1 1
- ${resp}= Get Controller Response session3 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 1 Operational On Controller3
Init Flow Variables 1 1 1
- ${resp}= Get Controller Response session3 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Check Flow 2 Configured On Controller1
Init Flow Variables 1 2 2
- ${resp}= Get Controller Response session1 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 2 Operational On Controller1
Init Flow Variables 1 2 2
- ${resp}= Get Controller Response session1 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Check Flow 2 Configured On Controller2
Init Flow Variables 1 2 2
- ${resp}= Get Controller Response session2 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 2 Operational On Controller2
Init Flow Variables 1 2 2
- ${resp}= Get Controller Response session2 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Check Flow 2 Configured On Controller3
Init Flow Variables 1 2 2
- ${resp}= Get Controller Response session3 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 2 Operational On Controller3
Init Flow Variables 1 2 2
- ${resp}= Get Controller Response session3 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Check Flow 3 Configured On Controller1
Init Flow Variables 1 3 3
- ${resp}= Get Controller Response session1 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 3 Operational On Controller1
Init Flow Variables 1 3 3
- ${resp}= Get Controller Response session1 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Check Flow 3 Configured On Controller2
Init Flow Variables 1 3 3
- ${resp}= Get Controller Response session2 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 3 Operational On Controller2
Init Flow Variables 1 3 3
- ${resp}= Get Controller Response session2 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Check Flow 3 Configured On Controller3
Init Flow Variables 1 3 3
- ${resp}= Get Controller Response session3 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Configured ${data} ${resp.content}
Check Flow 3 Operational On Controller3
Init Flow Variables 1 3 3
- ${resp}= Get Controller Response session3 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Delete Flow 1 On Controller1
Init Flow Variables 1 1 1
- ${resp}= Delete Request session1 ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+ ${resp}= Delete Request session1 ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
Log ${resp.content}
- ${msg}= Set Variable Delete flow for ${CONFIG_NODES_API}/node/openflow:${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}/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 2 On Controller2
Init Flow Variables 1 2 2
- ${resp}= Delete Request session2 ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+ ${resp}= Delete Request session2 ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
Log ${resp.content}
- ${msg}= Set Variable Delete flow for ${CONFIG_NODES_API}/node/openflow:${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}/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 3 On Controller3
Init Flow Variables 1 3 3
- ${resp}= Delete Request session3 ${CONFIG_NODES_API}/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
+ ${resp}= Delete Request session3 ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/table=${table_id}/flow=${flow_id}
Log ${resp.content}
- ${msg}= Set Variable Delete flow for ${CONFIG_NODES_API}/node/openflow:${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}/table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
Show Switch Content After Delete
Read Until mininet>
Check Flow 1 Not Configured On Controller1
- ${resp}= Get Controller Response session1 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 1 Not Operational On Controller1
- ${resp}= Get Controller Response session1 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Should Be Equal ${False} ${pres} msg=${msg}
Check Flow 1 Not Configured On Controller2
- ${resp}= Get Controller Response session2 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 1 Not Operational On Controller2
- ${resp}= Get Controller Response session2 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Should Be Equal ${False} ${pres} msg=${msg}
Check Flow 1 Not Configured On Controller3
- ${resp}= Get Controller Response session3 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/1
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=1?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 1 Not Operational On Controller3
- ${resp}= Get Controller Response session3 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Should Be Equal ${False} ${pres} msg=${msg}
Check Flow 2 Not Configured On Controller1
- ${resp}= Get Controller Response session1 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 2 Not Operational On Controller1
- ${resp}= Get Controller Response session1 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Should Be Equal ${False} ${pres} msg=${msg}
Check Flow 2 Not Configured On Controller2
- ${resp}= Get Controller Response session2 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 2 Not Operational On Controller2
- ${resp}= Get Controller Response session2 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Should Be Equal ${False} ${pres} msg=${msg}
Check Flow 2 Not Configured On Controller3
- ${resp}= Get Controller Response session3 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/2
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=2?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 2 Not Operational On Controller3
- ${resp}= Get Controller Response session3 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Should Be Equal ${False} ${pres} msg=${msg}
Check Flow 3 Not Configured On Controller1
- ${resp}= Get Controller Response session1 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 3 Not Operational On Controller1
- ${resp}= Get Controller Response session1 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session1 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Should Be Equal ${False} ${pres} msg=${msg}
Check Flow 3 Not Configured On Controller2
- ${resp}= Get Controller Response session2 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 3 Not Operational On Controller2
- ${resp}= Get Controller Response session2 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session2 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Should Be Equal ${False} ${pres} msg=${msg}
Check Flow 3 Not Configured On Controller3
- ${resp}= Get Controller Response session3 ${CONFIG_NODES_API}/node/openflow:1/table/1/flow/3
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1/flow=3?content=config
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 404
Check Flow 3 Not Operational On Controller3
- ${resp}= Get Controller Response session3 ${OPERATIONAL_NODES_API}/node/openflow:1/table/1
+ ${resp}= Get Controller Response session3 ${RFC8040_NODES_API}/node=openflow%3A1/table=1?content=nonconfig
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${pres} ${msg}= Is Flow Operational2 ${data} ${resp.content}
Test Timeout 5m
Library Collections
Library OperatingSystem
-Resource ../../../libraries/SwitchUtils.robot
-Resource ../../../libraries/Utils.robot
Library RequestsLibrary
Library ../../../libraries/Common.py
Library ../../../libraries/SwitchClasses/${SWITCH_CLASS}.py
Variables ../../../variables/Variables.py
+Resource ../../../libraries/SwitchUtils.robot
+Resource ../../../libraries/Utils.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${SWITCH_CLASS} Ovs
${SWITCH_IP} ${TOOLS_SYSTEM_IP}
${SWITCH_PROMPT} ${TOOLS_SYSTEM_PROMPT}
${ODL_SYSTEM_IP} null
-${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
+${REST_CONTEXT} ${RFC8040_NODES_API}
*** Test Cases ***
OF1.3 Connection Between Switch and Controller
Call Method ${test_switch} create_flow_match_elements ${flow.xml}
Log ${test_switch.flow_validations}
${dpid_id}= Get Switch Datapath ID ${test_switch}
- Wait Until Keyword Succeeds 3s 1s Add Flow To Controller And Verify ${flow.xml} openflow:${dpid_id} ${flow.table_id}
+ Wait Until Keyword Succeeds 3s 1s Add Flow To Controller And Verify ${flow.xml} openflow%3A${dpid_id} ${flow.table_id}
... ${flow.id}
Wait Until Keyword Succeeds 3s 1s Validate Switch Output ${test_switch} ${test_switch.dump_all_flows} ${test_switch.flow_validations}
- Wait Until Keyword Succeeds 3s 1s Remove Flow From Controller And Verify openflow:${dpid_id} ${flow.table_id} ${flow.id}
+ Wait Until Keyword Succeeds 3s 1s Remove Flow From Controller And Verify openflow%3A${dpid_id} ${flow.table_id} ${flow.id}
Wait Until Keyword Succeeds 3s 1s Validate Switch Output ${test_switch} ${test_switch.dump_all_flows} ${test_switch.flow_validations}
... false
AUTH = [u"admin", u"admin"]
SCOPE = "sdn"
HEADERS = {"Content-Type": "application/json"}
-HEADERS_YANG_JSON = {"Content-Type": "application/yang.data+json"}
+# FIXME: keep it as 'application/json' to make it work for both Bierman02
+# and RFC8040 URLs. Change it to RFC8040 media type once RFC8040 migration
+# is completed.
+HEADERS_YANG_JSON = {"Content-Type": "application/json"}
HEADERS_XML = {"Content-Type": "application/xml"}
ACCEPT_XML = {"Accept": "application/xml"}
ACCEPT_JSON = {"Accept": "application/json"}
${GET_DASHBOARDRECORD} /restconf/operational/dashboardrule:dashboardRecord/ # FIXME: Move to a separate Centinel-related Resource and add description.
${GET_INTENTS_URI} /retconf/config/intent:intents # FIXME: Move to a separate Nemo-related Resource and add description.
&{HEADERS} Content-Type=application/json # Deprecated. Sometimes conflicts with argument name. TODO: Migrate most suites to TemplatedRequests, then chose a more descriptive name.
-&{HEADERS_YANG_JSON} Content-Type=application/yang.data+json # Content type for JSON data, used to work around Requests auto-serialization. TODO: Hide into more specific Resource if possible.
+&{HEADERS_YANG_JSON} Content-Type=application/json # Content type for JSON data, used to work around Requests auto-serialization. FIXME: keep it as 'application/json' to make it work for both Bierman02 & RFC8040 URLs. Change it to RFC8040 media type once RFC8040 migration is completed.
&{HEADERS_YANG_RFC8040_JSON} Content-Type=application/yang-data+json
&{HEADERS_XML} Content-Type=application/xml # Content type for XML data. TODO: Hide into more specific Resource if possible.
${KARAF_PROMPT_LOGIN} opendaylight-user # This is used for karaf console login.
--- /dev/null
+*** Settings ***
+Documentation Resource file containing OpenFlow Plugin variables.
+
+*** Variables ***
+${RFC8040_RESTCONF_ROOT} /rests
+${RFC8040_DATA_RESOURCE} ${RFC8040_RESTCONF_ROOT}/data
+${RFC8040_CONFIG_CONTENT} content=config
+${RFC8040_OPERATIONAL_CONTENT} content=nonconfig
+${RFC8040_NODES_API} ${RFC8040_DATA_RESOURCE}/opendaylight-inventory:nodes
+${RFC8040_CONFIG_NODES_API} ${RFC8040_NODES_API}?${RFC8040_CONFIG_CONTENT}
+${RFC8040_OPERATIONAL_NODES_API} ${RFC8040_NODES_API}?${RFC8040_OPERATIONAL_CONTENT}
+${RFC8040_TOPO_API} ${RFC8040_DATA_RESOURCE}/network-topology:network-topology
+${RFC8040_OPERATIONAL_TOPO_API} ${RFC8040_TOPO_API}?${RFC8040_OPERATIONAL_CONTENT}
+${RFC8040_OPERATIONAL_TOPO_FLOW1_API} ${RFC8040_TOPO_API}/topology=flow%3A1?${RFC8040_OPERATIONAL_CONTENT}