The 'Get Request' RequestsLibrary keyword has been deprecated.
'Get Request' has been replaced by 'GET On Session'.
JIRA: INTTEST-141
Change-Id: I2128046b5a97126ad33927b099f605fc92715e81
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
[Arguments] ${user_id}=${EMPTY}
Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTPORT}
${headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded
- ${resp}= RequestsLibrary.GET Request httpbin ${idmurl}/users/${user_id} headers=${headers}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp}= RequestsLibrary.GET On Session
+ ... httpbin
+ ... url=${idmurl}/users/${user_id}
+ ... headers=${headers}
+ ... expected_status=200
Log ${resp.text}
RETURN ${resp}
${exp_status_code}= BuiltIn.Set_Variable_If ${connected} 200 404
${url}= BuiltIn.Set_Variable
... ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F${ip}?content=nonconfig
- ${response}= RequestsLibrary.GET On Session ${session} ${url} expected_status=${exp_status_code}
+ ${response}= RequestsLibrary.GET On Session ${session} url=${url} expected_status=${exp_status_code}
RETURN ${response.content}
Start_BGP_Manager
Library SSHLibrary timeout=10s
Library RequestsLibrary
Resource ../variables/Variables.robot
+Resource BGPSpeaker.robot
Resource RemoteBash.robot
Resource NexusKeywords.robot
Get BGP Configuration On ODL
[Documentation] Get bgp configuration
[Arguments] ${odl_session}
- ${resp} = RequestsLibrary.Get Request ${odl_session} ${CONFIG_API}/ebgp:bgp/
+ ${resp} = RequestsLibrary.GET On Session ${odl_session} url=${CONFIG_API}/ebgp:bgp/
Log ${resp.text}
RETURN ${resp.text}
Delete BGP Configuration On ODL
[Documentation] Delete BGP
[Arguments] ${odl_session}
- ${resp} = RequestsLibrary.Delete Request ${odl_session} ${CONFIG_API}/ebgp:bgp/
+ ${resp} = RequestsLibrary.DELETE On Session
+ ... ${odl_session}
+ ... url=${CONFIG_API}/ebgp:bgp/
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
RETURN ${resp.text}
Create External Tunnel Endpoint Configuration
... mapping=${Kwargs}
... session=session
-Get External Tunnel Endpoint Configuration
- [Documentation] Get bgp configuration
- [Arguments] ${ip}
- ${resp} = RequestsLibrary.Get Request session ${CONFIG_API}/itm:dc-gateway-ip-list/dc-gateway-ip/${ip}/
- Log ${resp.text}
- RETURN ${resp.text}
-
Teardown_Everything
[Documentation] Create and Log the diff between expected and actual responses, make sure Python tool was killed.
... Tear down imported Resources.
Check_Example_Bgp_Rib_Content
[Documentation] Check the example-bgp-rib content for string
[Arguments] ${session} ${substr} ${error_message}=${JSONKEYSTR} not found, but expected.
- ${response} = RequestsLibrary.Get Request ${session} ${REST_API}/${BGP_RIB_URI}?content=nonconfig
+ ${response} = RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${REST_API}/${BGP_RIB_URI}?content=nonconfig
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Contain ${response.text} ${substr} ${error_message} values=False
Check_Example_Bgp_Rib_Does_Not_Contain
[Documentation] Check the example-bgp-rib does not contain the string
[Arguments] ${session} ${substr} ${error_message}=${JSONKEYSTR} found, but not expected.
- ${response} = RequestsLibrary.Get Request ${session} ${REST_API}/${BGP_RIB_URI}?content=nonconfig
+ ${response} = RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${REST_API}/${BGP_RIB_URI}?content=nonconfig
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Not_Contain ${response.text} ${substr} ${error_message} values=False
Check_Example_IPv4_Topology_Content
[Documentation] Check the example-ipv4-topology content for string
[Arguments] ${session} ${string_to_check}=${EMPTY}
- ${response} = RequestsLibrary.Get Request ${session} ${REST_API}/${BGP_TOPOLOGY_URI}?content=nonconfig
+ ${response} = RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${REST_API}/${BGP_TOPOLOGY_URI}?content=nonconfig
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Contain ${response.text} ${string_to_check}
Check_Example_IPv4_Topology_Does_Not_Contain
[Documentation] Check the example-ipv4-topology does not contain the string
[Arguments] ${session} ${string_to_check}
- ${response} = RequestsLibrary.Get Request ${session} ${REST_API}/${BGP_TOPOLOGY_URI}?content=nonconfig
+ ${response} = RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${REST_API}/${BGP_TOPOLOGY_URI}?content=nonconfig
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Not_Contain ${response.text} ${string_to_check}
... with a single bulkomatic API we can trigger bulk flows in config datastore which eventually populates switches and operational datastore
... So far this library is only to be used by MD-SAL clustering and OpenFlowplugin clustering test as it is very specific for these tests
+Resource ClusterManagement.robot
Resource Utils.robot
Variables ../variables/Variables.py
[Documentation] Checks to see if read or write operation is successfull in controller node.
[Arguments] ${op_status_uri} ${controller_index}
${data}= ClusterManagement.Get From Member ${op_status_uri} ${controller_index}
- ${json}= To Json ${data}
+ ${json}= Utils.Json Parse From String ${data}
${value}= Get From Dictionary ${json} value
${value}= Convert to String ${value}
${two}= Convert to String 2
[Documentation] Verify Flow Count in member ${controller_index} matches ${flow_count}.
[Arguments] ${flow_count} ${controller_index}
${data}= Get Bulk Flow Count ${controller_index}
- ${json}= To Json ${data}
+ ${json}= Utils.Json Parse From String ${data}
${value}= Get From Dictionary ${json} value
Should Be Equal As Strings ${value} ${flow_count}
Get_Change_Count
[Documentation] GET data change request, assert status 200, return the value.
[Arguments] ${session}=operational
- ${response} = RequestsLibrary.GET On Session ${session} ${CC_DATA_CHANGE_COUNTER_URL} expected_status=200
+ ${response} = RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${CC_DATA_CHANGE_COUNTER_URL}
+ ... expected_status=200
# CompareStream.Set_Variable_If_At_Least_Else cannot be used direcly, because ${response.text}["data-change-counter"]["count"] would be
# evaluated before the stream comparison and it causes failures
BuiltIn.Log ${response.text}
...
... TODO: Unify capitalization of Leaders and Followers.
-Library RequestsLibrary # for Create_Session and To_Json
+Library RequestsLibrary # for Create_Session
Library Collections
Library String
Library ClusterEntities.py
... uri=${uri}
... session=${session}
... http_timeout=${http_timeout}
- ${data_object} = RequestsLibrary.To_Json ${data_text}
+ ${data_object} = Utils.Json Parse From String ${data_text}
${value} = Collections.Get_From_Dictionary ${data_object} value
${raft_property} = Collections.Get_From_Dictionary ${value} ${property}
RETURN ${raft_property}
[Documentation] Return sync status parsed out of given text. Called twice by Get_Sync_Status_Of_Member.
[Arguments] ${shard_manager_text}
BuiltIn.Log ${shard_manager_text}
- ${manager_object} = RequestsLibrary.To_Json ${shard_manager_text}
+ ${manager_object} = Utils.Json Parse From String ${shard_manager_text}
${value_object} = Collections.Get_From_Dictionary dictionary=${manager_object} key=value
${sync_status} = Collections.Get_From_Dictionary dictionary=${value_object} key=SyncStatus
RETURN ${sync_status}
[Documentation] Check Linear topology.
[Arguments] ${switches} ${member_index}=1
${session}= Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${RFC8040_OPERATIONAL_TOPO_API}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
Should Contain ${resp.text} "node-id":"openflow:${switch}"
Should Contain ${resp.text} "tp-id":"openflow:${switch}:1"
[Documentation] Check no switch is in topology
[Arguments] ${switches} ${member_index}=1
${session}= Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${RFC8040_OPERATIONAL_TOPO_API}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
Should Not Contain ${resp.text} openflow:${switch}
END
[Documentation] Check number of flows in the inventory.
[Arguments] ${flows} ${member_index}=1
${session}= Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${RFC8040_OPERATIONAL_NODES_API}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "priority"
Should Be Equal As Integers ${count} ${flows}
[Documentation] Check number of groups in the inventory.
[Arguments] ${groups} ${member_index}=1
${session}= Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp}= RequestsLibrary.Get Request ${session} ${RFC8040_OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${RFC8040_OPERATIONAL_NODES_API}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${group_count}= Get Count ${resp.text} "group-type"
Should Be Equal As Integers ${group_count} ${groups}
def getCars(hostname, port, ignore):
"""Uses the GET on car:cars resource to get all cars in the store using RESTCONF"""
- resp = UtilLibrary.get(SettingsLibrary.getCarsUrl(hostname, port), "admin", "admin")
+ resp = UtilLibrary.get(
+ SettingsLibrary.getCarsUrl(hostname, port) + "?content=config", "admin", "admin"
+ )
resp.encoding = "utf-8"
print(resp.text)
return resp
</note>
"""
resp = UtilLibrary.get(
- SettingsLibrary.getPersonsUrl(hostname, port), "admin", "admin"
+ SettingsLibrary.getPersonsUrl(hostname, port) + "?content=config",
+ "admin",
+ "admin",
)
resp.encoding = "utf-8"
print(resp.text)
</note>
"""
resp = UtilLibrary.get(
- SettingsLibrary.getCarPersonUrl(hostname, port), "admin", "admin"
+ SettingsLibrary.getCarPersonUrl(hostname, port) + "?content=config",
+ "admin",
+ "admin",
)
resp.encoding = "utf-8"
print(resp)
*** Keywords ***
Check DIDM Registered With Device
[Documentation] Check for DIDM registered with the device
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp}= RequestsLibrary.GET On Session session ${RFC8040_OPERATIONAL_NODES_API} expected_status=200
Log ${resp.text}
Should Contain ${resp.text} didm
RETURN ${resp.text}
Resource ../variables/daexim/DaeximVariables.robot
Resource ../variables/Variables.robot
Resource SSHKeywords.robot
+Resource Utils.robot
*** Keywords ***
[Arguments] ${endpoint} ${host_index}
${resp} ClusterManagement.Get From Member ${NETCONF_NODE_URL}=${endpoint} ${host_index}
${output1} Builtin.Set Variable ${resp}
- ${output} RequestsLibrary.To Json ${output1}
+ ${output} Utils.Json Parse From String ${output1}
Builtin.Log ${output}
${status} Collections.Get From Dictionary
... ${output['network-topology:node'][0]}
... debug a list of data models.
Library RequestsLibrary
+Resource Utils.robot
*** Variables ***
*** Keywords ***
Get Model Dump
[Documentation] Will output a list of mdsal models using ${data_models} list
- [Arguments] ${controller_ip} ${data_models}=@{internal_data_models} ${restconf_root}=restconf
+ [Arguments] ${controller_ip} ${data_models}=@{internal_data_models} ${restconf_root}=rests
# while feature request in bug 7892 is not done, we will quickly timeout and not retry the model dump get
# request. This is because when it's done in a failed cluster state, it could take 20s for the reesponse to
# to come back as the internal clustering times out waiting for a leader which will not come. When bug 7892
... timeout=1
... max_retries=0
FOR ${model} IN @{data_models}
- ${resp}= RequestsLibrary.Get Request model_dump_session ${restconf_root}/${model}
- ${pretty_output}= To Json ${resp.text} pretty_print=True
- Log ${pretty_output}
+ ${resp}= RequestsLibrary.GET On Session model_dump_session url=${restconf_root}/${model}
+ Utils.Log Content ${resp.text}
END
Verify No Ingress Dispatcher Non-Default Flow Entries
[Documentation] Verify the ingress dispatcher table has no non-default flows after neutron was cleaned up
[Arguments] ${ovs_ip}
- ${flow_output}= Run Command On Remote System
+ ${flow_output}= Utils.Run Command On Remote System
... ${ovs_ip}
... sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE} table=${DISPATCHER_TABLE} | grep -v "priority=0"
Log ${flow_output}
... http://${controller_ip}:${RESTCONFPORT}${CONFIG_API}
... headers=${HEADERS}
... auth=${AUTH}
- ${resp}= RequestsLibrary.Get Request session ${node}
+ ${resp}= RequestsLibrary.GET On Session session ${node}
RETURN ${resp.json()}
Update Records
...
... TODO: RemoteBash.robot contains logic which could be reused here.
+Library RequestsLibrary
Library SSHLibrary
Resource ${CURDIR}/SSHKeywords.robot
Resource ${CURDIR}/RemoteBash.robot
[Arguments] ${session} ${exabgp_ip}=${TOOLS_SYSTEM_IP} ${connected}=${True}
${peer_check_url}= BuiltIn.Set_Variable ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
${exp_status_code}= BuiltIn.Set_Variable_If ${connected} ${200} ${404}
- ${rsp}= RequestsLibrary.Get Request ${session} ${peer_check_url}${exabgp_ip}?content=nonconfig
+ ${rsp}= RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${peer_check_url}${exabgp_ip}?content=nonconfig
+ ... expected_status=anything
BuiltIn.Log ${rsp.content}
BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code}
... cookie and barrier fields, string formatted xml that can be used to push to
... controller). TODO: Remove hard dependency on controller HTTP "session".
-Library XML
-Library String
+Library OperatingSystem
Library RequestsLibrary
-Library ScaleClient.py
+Library String
+Library XML
+Library Common.py
Library FlowLib.py
+Library ScaleClient.py
Library XmlComparator.py
-Library Common.py
Resource CompareStream.robot
+Resource TemplatedRequests.robot
Resource ../variables/openflowplugin/Variables.robot
Variables ../variables/Variables.py
Check No Switches In Inventory
[Documentation] Check no switch is in inventory
[Arguments] ${switches}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_NODES_API}
+ ... expected_status=200
Log ${resp.text}
FOR ${switch} IN RANGE 1 ${switches+1}
Should Not Contain ${resp.text} "openflow:${switch}"
Check No Switches In Topology
[Documentation] Check no switch is in topology
[Arguments] ${switches}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
Should Not Contain ${resp.text} openflow:${switch}
END
[Documentation] Check all switches and stats in operational inventory
[Arguments] ${switches}
FOR ${switch} IN RANGE 1 ${switches+1}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_NODES_API}/node=openflow%3A${switch}
+ ${resp}= RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} flow-capable-node-connector-statistics
Should Contain ${resp.text} flow-table-statistics
END
Check Switches In Topology
[Documentation] Check switches are in the topology.
[Arguments] ${switches}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "node-id":"openflow:
BuiltIn.Should Be Equal As Numbers ${count} ${switches}
Check Number Of Links
[Documentation] Check number of links in the topolgy.
[Arguments] ${links}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "link-id":"openflow:
Should Be Equal As Integers ${count} ${links}
Check Linear Topology
[Documentation] Check Linear topology.
[Arguments] ${switches}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
Should Contain ${resp.text} "node-id":"openflow:${switch}"
Should Contain ${resp.text} "tp-id":"openflow:${switch}:1"
Check Number Of Flows
[Documentation] Check number of flows in the inventory.
[Arguments] ${flows}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_NODES_API}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "priority"
Should Be Equal As Integers ${count} ${flows}
Check Number Of Groups
[Documentation] Check number of groups in the inventory.
[Arguments] ${groups}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_NODES_API}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${group_count}= Get Count ${resp.text} "group-type"
Should Be Equal As Integers ${group_count} ${groups}
Check Flow Stats Are Available
[Documentation] A GET on the /node=${node_id} inventory API is made and flow stats string is checked for existence.
[Arguments] ${node_id} ${flows}
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=2
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=2
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain X Times ${resp.text} priority ${flows}
Check Number Of Hosts
[Documentation] Check number of hosts in topology
[Arguments] ${hosts}
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${count}= Get Count ${resp.text} "node-id":"host:
Should Be Equal As Integers ${count} ${hosts}
Check No Hosts
[Documentation] Check if all hosts are deleted from inventory
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
Should Not Contain ${resp.text} "node-id":"host:
Add Table Miss Flows
Add Group To Controller And Verify
[Documentation] Push group through REST-API and verify in data-store
[Arguments] ${group_body} ${node_id} ${group_id}
- ${resp}= RequestsLibrary.Put Request
+ ${resp}= RequestsLibrary.PUT On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}
... headers=${HEADERS_XML}
... data=${group_body}
Log ${resp.text}
- BuiltIn.Should_Match "${resp.status_code}" "20?"
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config
... headers=${ACCEPT_XML}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Compare Xml ${group_body} ${resp.text}
Add Flow To Controller And Verify
[Documentation] Push flow through REST-API and verify in data-store
[Arguments] ${flow_body} ${node_id} ${table_id} ${flow_id}
- ${resp}= RequestsLibrary.Put Request
+ ${resp}= RequestsLibrary.PUT On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}
... headers=${HEADERS_XML}
... data=${flow_body}
Log ${resp.text}
- BuiltIn.Should_Match "${resp.status_code}" "20?"
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config
... headers=${ACCEPT_XML}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Compare Xml ${flow_body} ${resp.text}
Verify Flow On Mininet Switch
Remove Group From Controller And Verify
[Documentation] Remove group and verify
[Arguments] ${node_id} ${group_id}
- ${resp}= RequestsLibrary.Delete Request
+ ${resp}= RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}
+ ... expected_status=204
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 204
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.Get On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:group=${group_id}?content=config
+ ... expected_status=anything
IF ${resp.status_code} == 404 or ${resp.status_code} == 409 RETURN
Builtin.Log ${resp.text}
Builtin.Fail The request failed with code ${resp.status_code}
Remove Flow From Controller And Verify
[Documentation] Remove flow and verify
[Arguments] ${node_id} ${table_id} ${flow_id}
- ${resp}= RequestsLibrary.Delete Request
+ ${resp}= RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... expected_status=204
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 204
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.Get On Session
... session
- ... ${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config
+ ... expected_status=anything
IF ${resp.status_code} == 404 or ${resp.status_code} == 409 RETURN
Builtin.Log ${resp.text}
Builtin.Fail The request failed with code ${resp.status_code}
write dpctl dump-flows -O OpenFlow13
${switchoutput}= Read Until >
${headers}= Create Dictionary Content-Type=application/yang-data+xml
- ${resp}= RequestsLibrary.Post Request
+ ${resp}= RequestsLibrary.POST On Session
... session
- ... rests/operations/sal-flow:remove-flow
+ ... url=rests/operations/sal-flow:remove-flow
... data=${flow.xml}
... headers=${headers}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
- ${resp}= RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.text}
Should Not Contain ${resp.text} "output-node-connector": "CONTROLLER",
${strings_to_check_for}= Create List CONTROLLER
... This keyword assumes that the global/suite variables are available (${table_id}, ${flow_id} and ${switch_idx}
[Arguments] ${expvalue}
${headers}= Create Dictionary Accept=application/xml
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.Get On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}?content=config
... headers=${headers}
+ ... expected_status=anything
Log ${resp}
Log ${resp.text}
IF ${resp.status_code}!=200 RETURN ${False} ${EMPTY}
... This keyword assumes that the global/suite variables are available (${table_id}, ${flow_id} and ${switch_idx}
[Arguments] ${expvalue} ${check_id}=${False}
${headers}= Create Dictionary Accept=application/xml
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.Get On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}
... headers=${headers}
+ ... expected_status=anything
Log ${resp}
Log ${resp.text}
IF ${resp.status_code}!=200 RETURN ${False} ${EMPTY}
Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory
Log Element ${req}
${strxml}= Element To String ${req}
- ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:add-flow data=${strxml}
+ ${resp}= RequestsLibrary.POST On Session
+ ... session
+ ... url=/rests/operations/sal-flow:add-flow
+ ... data=${strxml}
+ ... expected_status=204
Log ${resp.text}
- ${expected_status_code}= CompareStream.Set_Variable_If_At_Least_Phosphorus 204 200
- Log ${expected_status_code}
- Should Be Equal As Strings ${resp.status_code} ${expected_status_code}
Add Flow Via Restconf
[Documentation] Configures a flow specified by given flow details (${node_id}, ${table_id}, ${flow_body}) using POST method
[Arguments] ${node_id} ${table_id} ${flow_body}
Log ${flow_body}
- ${resp}= RequestsLibrary.Post Request
+ ${resp}= RequestsLibrary.POST On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}
... data=${flow_body}
+ ... expected_status=201
Log ${resp.text}
- ${msg}= Set Variable
- ... Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 201 msg=${msg}
Update Flow Via RPC
[Documentation] Updates a flow by using update-flow operation. ${xmlroot} is usually a variable created by
Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory
Log Element ${xml}
${strxml}= Element To String ${xml}
- ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:update-flow data=${strxml}
+ ${resp}= RequestsLibrary.POST On Session
+ ... session
+ ... url=/rests/operations/sal-flow:update-flow
+ ... data=${strxml}
+ ... expected_status=204
Log ${resp.text}
- ${expected_status_code}= CompareStream.Set_Variable_If_At_Least_Phosphorus 204 200
- Log ${expected_status_code}
- Should Be Equal As Strings ${resp.status_code} ${expected_status_code}
Update Flow Via Restconf
[Documentation] Updates a flow configuration by given flow details (${node_id}, ${table_id}, ${flow_body}) using PUT method
[Arguments] ${node_id} ${table_id} ${flow_id} ${flow_body}
Log ${flow_body}
- ${resp}= RequestsLibrary.Put Request
+ ${resp}= RequestsLibrary.PUT On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}
... data=${flow_body}
+ ... expected_status=204
Log ${resp.text}
- ${msg}= Set Variable
- ... Updating flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 204 msg=${msg}
Delete Flow Via RPC
[Documentation] Deletes a flow by using remove-flow opearation. ${xmlroot} is usually a variable created by
Set Element Attribute ${nodeelm} xmlns:inv urn:opendaylight:inventory
Log Element ${req}
${strxml}= Element To String ${req}
- ${resp}= RequestsLibrary.Post Request session /rests/operations/sal-flow:remove-flow data=${strxml}
+ ${resp}= RequestsLibrary.POST On Session
+ ... session
+ ... url=/rests/operations/sal-flow:remove-flow
+ ... data=${strxml}
+ ... expected_status=204
Log ${resp.text}
- ${expected_status_code}= CompareStream.Set_Variable_If_At_Least_Phosphorus 204 200
- Log ${expected_status_code}
- Should Be Equal As Strings ${resp.status_code} ${expected_status_code}
Delete Flow Via Restconf
[Documentation] Deletes a flow from configuration datastore specified by given flow details (${node_id}, ${table_id}, ${flow_body}) using DELETE method
[Arguments] ${node_id} ${table_id} ${flow_id}
- ${resp}= RequestsLibrary.Delete Request
+ ${resp}= RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... expected_status=204
Log ${resp.text}
- ${msg}= Set Variable
- ... Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${node_id}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 204 msg=${msg}
Get Flow Id
[Documentation] This verifies specific flow-id for particular table-id matching from the flow element
[Arguments] ${dpnid} ${table_id} ${flow_element}
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${dpnid}/flow-node-inventory:table=${table_id}?content=config
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${dpnid}/flow-node-inventory:table=${table_id}?content=config
BuiltIn.Log ${resp.text}
@{flow_id}= String.Get Regexp Matches ${resp.text} id\":\"(\\d+${flow_element}) 1
RETURN @{flow_id}[0]
...
Library Process
+Library RequestsLibrary
Library SSHLibrary
Resource ${CURDIR}/BGPcliKeywords.robot
Resource ${CURDIR}/RemoteBash.robot
... ${connected}
... ${ALLOWED_STATUS_CODES}
... ${DELETED_STATUS_CODES}
- ${rsp}= RequestsLibrary.Get Request ${session} ${peer_check_url}${gobgp_ip}?content=nonconfig
+ ${rsp}= RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${peer_check_url}${gobgp_ip}?content=nonconfig
+ ... expected_status=anything
BuiltIn.Log ${rsp.content}
BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code}
"CHAINED_FLAG": "true" if chained_flag else "false",
}
urlt = string.Template(
- """http://$HOST:8181/restconf/operations/odl-mdsal-lowlevel-control:write-transactions"""
+ """http://$HOST:8181/rests/operations/odl-mdsal-lowlevel-control:write-transactions"""
)
_initiate_rpcs(host_list, index_list, urlt, datat, subst_dict)
"ISOLATED_TRANSACTIONS": "true" if isolated_transactions_flag else "false",
}
urlt = string.Template(
- """http://$HOST:8181/restconf/operations/odl-mdsal-lowlevel-control:produce-transactions"""
+ """http://$HOST:8181/rests/operations/odl-mdsal-lowlevel-control:produce-transactions"""
)
_initiate_rpcs(host_list, index_list, urlt, datat, subst_dict)
... return_stderr=True
${template} OperatingSystem.Get File ${ADD_KEYSTORE_ENTRY_REQ}
${body} Replace String ${template} {base64-client-key} ${base64-client-key}
- ${resp} RequestsLibrary.Post Request
+ ${resp} RequestsLibrary.POST On Session
... session
- ... ${netconf_keystore_url}:add-keystore-entry
+ ... url=${netconf_keystore_url}:add-keystore-entry
... data=${body}
... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
${client-key} ${stderr} SSHLibrary.Execute_Command
... sed -u '1d; $d' ./configuration-files/certs/client.key | sed -z 's!\\n!\\\\n!g'
${template} OperatingSystem.Get File ${ADD_PRIVATE_KEY_REQ}
${body} Replace String ${template} {client-key} ${client-key}
${body} Replace String ${body} {certificate-chain} ${certificate-chain}
- ${resp} RequestsLibrary.Post Request
+ ${resp} RequestsLibrary.POST On Session
... session
- ... ${netconf_keystore_url}:add-private-key
+ ... url=${netconf_keystore_url}:add-private-key
... data=${body}
... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
${ca-certificate} ${stderr} SSHLibrary.Execute_Command
... sed -u '1d; $d' ./configuration-files/certs/ca.pem | sed -z 's!\\n!\\\\n!g'
${template} OperatingSystem.Get File ${ADD_TRUSTED_CERTIFICATE}
${body} Replace String ${template} {ca-certificate} ${ca-certificate}
${body} Replace String ${body} {device-certificate} ${device-certificate}
- ${resp} RequestsLibrary.Post Request
+ ${resp} RequestsLibrary.POST On Session
... session
- ... ${netconf_keystore_url}:add-trusted-certificate
+ ... url=${netconf_keystore_url}:add-trusted-certificate
... data=${body}
... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Register global credentials for SSH call-home devices (APIv1)
${template} OperatingSystem.Get File ${CREATE_GLOBAL_CREDENTIALS_REQ}
${body} Replace String ${template} {username} ${username}
${body} Replace String ${body} {password} ${password}
- ${resp} RequestsLibrary.Put Request session ${global_config_url} data=${body} headers=${HEADERS}
+ ${resp} RequestsLibrary.PUT On Session
+ ... session
+ ... url=${global_config_url}
+ ... data=${body}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Register SSH call-home device in ODL controller (APIv1)
${body} Replace String ${body} {username} ${username}
${body} Replace String ${body} {password} ${password}
${body} Replace String ${body} {hostkey} ${hostkey}
- ${resp} RequestsLibrary.Post Request session ${whitelist} data=${body} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${whitelist}
+ ... data=${body}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Get create device request template (APIv1)
${body} Replace String ${body} {username} ${username}
${body} Replace String ${body} {password} ${password}
${body} Replace String ${body} {hostkey} ${hostkey}
- ${resp} RequestsLibrary.Post Request session ${whitelist} data=${body} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${whitelist}
+ ... data=${body}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Get create device request template (APIv2)
${body} Replace String ${template} {device_name} ${device_name}
${body} Replace String ${body} {key_id} ${key_id}
${body} Replace String ${body} {certificate_id} ${certificate_id}
- ${resp} RequestsLibrary.Post Request session ${whitelist} data=${body} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${whitelist}
+ ... data=${body}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Pull Netopeer2 Docker Image
... return_stderr=True
... return_rc=True
SSHLibrary.Execute_Command rm -rf ./configuration-files
- ${resp} RequestsLibrary.Delete_On_Session session ${whitelist}
- ${resp} RequestsLibrary.Delete_On_Session session ${netconf_keystore_data_url}
+ ${resp} RequestsLibrary.Delete_On_Session
+ ... session
+ ... url=${whitelist}
+ ... expected_status=anything
+ ${resp} RequestsLibrary.Delete_On_Session
+ ... session
+ ... url=${netconf_keystore_data_url}
+ ... expected_status=anything
Suite Setup
[Documentation] Get the suite ready for callhome test cases.
[Documentation] Returns name of last release found on nexus and list of all versions.
RequestsLibrary.Create_Session nexus ${NEXUS_RELEASES_URL} verify=${TRUE}
${uri} = BuiltIn.Set_Variable maven-metadata.xml
- ${response} = RequestsLibrary.GET On Session nexus ${uri}
+ ${response} = RequestsLibrary.GET On Session nexus url=${uri}
BuiltIn.Log ${response.text}
${root} = XML.Parse_XML ${response.text}
${element} = XML.Get_Element ${root} versioning/latest
${L3_TABLE} 21
${DEFAULT_PING_COUNT} 3
-*** Keywords ***
-Log Request
- [Arguments] ${resp_content}
- IF '''${resp_content}''' != '${EMPTY}'
- ${resp_json} = RequestsLibrary.To Json ${resp_content} pretty_print=True
- ELSE
- ${resp_json} = BuiltIn.Set Variable ${EMPTY}
- END
- BuiltIn.Log ${resp_json}
- RETURN ${resp_json}
+*** Keywords ***
Create OVSDB Node
[Arguments] ${node_ip} ${port}=${OVSDB_NODE_PORT}
${body} = OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_node.json
${uri} = Builtin.Set Variable ${RFC8040_TOPO_OVSDB1_API}
BuiltIn.Log URI is ${uri}
BuiltIn.Log data: ${body}
- ${resp} = RequestsLibrary.Post Request session ${uri} data=${body}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.POST On Session session url=${uri} data=${body} expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Connect To Ovsdb Node
${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_API}${node_ip}%3A${port}
BuiltIn.Log URI is ${uri}
BuiltIn.Log data: ${body}
- ${resp} = RequestsLibrary.Put Request session ${uri} data=${body}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Disconnect From Ovsdb Node
[Documentation] This request will disconnect the OVSDB node from the controller
[Arguments] ${node_ip} ${port}=${OVSDB_NODE_PORT}
- ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}${node_ip}%3A${port}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ ${resp} = RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_API}${node_ip}%3A${port}
+ ... expected_status=204
Add Bridge To Ovsdb Node
[Documentation] This will create a bridge and add it to the OVSDB node.
${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_API}${node_id_}%2Fbridge%2F${bridge}
BuiltIn.Log URI is ${uri}
BuiltIn.Log data: ${body}
- ${resp} = RequestsLibrary.Put Request session ${uri} data=${body}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Delete Bridge From Ovsdb Node
[Documentation] This request will delete the bridge node from the OVSDB
[Arguments] ${node_id} ${bridge}
- ${resp} = RequestsLibrary.Delete Request
+ ${resp} = RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_API}${node_id}%2Fbridge%2F${bridge}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ ... url=${RFC8040_SOUTHBOUND_NODE_API}${node_id}%2Fbridge%2F${bridge}
+ ... expected_status=204
Add Termination Point
[Documentation] Using the json data body file as a template, a REST config request is made to
${body} = String.Replace String ${body} vxlanport ${tp_name}
${node_id_} = BuiltIn.Evaluate """${node_id}""".replace("/","%2F").replace(":","%3A")
${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_API}${node_id_}%2Fbridge%2F${bridge}
- ${resp} = RequestsLibrary.Put Request session ${uri}/termination-point=${tp_name} data=${body}
+ ${resp} = RequestsLibrary.PUT On Session
+ ... session
+ ... url=${uri}/termination-point=${tp_name}
+ ... data=${body}
+ ... expected_status=anything
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Add Vxlan To Bridge
... node-id stripped of "ovsdb://uuid/". If not found, ${EMPTY} will be returned.
[Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_http_session}=session
${uuid} = Set Variable ${EMPTY}
- ${resp} = RequestsLibrary.Get Request ${controller_http_session} ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
- ${resp_json} = RequestsLibrary.To Json ${resp.text}
+ ${resp} = RequestsLibrary.GET On Session
+ ... ${controller_http_session}
+ ... url=${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
+ ... expected_status=200
+ Utils.Log Content ${resp.text}
+ ${resp_json} = Utils.Json Parse From String ${resp.text}
${topologies} = Collections.Get From Dictionary ${resp_json} network-topology:topology
${topology} = Collections.Get From List ${topologies} 0
${node_list} = Collections.Get From Dictionary ${topology} node
Log Config And Operational Topology
[Documentation] For debugging purposes, this will log both config and operational topo data stores
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_CONFIG_TOPO_API}
+ ... expected_status=anything
+ Utils.Log Content ${resp.text}
+ ${resp} = RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_TOPO_API}
+ ... expected_status=anything
+ Utils.Log Content ${resp.text}
Config and Operational Topology Should Be Empty
[Documentation] This will check that only the expected output is there for both operational and config
... topology data stores. Empty probably means that only ovsdb:1 is there.
- ${config_resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- ${operational_resp} = RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
+ ${config_resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API}
+ ${operational_resp} = RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API}
BuiltIn.Should Contain ${config_resp.text} {"topology-id":"ovsdb:1"}
BuiltIn.Should Contain ${operational_resp.text} {"topology-id":"ovsdb:1"}
${uri} = Builtin.Set Variable ${RFC8040_TOPO_API}
BuiltIn.Log URI is ${uri}
BuiltIn.Log data: ${body}
- ${resp} = RequestsLibrary.Put Request session ${uri} data=${body}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
RETURN ${body}
${body} = Replace String ${body} QOS-1 ${qos}
BuiltIn.Log URI is ${uri}
BuiltIn.Log data: ${body}
- ${resp} = RequestsLibrary.Put Request session ${uri} data=${body}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Create Queue
${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${queue}
BuiltIn.Log URI is ${uri}
BuiltIn.Log data: ${body}
- ${resp} = RequestsLibrary.Put Request session ${uri} data=${body}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Update Qos
${uri} = BuiltIn.Set Variable ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}
BuiltIn.Log URL is ${uri}
BuiltIn.Log data: ${body}
- ${resp} = RequestsLibrary.Put Request session ${uri} data=${body}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.PUT On Session session url=${uri} data=${body} expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Create Qos Linked Queue
${body} = OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/bug_7160/create_qoslinkedqueue.json
- ${resp} = RequestsLibrary.Put Request session ${RFC8040_SOUTHBOUND_NODE_HOST1_API} data=${body}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.PUT On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}
+ ... data=${body}
+ ... expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Add OVS Logging
[Arguments] ${uris}=@{EMPTY}
OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
FOR ${uri} IN @{uris}
- RequestsLibrary.Delete Request session ${uri}
+ RequestsLibrary.DELETE On Session session url=${uri} expected_status=anything
END
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
OVSDB.Log Config And Operational Topology
RequestsLibrary.Delete All Sessions
Setup_Pcep_Operations
[Documentation] Creates Requests session to be used by subsequent keywords.
RequestsLibrary.Create_Session
- ... alias=pcep_session
- ... url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/rests/operations/
+ ... pcep_session
+ ... url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... headers=${HEADERS_XML}
... auth=${AUTH}
Teardown_Pcep_Operations
[Documentation] Teardown to pair with Setup (otherwise no-op).
- Log TODO: The following line does not seem to be implemented by RequestsLibrary. Look for a workaround.
- # Delete_Session pcep_session
+ RequestsLibrary.Delete_All_Sessions
Add_Xml_Lsp_Return_Json
[Documentation] Instantiate LSP according to XML data and return response (json) text.
Operate_Xml_Lsp_Return_Json
[Documentation] Post XML data to given pcep-operations URI, check status_code is 200 and return response text (JSON).
[Arguments] ${uri_part} ${xml_data}
- ${response}= RequestsLibrary.POST On Session alias=pcep_session url=${uri_part} data=${xml_data} expected_status=any
+ ${uri_path}= BuiltIn.Set_Variable /rests/operations/${uri_part}
+ ${response}= RequestsLibrary.POST On Session
+ ... pcep_session
+ ... url=${uri_path}
+ ... data=${xml_data}
+ ... expected_status=anything
Log ${xml_data}
Should Contain ${ALLOWED_STATUS_CODES} ${response.status_code}
RETURN ${response.text}
...
... Contrary to Utils.Get_Data_From_URI, this does not Log the (potentially huge) content.
[Arguments] ${session}=operational ${topology}=example-ipv4-topology
- ${response} = RequestsLibrary.GET On Session ${session} url=${PC_NW_TOPOLOGY}=${topology}?content=nonconfig expected_status=any
+ ${response} = RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${PC_NW_TOPOLOGY}=${topology}?content=nonconfig
+ ... expected_status=anything
IF ${response.status_code} != 200
Fail Get on ${topology} returned status code ${response.status_code} with message: ${response.text}
END
def getCarsUrl(hostname, port):
"""Cars resource URL for GET"""
- return "http://" + hostname + ":" + port + "/restconf/config/car:cars"
+ return "http://" + hostname + ":" + port + "/rests/data/car:cars"
def getPersonsUrl(hostname, port):
"""People resouce URL for GET"""
- return "http://" + hostname + ":" + port + "/restconf/config/people:people"
+ return "http://" + hostname + ":" + port + "/rests/data/people:people"
def getCarPersonUrl(hostname, port):
"""GET cars persons mapping resource URL"""
- return "http://" + hostname + ":" + port + "/restconf/config/car-people:car-people"
+ return "http://" + hostname + ":" + port + "/rests/data/car-people:car-people"
def getAddCarInitUrl(hostname, port):
"""POST or DELETE URL"""
- return "http://" + hostname + ":" + port + "/restconf/config"
+ return "http://" + hostname + ":" + port + "/rests/data"
def getAddCarUrl(hostname, port):
"""POST or DELETE URL"""
- return "http://" + hostname + ":" + port + "/restconf/config/car:cars"
+ return "http://" + hostname + ":" + port + "/rests/data/car:cars"
def getAddPersonUrl(hostname, port):
"""POST or DELETE URL"""
- return "http://" + hostname + ":" + port + "/restconf/config"
+ return "http://" + hostname + ":" + port + "/rests/data"
def getAddPersonRpcUrl(hostname, port):
"""POST URL -using rpc"""
- return "http://" + hostname + ":" + port + "/restconf/operations/people:add-person"
+ return "http://" + hostname + ":" + port + "/rests/operations/people:add-person"
def getAddCarPersonUrl(hostname, port):
"""POST URL for car person mapping"""
- return "http://" + hostname + ":" + port + "/restconf/config"
+ return "http://" + hostname + ":" + port + "/rests/data"
def getBuyCarRpcUrl(hostname, port):
"""POST URL for buy car rpc"""
- return (
- "http://" + hostname + ":" + port + "/restconf/operations/car-purchase:buy-car"
- )
+ return "http://" + hostname + ":" + port + "/rests/operations/car-purchase:buy-car"
def getJolokiaURL(hostname, port, shardIndex, shardName):
*** Settings ***
+Library RequestsLibrary
Library SSHLibrary
Library Telnet
Verify Switch In Operational Data Store
[Documentation] Verifies the existence of the switch.datapath_id in the operational datastore.
[Arguments] ${switch}
- ${resp}= RequestsLibrary.Get Request session ${REST_CONTEXT}
+ ${resp}= RequestsLibrary.GET On Session session url=${REST_CONTEXT}
Log ${resp.text}
Should Match Regexp ${resp.text} openflow:${switch.datapath_id}
Verify Switch Not In Operational Data Store
[Documentation] Verifies that the given switch.datapath_id is not in the operational datastore.
[Arguments] ${switch}
- ${resp}= RequestsLibrary.Get Request session ${REST_CONTEXT}
+ ${resp}= RequestsLibrary.GET On Session session url=${REST_CONTEXT}
Log ${resp.text}
Should Not Match Regexp ${resp.text} openflow:${switch.datapath_id}
Get Binding Origins
[Documentation] Gets all binding origins via RPC from configuration
[Arguments] ${session}=session
- ${resp} = RequestsLibrary.Get Request ${session} /restconf/config/sxp-config:binding-origins
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session ${session} /restconf/config/sxp-config:binding-origins
+ ... expected_status=200
RETURN ${resp}
Add Binding Origin
Check Cluster Node Started
[Documentation] Verify that SxpNode has data written to Operational datastore and Node is running on one of cluster nodes
[Arguments] ${node} ${port}=64999 ${ip}=${node}
- ${resp} = RequestsLibrary.Get Request
+ ${resp} = RequestsLibrary.GET On Session
... ${CONTROLLER_SESSION}
- ... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/ expected_status=200
${started} = BuiltIn.Set Variable ${False}
FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
${rc} = Utils.Run Command On Remote System
Check Cluster Node Stopped
[Documentation] Verify that SxpNode has data removed from Operational datastore and Node is stopped
[Arguments] ${node} ${port}=64999 ${ip}=${node}
- ${resp} = RequestsLibrary.Get Request
+ ${resp} = RequestsLibrary.GET On Session
... ${CONTROLLER_SESSION}
... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 404
+ ... expected_status=404
${stopped} = BuiltIn.Set Variable ${False}
FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
${rc} = Utils.Run Command On Remote System
Check Node Started
[Documentation] Verify that SxpNode has data writen to Operational datastore and is running
[Arguments] ${node} ${port}=64999 ${system}=${node} ${session}=session ${ip}=${node}
- ${resp} = RequestsLibrary.Get Request
+ ${resp} = RequestsLibrary.GET On Session
... ${session}
... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ... expected_status=200
${rc} = Get Node Running Status ${node} ${port} ${system} ${session} ${ip}
BuiltIn.Should Be Equal As Strings ${rc} 0
Check Node Stopped
[Documentation] Verify that SxpNode has data removed from Operational datastore and is not running
[Arguments] ${node} ${port}=64999 ${system}=${node} ${session}=session ${ip}=${node}
- ${resp} = RequestsLibrary.Get Request
+ ${resp} = RequestsLibrary.GET On Session
... ${session}
... /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 404
+ ... expected_status=404
${rc} = Get Node Running Status ${node} ${port} ${system} ${session} ${ip}
BuiltIn.Should Be Equal As Strings ${rc} 1
Get Routing Configuration From Controller
[Documentation] Get Routing configuration from config DS
[Arguments] ${session}
- ${resp} = RequestsLibrary.Get Request
+ ${resp} = RequestsLibrary.GET On Session
... ${session}
... /restconf/config/sxp-cluster-route:sxp-cluster-route/
... headers=${ACCEPT_XML}
Clean Routing Configuration To Controller
[Documentation] Delete Routing configuration from Config DS
[Arguments] ${session}
- ${resp} = RequestsLibrary.Get Request
+ ${resp} = RequestsLibrary.GET On Session
... ${session}
... /restconf/config/sxp-cluster-route:sxp-cluster-route/
... headers=${ACCEPT_XML}
... ${201}
... ${204}
... ${404}
+... ${409}
# List of integers, not strings. Used by both PUT and DELETE (if the resource should have been present).
@{ALLOWED_STATUS_CODES}
... ${200}
... This Keyword is in this Resource only so that user do not need to call RequestsLibrary directly.
[Arguments] ${url}=http://${ODL_SYSTEM_IP}:${RESTCONFPORT} ${auth}=${AUTH} ${timeout}=${DEFAULT_TIMEOUT_HTTP} ${max_retries}=0
RequestsLibrary.Create_Session
- ... alias=default
+ ... default
... url=${url}
... auth=${auth}
... timeout=${timeout}
Basic Request Get
[Documentation] Send a simple HTTP GET request to a given URL
[Arguments] ${overlay_topology_url}
- ${resp} Get Request session ${OPERATIONAL_API}/${overlay_topology_url}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} Get On Session session ${OPERATIONAL_API}/${overlay_topology_url} expected_status=200
RETURN ${resp}
Send Basic Delete Request
Log Content
[Arguments] ${resp_content}
IF '''${resp_content}''' != '${EMPTY}'
- ${resp_json}= RequestsLibrary.To Json ${resp_content} pretty_print=True
+ ${resp_json}= BuiltIn.Evaluate
+ ... json.dumps(json.loads('''${resp_content}'''), sort_keys=True, indent=4, separators=(',', ': '))
+ ... modules=json
ELSE
${resp_json}= BuiltIn.Set Variable ${EMPTY}
END
Extract Value From Content
[Documentation] Will take the given response content and return the value at the given index as a string
[Arguments] ${content} ${index}
- ${JSON}= Evaluate json.loads('''${content}''') json
+ ${JSON}= BuiltIn.Evaluate json.loads('''${content}''') modules=json
${value}= Set Variable ${JSON${index}}
RETURN ${value}
Post Elements To URI
[Documentation] Perform a POST rest operation, using the URL and data provided
[Arguments] ${rest_uri} ${data} ${headers}=${headers} ${session}=session
- ${resp}= RequestsLibrary.Post On Session ${session} ${rest_uri} data=${data} headers=${headers}
+ ${resp}= RequestsLibrary.Post On Session ${session} url=${rest_uri} data=${data} headers=${headers}
Log ${resp.text}
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Remove All Elements At URI
[Arguments] ${uri} ${session}=session
- ${resp}= RequestsLibrary.Delete On Session ${session} ${uri}
+ ${resp}= RequestsLibrary.Delete On Session ${session} url=${uri}
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Remove All Elements At URI And Verify
[Arguments] ${uri} ${session}=session
- ${resp}= RequestsLibrary.Delete On Session ${session} ${uri}
+ ${resp}= RequestsLibrary.Delete On Session ${session} url=${uri}
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
${resp}= RequestsLibrary.Get On Session ${session} url=${uri}
Should Contain ${DELETED_STATUS_CODES} ${resp.status_code}
[Documentation] Put data from a file to a URI
[Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${session}=session
${body}= OperatingSystem.Get File ${data_file}
- ${resp}= RequestsLibrary.Put On Session ${session} ${dest_uri} data=${body} headers=${headers}
+ ${resp}= RequestsLibrary.Put On Session ${session} url=${dest_uri} data=${body} headers=${headers}
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Add Elements To URI From File And Verify
Add Elements To URI And Verify
[Documentation] Put data to a URI and verify the HTTP response
[Arguments] ${dest_uri} ${data} ${headers}=${headers} ${session}=session
- ${resp}= RequestsLibrary.Put On Session ${session} ${dest_uri} ${data} headers=${headers}
+ ${resp}= RequestsLibrary.Put On Session ${session} url=${dest_uri} ${data} headers=${headers}
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
${resp}= RequestsLibrary.Get On Session ${session} url=${dest_uri}
Should Not Contain ${DELETED_STATUS_CODES} ${resp.status_code}
[Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${session}=session
BuiltIn.Comment TODO: Does this have any benefits, considering TemplatedRequests can also do this in one line?
${body}= OperatingSystem.Get File ${data_file}
- ${resp}= RequestsLibrary.Put On Session ${session} ${dest_uri} data=${body} headers=${headers}
+ ${resp}= RequestsLibrary.Put On Session ${session} url=${dest_uri} data=${body} headers=${headers}
Should Contain ${DATA_VALIDATION_ERROR} ${resp.status_code}
Add Elements To URI From File And Check Server Error
[Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${session}=session
BuiltIn.Comment TODO: Does this have any benefits, considering TemplatedRequests can also do this in one line?
${body}= OperatingSystem.Get File ${data_file}
- ${resp}= RequestsLibrary.Put On Session ${session} ${dest_uri} data=${body} headers=${headers}
+ ${resp}= RequestsLibrary.Put On Session ${session} url=${dest_uri} data=${body} headers=${headers}
Should Contain ${INTERNAL_SERVER_ERROR} ${resp.status_code}
Post Elements To URI From File
[Arguments] ${dest_uri} ${data_file} ${headers}=${headers} ${session}=session
${body}= OperatingSystem.Get File ${data_file}
- ${resp}= RequestsLibrary.Post On Session ${session} ${dest_uri} data=${body} headers=${headers}
+ ${resp}= RequestsLibrary.Post On Session ${session} url=${dest_uri} data=${body} headers=${headers}
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Run Process With Logging And Status Check
... ${headers}. If the request returns a HTTP error, fails. Otherwise
... returns the data obtained by the request.
[Arguments] ${session} ${uri} ${headers}=${NONE}
- ${resp}= RequestsLibrary.Get On Session ${session} url=${uri} expected_status=any headers=${headers}
+ ${resp}= RequestsLibrary.Get On Session
+ ... ${session}
+ ... url=${uri}
+ ... headers=${headers}
+ ... expected_status=anything
IF ${resp.status_code} == 404 or ${resp.status_code} == 409 RETURN
Builtin.Log ${resp.text}
Builtin.Fail The request failed with code ${resp.status_code}
Post Log Check
[Documentation] Post body to ${uri}, log response content, and check status
[Arguments] ${uri} ${body} ${session}=session ${status_codes}=200
- ${resp}= RequestsLibrary.Post On Session ${session} ${uri} ${body}
+ ${resp}= RequestsLibrary.Post On Session ${session} url=${uri} data=${body}
Log ${resp.text}
TemplatedRequests.Check Status Code ${resp} ${status_codes}
RETURN ${resp}
Fetch vtn list
[Documentation] Check if VTN Manager is up.
- ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn:vtns
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp}= RequestsLibrary.GET On Session session restconf/operational/vtn:vtns expected_status=200
Fetch vtn switch inventory
[Documentation] Check if Switch is detected.
[Arguments] ${sw_name}
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
- ... restconf/operational/vtn-inventory:vtn-nodes/vtn-node/${sw_name}
- Should Be Equal As Strings ${resp.status_code} 200
+ ... restconf/operational/vtn-inventory:vtn-nodes/vtn-node/${sw_name} expected_status=200
Collect Debug Info
[Documentation] Check if Switch is detected.
Get a pathmap
[Documentation] Get a pathmap for a vtn.
- ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn-path-map:global-path-maps
+ ${resp}= RequestsLibrary.GET On Session session restconf/operational/vtn-path-map:global-path-maps
FOR ${pathElement} IN @{PATHMAP_ATTR}
should Contain ${resp.text} ${pathElement}
END
Get a pathpolicy
[Documentation] Get a pathpolicy for a vtn.
[Arguments] ${pathpolicy_id}
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
... restconf/operational/vtn-path-policy:vtn-path-policies/vtn-path-policy/${pathpolicy_id}
FOR ${pathpolicyElement} IN @{PATHPOLICY_ATTR}
Get flow
[Documentation] Get data flow.
[Arguments] ${vtn_name}
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
... restconf/operational/vtn-flow-impl:vtn-flows/vtn-flow-table/${vtn_name}
- Should Be Equal As Strings ${resp.status_code} 200
+ ... expected_status=200
Remove a portmap
[Documentation] Remove a portmap for a interface of a vbridge
Get flowconditions
[Documentation] Retrieve the list of flowconditions created
- ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn-flow-condition:vtn-flow-conditions
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp}= RequestsLibrary.Get On Session
+ ... session
+ ... restconf/operational/vtn-flow-condition:vtn-flow-conditions
+ ... expected_status=200
Get flowcondition
[Documentation] Retrieve the flowcondition by name and to check the removed flowcondition we added "retrieve" argument to differentiate the status code,
... since after removing flowcondition name the status will be different compare to status code when the flowcondition name is present.
[Arguments] ${flowcond_name} ${retrieve}
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
... restconf/operational/vtn-flow-condition:vtn-flow-conditions/vtn-flow-condition/${flowcond_name}
+ ... expected_status=anything
IF '${retrieve}' == 'retrieve'
Should Be Equal As Strings ${resp.status_code} 200
ELSE
Workflow Teardown
[Documentation] Cleanup when workflow is interrupt
- Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ Run Keyword And Ignore Error
+ ... RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_NODES_API}
+ ... expected_status=anything
Utils.Clean Mininet System
RequestsLibrary.Delete All Sessions
[Documentation] A user with a non-"admin" role should not have access to AAA endpoints
${auth} = Create List ${USER_USER} ${USER_PW}
Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${auth} headers=${HEADERS}
- ${resp} = RequestsLibrary.Get Request httpbin ${USERS_REST_URL}
- Should Be Equal As Numbers ${resp.status_code} 401
+ ${resp} = RequestsLibrary.GET On Session httpbin url=${USERS_REST_URL} expected_status=401
*** Keywords ***
[Arguments] ${url} ${user} ${password}
@{auth} = Create List ${user} ${password}
Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${auth} headers=${HEADERS}
- ${resp} = RequestsLibrary.Get Request httpbin ${url}
- Should Be Equal As Strings ${resp.status_code} 401
+ ${resp} = RequestsLibrary.GET On Session httpbin url=${url} expected_status=401
${header_value} = Convert To Uppercase ${resp.headers}[www-authenticate]
Should Contain ${header_value} BASIC
Log ${resp.content}
[Arguments] ${url} ${user} ${password}
@{auth} = Create List ${user} ${password}
Create Session httpbin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${auth} headers=${HEADERS}
- ${resp} = RequestsLibrary.Get Request httpbin ${url}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session httpbin url=${url} expected_status=200
... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... auth=${AUTH_SDN_DOMAIN}
... headers=${HEADERS}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Successful Authentication Without Domain
...
... - URL "/restconf/operational/ietf-restconf-monitoring:restconf-state" is not specified neither in shiro.ini nor in MDSAL Dynamic Authorization so no specific role is required
Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_CSC_SDN} headers=${HEADERS}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Unsuccessful Authentication Wrong User
...
... Due to authentication fails, authorization is not evaluated
Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_INVALID} headers=${HEADERS}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
UnSuccessful Authentication Without Domain
...
... Due to authentication fails, authorization is not evaluated
Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH_SDN} headers=${HEADERS}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
Unsuccessful Authentication Wrong Domain
... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... auth=${AUTH_SDN_WRONG_DOM}
... headers=${HEADERS}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
Unsuccessful Basic Authorization
... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... auth=${AUTH_CSC_NO_ADMIN}
... headers=${HEADERS}
- ${resp_ok} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp_ok} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp_ok.status_code}
- ${resp_nook} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp_nook} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code}
Unsuccessful Dynamic Authorization
... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... auth=${AUTH_CSC_NO_ADMIN}
... headers=${HEADERS}
- ${resp_nook} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp_nook} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code}
- ${resp_nook} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp_nook} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp_nook.status_code}
Unsuccessful Dynamic Authorization 2
... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... auth=${AUTH_SDN_DOMAIN}
... headers=${HEADERS}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
Create Session
... session
... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... auth=${AUTH_CSC_NO_ADMIN}
... headers=${HEADERS}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
Unsuccessful No Keystone Connection
... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... auth=${AUTH_SDN_DOMAIN}
... headers=${HEADERS}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${URI_CERTIFICATE}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
Create Session
... session
... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
... auth=${AUTH_CSC_NO_ADMIN}
... headers=${HEADERS}
- ${resp} RequestsLibrary.Get Request session ${URI_RESTCONF} headers=${HEADERS}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${URI_RESTCONF}
+ ... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
- ${resp} RequestsLibrary.Post Request session ${URI_CERTIFICATE} headers=${HEADERS}
+ ${resp} RequestsLibrary.POST On Session session url=${URI_CERTIFICATE} headers=${HEADERS}
Should Contain ${UNAUTHORIZED_STATUS_CODES} ${resp.status_code}
Create Session session_admin http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
Set Suite Variable ${PUT_DYNAMIC_AUTH_URI} /restconf/config/aaa:http-authorization
${body_dyn} OperatingSystem.Get File ${PUT_DYNAMIC_AUTH_FILE}
- ${resp} RequestsLibrary.Put Request
+ ${resp} RequestsLibrary.PUT On Session
... session_admin
- ... ${PUT_DYNAMIC_AUTH_URI}
+ ... url=${PUT_DYNAMIC_AUTH_URI}
... data=${body_dyn}
... headers=${HEADERS}
+ ... expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
- Delete Request session_admin http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+ DELETE On Session session_admin url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
Restart Controller
[Documentation] Controller restart is needed in order the new shiro.ini config takes effect
Get Controller Modules
[Documentation] Get the restconf modules, check 200 status and ietf-restconf presence
Create Session session1 http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
- ${resp} RequestsLibrary.Get_Request session1 ${MODULES_API}
+ ${resp} RequestsLibrary.GET On Session session1 url=${MODULES_API}
BuiltIn.Log ${resp.content}
BuiltIn.Should_Be_Equal ${resp.status_code} ${200}
BuiltIn.Should_Contain ${resp.content} ietf-restconf
Basic Unsecure Restconf Request
[Documentation] Tests a basic HTTP request, just to ensure that system is working fine with normal, unsecure reqs
Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
- ${resp} RequestsLibrary.Get Request session ${RESTCONF_MONITORING_URI}
+ ${resp} RequestsLibrary.GET On Session session ${RESTCONF_MONITORING_URI} expected_status=anything
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Delete All Sessions
Enable TLS in ODL
# Check ODL was restarted properly
Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
- ${resp} RequestsLibrary.Get Request session ${RESTCONF_MONITORING_URI}
+ ${resp} RequestsLibrary.GET On Session session ${RESTCONF_MONITORING_URI} expected_status=anything
Delete All Sessions
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Enable Client TLS Authentication in ODL
# Check ODL was restarted properly
Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
- ${resp} RequestsLibrary.Get Request session ${RESTCONF_MONITORING_URI}
+ ${resp} RequestsLibrary.GET On Session session ${RESTCONF_MONITORING_URI} expected_status=anything
Delete All Sessions
Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
# TODO: This keyword is not specific to prefix counting. Find a better place for it.
${peer_check_url} = BuiltIn.Set_Variable ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
${exp_status_code} = BuiltIn.Set_Variable_If ${connected} 200 404
- ${rsp} = RequestsLibrary.GET On Session ${session} ${peer_check_url}${peer_ip}?content=nonconfig expected_status=${exp_status_code}
+ ${rsp} = RequestsLibrary.GET On Session
+ ... ${session}
+ ... url=${peer_check_url}${peer_ip}?content=nonconfig
+ ... expected_status=${exp_status_code}
BuiltIn.Log ${rsp.content}
Set_Shard_Leaders_Location_And_Verify
Normalize_And_Compare
[Documentation] Verify empty flowspec data
- ${rsp} RequestsLibrary.Get_Request ${CONFIG_SESSION} ${FLOWSPEC_URL}
+ ${rsp} RequestsLibrary.GET On Session ${CONFIG_SESSION} url=${FLOWSPEC_URL}
TemplatedRequests.Normalize_Jsons_With_Bits_And_Compare
... ${EXP0}
... ${rsp.content}
BuiltIn.Set_Suite_Variable ${rib_old}
Log_Loc_Rib_Operational
- ${rsp} RequestsLibrary.Get Request
+ ${rsp} RequestsLibrary.GET On Session
... ${CONFIG_SESSION}
- ... /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/
+ ... url=/rests/data/bgp-rib:bgp-rib/rib=example-bgp-rib/loc-rib?content=nonconfig
BuiltIn.Log ${rsp.content}
Configure_App_Peer_With_Routes
BuiltIn.Log ${withdraw_hex}
BgpRpcClient.play_clean
${resp} = RequestsLibrary.POST On Session
- ... alias=${CONFIG_SESSION}
+ ... ${CONFIG_SESSION}
... url=${EVPN_CONF_URL}
... data=${data_xml}
... headers=${HEADERS_XML}
... expected_status=201
BuiltIn.Log ${resp.content}
- ${resp} = RequestsLibrary.Get_Request
+ ${resp} = RequestsLibrary.GET On Session
... ${CONFIG_SESSION}
- ... ${EVPN_CONF_URL}?content=config
+ ... url=${EVPN_CONF_URL}?content=config
... headers=${HEADERS_XML}
BuiltIn.Log ${resp.content}
- ${aupdate} = BuiltIn.Wait_Until_Keyword_Succeeds 4x 2s Get_Update_Content
+ ${aupdate} = BuiltIn.Wait_Until_Keyword_Succeeds 4x 2s Get_Update_Content ${ALLOWED_STATUS_CODES}
BuiltIn.Log ${aupdate}
BgpOperations.Verify_Two_Hex_Messages_Are_Equal ${aupdate} ${announce_hex}
BgpRpcClient.play_clean
Remove_Configured_Routes
- ${wupdate} = BuiltIn.Wait_Until_Keyword_Succeeds 4x 2s Get_Update_Content
+ ${wupdate} = BuiltIn.Wait_Until_Keyword_Succeeds 4x 2s Get_Update_Content ${DELETED_STATUS_CODES}
BuiltIn.Log ${wupdate}
BgpOperations.Verify_Two_Hex_Messages_Are_Equal ${wupdate} ${withdraw_hex}
[Teardown] Remove_Configured_Routes
[Teardown] Withdraw_Route_And_Verify ${withdraw_hex}
Verify_Test_Preconditions
- ${resp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_CONF_URL}?content=config
+ ${resp} = RequestsLibrary.GET On Session
+ ... ${CONFIG_SESSION}
+ ... url=${EVPN_CONF_URL}?content=config
+ ... expected_status=anything
BuiltIn.Should_Contain ${DELETED_STATUS_CODES} ${resp.status_code}
- ${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_FAMILY_LOC_RIB} headers=${HEADERS}
- TemplatedRequests.Normalize_Jsons_And_Compare ${EMPTY_ROUTES} ${rsp.content}
+ ${resp} = RequestsLibrary.GET On Session
+ ... ${CONFIG_SESSION}
+ ... url=${EVPN_FAMILY_LOC_RIB}
+ ... headers=${HEADERS}
+ TemplatedRequests.Normalize_Jsons_And_Compare ${EMPTY_ROUTES} ${resp.content}
Remove_Configured_Routes
[Documentation] Removes the route if present. First GET is for debug purposes.
- ${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_LOC_RIB} headers=${HEADERS}
- Log ${rsp.content}
- ${rsp} = RequestsLibrary.Get_Request
+ ${resp} = RequestsLibrary.GET On Session
+ ... ${CONFIG_SESSION}
+ ... url=${EVPN_LOC_RIB}
+ ... headers=${HEADERS}
+ ... expected_status=anything
+ BuiltIn.Log ${resp.content}
+ BuiltIn.Should_Contain ${ALLOWED_DELETE_STATUS_CODES} ${resp.status_code}
+ ${resp} = RequestsLibrary.GET On Session
... ${CONFIG_SESSION}
- ... ${EVPN_CONF_URL}?content=config
+ ... url=${EVPN_CONF_URL}?content=config
... headers=${HEADERS}
- Log ${rsp.content}
- IF ${rsp.status_code} in ${DELETED_STATUS_CODES} RETURN
- ${resp} = RequestsLibrary.Delete_Request ${CONFIG_SESSION} ${EVPN_CONF_URL}
- BuiltIn.Should_Be_Equal_As_Numbers ${resp.status_code} 204
+ ... expected_status=anything
+ BuiltIn.Log ${resp.content}
+ BuiltIn.Should_Contain ${ALLOWED_DELETE_STATUS_CODES} ${resp.status_code}
+ IF ${resp.status_code} in ${DELETED_STATUS_CODES} RETURN
+ ${resp} = RequestsLibrary.DELETE On Session
+ ... ${CONFIG_SESSION}
+ ... url=${EVPN_CONF_URL}
+ ... expected_status=204
Withdraw_Route_And_Verify
[Documentation] Sends withdraw update message from exabgp and verifies route removal from odl's rib
Get_Update_Content
[Documentation] Gets received data from odl's peer
- ${resp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_LOC_RIB} headers=${HEADERS_XML}
+ [Arguments] ${expected_status_codes}
+ ${resp} = RequestsLibrary.GET On Session
+ ... ${CONFIG_SESSION}
+ ... url=${EVPN_LOC_RIB}
+ ... headers=${HEADERS_XML}
+ ... expected_status=anything
BuiltIn.Log ${resp.content}
+ BuiltIn.Should_Contain ${expected_status_codes} ${resp.status_code}
${update} = BgpRpcClient.play_get
BuiltIn.Should_Not_Be_Equal ${update} ${Empty}
RETURN ${update}
Loc_Rib_Presence
[Documentation] Verifies if loc-rib contains expected data
[Arguments] ${exp_content}
- ${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_LOC_RIB} headers=${HEADERS}
- BuiltIn.Log_Many ${exp_content} ${rsp.content}
- TemplatedRequests.Normalize_Jsons_And_Compare ${exp_content} ${rsp.content}
+ ${resp} = RequestsLibrary.GET On Session ${CONFIG_SESSION} url=${EVPN_LOC_RIB} headers=${HEADERS}
+ BuiltIn.Log_Many ${exp_content} ${resp.content}
+ TemplatedRequests.Normalize_Jsons_And_Compare ${exp_content} ${resp.content}
[Arguments] ${url} ${exprspfile}
${expresponse} = OperatingSystem.Get File ${exprspfile}
BuiltIn.Log expected_response: ${expresponse}
- ${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${url}
+ ${rsp} = RequestsLibrary.GET On Session ${CONFIG_SESSION} url=${url}
BuiltIn.Log actual_response: ${rsp}
BuiltIn.Log actual_response_content: ${rsp.content}
TemplatedRequests.Normalize_Jsons_And_Compare ${expresponse} ${rsp.content}
[Documentation] Connect BGP peer
[Tags] critical
SSHLibrary.Switch Connection ibgp_peer1_console
- Start_Console_Tool ${iBGP_PEER1_COMMAND} ${iBGP_PEER1_OPTIONS}
- Read_And_Fail_If_Prompt_Is_Seen
+ BGPcliKeywords.Start_Console_Tool ${iBGP_PEER1_COMMAND} ${iBGP_PEER1_OPTIONS}
+ BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain ${CONFIG_SESSION} prefix
Connect_eBGP_Peer1
[Documentation] Connect BGP peer
[Tags] critical
SSHLibrary.Switch Connection ebgp_peer1_console
- Start_Console_Tool ${eBGP_PEER1_COMMAND} ${eBGP_PEER1_OPTIONS}
- Read_And_Fail_If_Prompt_Is_Seen
+ BGPcliKeywords.Start_Console_Tool ${eBGP_PEER1_COMMAND} ${eBGP_PEER1_OPTIONS}
+ BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
Check_IPv4_Topology_For_First_Path
[Documentation] The IPv4 topology shall contain the route announced by the first eBGP
[Documentation] Connect BGP peer and check empty topology
[Tags] critical
SSHLibrary.Switch Connection ebgp_peer2_console
- Start_Console_Tool ${eBGP_PEER2_COMMAND} ${eBGP_PEER2_OPTIONS}
- Read_And_Fail_If_Prompt_Is_Seen
+ BGPcliKeywords.Start_Console_Tool ${eBGP_PEER2_COMMAND} ${eBGP_PEER2_OPTIONS}
+ BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
Disconnect_eBGP_Peer1
[Documentation] Stop BGP peer, log topology and store logs
KarafKeywords.Execute_Controller_Karaf_Command_On_Background
... log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
-Read_Text_Before_Prompt
- [Documentation] Log text gathered by SSHLibrary.Read_Until_Prompt.
- ... This needs to be a separate keyword just because how Read_And_Fail_If_Prompt_Is_Seen is implemented.
- ${text} SSHLibrary.Read_Until_Prompt
- BuiltIn.Log ${text}
-
Store_File_To_Workspace
[Documentation] Store the ${source_file_name} to the workspace as ${target_file_name}.
[Arguments] ${source_file_name} ${target_file_name}
... '${uri}'=='${EMPTY}'
... ${REST_API}/${TOPOLOGY_URL}=pcep-topology?content=nonconfig
... ${REST_API}/${TOPOLOGY_URL}=pcep-topology/${uri}?content=nonconfig
- ${response}= RequestsLibrary.GET On Session ${CONFIG_SESSION} ${topology_uri} expected_status=200
+ ${response}= RequestsLibrary.GET On Session ${CONFIG_SESSION} url=${topology_uri} expected_status=200
TemplatedRequests.Normalize_Jsons_And_Compare ${exp} ${response.text}
*** Settings ***
Documentation Test suite for NETCONF client
+... FIXME: this test suite is based on the config subsystem, which has been long gone.
+... Currently this test suite is not used and hence should be fixed when added back.
Library Collections
Library OperatingSystem
-Library String
Library RequestsLibrary
+Library String
Library ../../../libraries/Common.py
Variables ../../../variables/Variables.py
*** Variables ***
-${NETOPEER} ${TOOLS_SYSTEM_IP}
-${NETOPEER_USER} ${TOOLS_SYSTEM_USER}
-${FILE} ${CURDIR}/../../../variables/xmls/netconf.xml
-${REST_CONT_CONF} /restconf/config/network-topology:network-topology/topology/topology-netconf
-${REST_CONT_OPER} /restconf/operational/network-topology:network-topology/topology/topology-netconf
-${REST_NTPR_CONF} node/controller-config/yang-ext:mount/config:modules
-${REST_NTPR_MOUNT} node/netopeer/yang-ext:mount/
+${NETOPEER} ${TOOLS_SYSTEM_IP}
+${NETOPEER_USER} ${TOOLS_SYSTEM_USER}
+${FILE} ${CURDIR}/../../../variables/xmls/netconf.xml
+${REST_TOPOLOGY_NETCONF} /rests/data/network-topology:network-topology/topology=topology-netconf
+${REST_NTPR_CONF} node=controller-config/yang-ext:mount/config:modules
+${REST_NTPR_MOUNT} node=netopeer/yang-ext:mount
*** Test Cases ***
${XML2} Replace String ${XML1} 127.0.0.1 ${NETOPEER}
${body} Replace String ${XML2} mininet ${NETOPEER_USER}
Log ${body}
- ${resp} Post Request session ${REST_CONT_CONF}/${REST_NTPR_CONF} data=${body}
+ ${resp} RequestsLibrary.POST On Session
+ ... session
+ ... url=${REST_TOPOLOGY_NETCONF}/${REST_NTPR_CONF}
+ ... data=${body}
+ ... expected_status=204
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 204
Get Controller Inventory
[Documentation] Get Controller operational inventory
Pull External Device configuration
[Documentation] Pull Netopeer configuration
[Tags] netconf
- ${resp} Get Request session ${REST_CONT_CONF}/${REST_NTPR_MOUNT}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_TOPOLOGY_NETCONF}/${REST_NTPR_MOUNT}?content=config
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} {}
Verify Device Operational data
[Documentation] Verify Netopeer operational data
[Tags] exclude
- ${resp} Get Request session ${REST_CONT_OPER}/${REST_NTPR_MOUNT}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_TOPOLOGY_NETCONF}/${REST_NTPR_MOUNT}?content=nonconfig
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} schema
Should Contain ${resp.content} statistics
Should Contain ${resp.content} datastores
*** Keywords ***
Get Inventory
- ${resp} Get Request session ${REST_CONT_OPER}/node/netopeer
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_TOPOLOGY_NETCONF}/node=netopeer?content=nonconfig
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} "node-id":"netopeer"
Should Contain ${resp.content} "netconf-node-topology:connection-status":"connected"
Should Contain ${resp.content} "netconf-node-topology:available-capabilities"
... python cluster_rest_script.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} add-rpc --itemtype people --itemcount ${ITEM_COUNT} --threads 5
${purchasecmd}
... python cluster_rest_script.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} add-rpc --itemtype car-people --itemcount ${ITEM_COUNT} --threads 5
-${carurl} /restconf/config/car:cars
-${peopleurl} /restconf/config/people:people
-${carpeopleurl} /restconf/config/car-people:car-people
+${carurl} /rests/data/car:cars
+${carurl_config} /rests/data/car:cars?content=config
+${peopleurl} /rests/data/people:people
+${peopleurl_config} /rests/data/people:people?content=config
+${carpeopleurl} /rests/data/car-people:car-people
+${carpeopleurl_config} /rests/data/car-people:car-people?content=config
${CONTROLLER_LOG_LEVEL} INFO
${TOOL_OPTIONS} ${EMPTY}
[Documentation] Store logs and verify result
Stop Tool
Store File To Workspace cluster_rest_script.log cluster_rest_script_add_cars.log
- ${rsp}= RequestsLibrary.Get Request session ${carurl} headers=${ACCEPT_XML}
+ ${rsp}= RequestsLibrary.GET On Session session url=${carurl_config} headers=${ACCEPT_XML}
${count}= XML.Get Element Count ${rsp.content} xpath=car-entry
Should Be Equal As Numbers ${count} ${ITEM_COUNT}
[Documentation] Store logs and verify result
Stop Tool
Store File To Workspace cluster_rest_script.log cluster_rest_script_add_people.log
- ${rsp}= RequestsLibrary.Get Request session ${peopleurl} headers=${ACCEPT_XML}
+ ${rsp}= RequestsLibrary.GET On Session session url=${peopleurl_config} headers=${ACCEPT_XML}
${count}= XML.Get Element Count ${rsp.content} xpath=person
Should Be Equal As Numbers ${count} ${ITEM_COUNT}
Delete Cars
[Documentation] Remove cars from the datastore
- ${rsp}= RequestsLibrary.Delete Request session ${carurl}
- Should Be Equal As Numbers 200 ${rsp.status_code}
- ${rsp}= RequestsLibrary.Get Request session ${carurl}
+ ${rsp}= RequestsLibrary.DELETE On Session session url=${carurl} expected_status=200
+ ${rsp}= RequestsLibrary.GET On Session session url=${carurl_config} expected_status=anything
Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code}
Delete People
[Documentation] Remove people from the datastore
- ${rsp}= RequestsLibrary.Delete Request session ${peopleurl}
- Should Be Equal As Numbers 200 ${rsp.status_code}
- ${rsp}= RequestsLibrary.Get Request session ${peopleurl}
+ ${rsp}= RequestsLibrary.DELETE On Session session url=${peopleurl} expected_status=200
+ ${rsp}= RequestsLibrary.GET On Session session url=${peopleurl_config} expected_status=anything
Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code}
Delete CarPeople
[Documentation] Remove car-people entries from the datastore
- ${rsp}= RequestsLibrary.Delete Request session ${carpeopleurl}
- Should Be Equal As Numbers 200 ${rsp.status_code}
- ${rsp}= RequestsLibrary.Get Request session ${carpeopleurl}
+ ${rsp}= RequestsLibrary.DELETE On Session session url=${carpeopleurl} expected_status=200
+ ${rsp}= RequestsLibrary.GET On Session session url=${carpeopleurl_config} expected_status=anything
Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code}
Purchase Is Completed
[Documentation] Check purchase of ${item_count} is completed.
[Arguments] ${item_count}
- ${rsp}= RequestsLibrary.Get Request session ${carpeopleurl} headers=${ACCEPT_XML}
+ ${rsp}= RequestsLibrary.GET On Session session url=${carpeopleurl_config} headers=${ACCEPT_XML}
${count}= XML.Get Element Count ${rsp.content} xpath=car-person
Should Be Equal As Numbers ${count} ${item_count}
... python cluster_rest_script.py --port ${RESTCONFPORT} add-rpc --itemtype people --itemcount ${ITEM_COUNT} --threads 6
${purchasecmd}
... python cluster_rest_script.py --port ${RESTCONFPORT} add-rpc --itemtype car-people --itemcount ${ITEM_COUNT} --threads 6
-${carurl} /restconf/config/car:cars
-${peopleurl} /restconf/config/people:people
-${carpeopleurl} /restconf/config/car-people:car-people
+${carurl} /rests/data/car:cars
+${carurl_config} /rests/data/car:cars?content=config
+${peopleurl} /rests/data/people:people
+${peopleurl_config} /rests/data/people:people?content=config
+${carpeopleurl} /rests/data/car-people:car-people
+${carpeopleurl_config} /rests/data/car-people:car-people?content=config
${CONTROLLER_LOG_LEVEL} INFO
${TOOL_OPTIONS} ${EMPTY}
[Documentation] Store logs and verify result
Stop Tool
Store File To Workspace cluster_rest_script.log cluster_rest_script_add_cars.log
- ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${carurl} headers=${ACCEPT_XML}
+ ${rsp}= RequestsLibrary.GET On Session session url=${carurl_config} headers=${ACCEPT_XML}
${count}= XML.Get Element Count ${rsp.content} xpath=car-entry
Should Be Equal As Numbers ${count} ${ITEM_COUNT}
[Documentation] Store logs and verify result
Stop Tool
Store File To Workspace cluster_rest_script.log cluster_rest_script_add_people.log
- ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${peopleurl} headers=${ACCEPT_XML}
+ ${rsp}= RequestsLibrary.GET On Session session url=${peopleurl_config} headers=${ACCEPT_XML}
${count}= XML.Get Element Count ${rsp.content} xpath=person
Should Be Equal As Numbers ${count} ${ITEM_COUNT}
Delete Cars
[Documentation] Remove cars from the datastore
- ${rsp}= RequestsLibrary.Delete Request ${car_leader_session} ${carurl}
- Should Be Equal As Numbers 200 ${rsp.status_code}
- ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${carurl}
+ ${rsp}= RequestsLibrary.DELETE On Session session url=${carurl} expected_status=200
+ ${rsp}= RequestsLibrary.GET On Session session url=${carurl_config} expected_status=anything
Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code}
Delete People
[Documentation] Remove people from the datastore
- ${rsp}= RequestsLibrary.Delete Request ${car_leader_session} ${peopleurl}
- Should Be Equal As Numbers 200 ${rsp.status_code}
- ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${peopleurl}
+ ${rsp}= RequestsLibrary.DELETE On Session session url=${peopleurl} expected_status=200
+ ${rsp}= RequestsLibrary.GET On Session session url=${peopleurl_config} expected_status=anything
Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code}
Delete CarPeople
[Documentation] Remove car-people entries from the datastore
- ${rsp}= RequestsLibrary.Delete Request ${car_leader_session} ${carpeopleurl}
- Should Be Equal As Numbers 200 ${rsp.status_code}
- ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${carpeopleurl}
+ ${rsp}= RequestsLibrary.DELETE On Session session url=${carpeopleurl} expected_status=200
+ ${rsp}= RequestsLibrary.GET On Session session url=${carpeopleurl_config} expected_status=anything
Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code}
SSHLibrary.Put File ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/scripts/cluster_rest_script.py .
${stdout} ${stderr} ${rc}= SSHLibrary.Execute Command ls return_stdout=True return_stderr=True
... return_rc=True
+ RequestsLibrary.Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
Stop Suite
[Documentation] Suite teardown keyword
Purchase Is Completed
[Documentation] Check purchase of ${item_count} is completed.
[Arguments] ${item_count}
- ${rsp}= RequestsLibrary.Get Request ${car_leader_session} ${carpeopleurl} headers=${ACCEPT_XML}
+ ${rsp}= RequestsLibrary.GET On Session session url=${carpeopleurl_config} headers=${ACCEPT_XML}
${count}= XML.Get Element Count ${rsp.content} xpath=car-person
Should Be Equal As Numbers ${count} ${item_count}
${THREADS} 10
${ADDCMD}
... python ${TOOL_NAME} --port ${RESTCONFPORT} add-with-retries --itemtype car --itemcount ${ITEM_COUNT} --threads ${THREADS}
-${CARURL} /restconf/config/car:cars
+${CARURL} /rests/data/car:cars
+${CARURL_CONFIG} /rests/data/car:cars?content=config
${SHARD_NAME} car
${SHARD_TYPE} config
${TEST_LOG_LEVEL} info
Delete Cars
[Documentation] Remove cars from the datastore
${session} = Resolve_Http_Session_For_Member member_index=${new_leader_index}
- ${rsp} = RequestsLibrary.Delete Request ${session} ${CARURL}
- Should Be Equal As Numbers 200 ${rsp.status_code}
- ${rsp} = RequestsLibrary.Get Request ${session} ${CARURL}
+ ${rsp} = RequestsLibrary.DELETE On Session ${session} url=${CARURL} expected_status=200
+ ${rsp} = RequestsLibrary.GET On Session ${session} url=${CARURL_CONFIG} expected_status=anything
Should Contain ${DELETED_STATUS_CODES} ${rsp.status_code}
Stop_Tool
${session} = Resolve_Http_Session_For_Member member_index=${new_leader_index}
# best effort to make sure cars are deleted in case more suites will run after this and the delete test case had trouble
- ${rsp} = RequestsLibrary.Delete Request ${session} ${CARURL}
+ ${rsp} = RequestsLibrary.DELETE On Session ${session} url=${CARURL} expected_status=anything
BuiltIn.Log ${rsp.status_code} : ${rsp.text}
SSHKeywords.Virtual_Env_Delete
Store_File_To_Workspace ${out_file} ${out_file}
Get_Cars_Count
[Documentation] Count car items in config ds.
[Arguments] ${session}
- ${resp} = RequestsLibrary.Get_Request ${session} ${CARURL}
+ ${resp} = RequestsLibrary.GET On Session ${session} url=${CARURL_CONFIG}
${count} = BuiltIn.Evaluate len(${resp.json()}[cars][car-entry])
RETURN ${count}
*** Variables ***
-${RPC_URL} /restconf/operations/basic-rpc-test:basic-global
+${RPC_URL} /rests/operations/basic-rpc-test:basic-global
&{EMPTY_DICT}
${SERVICE} Basic-rpc-test']
${TEST_LOG_LEVEL} info
@{TEST_LOG_COMPONENTS} org.opendaylight.controller.remote.rpc
-${EOS_URL} /restconf/operational/entity-owners:entity-owners
+${EOS_URL} /rests/data/entity-owners:entity-owners?content=nonconfig
${active_nodes} ${EMPTY}
*** Variables ***
-${RPC_URL} /restconf/operations/basic-rpc-test:basic-global
+${RPC_URL} /rests/operations/basic-rpc-test:basic-global
&{EMPTY_DICT}
${SERVICE} Basic-rpc-test']
${TEST_LOG_LEVEL} info
@{TEST_LOG_COMPONENTS} org.opendaylight.controller.remote.rpc
-${EOS_URL} /restconf/operational/entity-owners:entity-owners
+${EOS_URL} /rests/data/entity-owners:entity-owners?content=nonconfig
${RPC_STATUS_ISOLATED} 501
${session} = Resolve_Http_Session_For_Member member_index=${old_brt_owner}
BuiltIn.Run_Keyword_And_Ignore_Error Get_And_Log_EOS_Output_To_Karaf_Log ${session}
BuiltIn.Pass_Execution Rpc on isolated node may work for some time(bug 8207), then will fail (bug 8214)
- ${resp} = RequestsLibrary.Post Request ${session} ${RPC_URL} data=${EMPTY}
- BuiltIn.Should_Be_Equal_As_Numbers ${resp.status_code} ${RPC_STATUS_ISOLATED}
+ ${resp} = RequestsLibrary.POST On Session ${session} url=${RPC_URL} data=${EMPTY}
+ ... expected_status=${RPC_STATUS_ISOLATED}
Rpc_On_Non_Isolated_Cluster_Nodes
[Documentation] Run rpc on remained cluster nodes.
*** Variables ***
-${RPC_URL} /restconf/operations/basic-rpc-test:basic-global
+${RPC_URL} /rests/operations/basic-rpc-test:basic-global
&{EMPTY_DICT}
${SERVICE} Basic-rpc-test']
${TEST_LOG_LEVEL} info
@{TEST_LOG_COMPONENTS} org.opendaylight.controller.remote.rpc
-${EOS_URL} /restconf/operational/entity-owners:entity-owners
+${EOS_URL} /rests/data/entity-owners:entity-owners?content=nonconfig
*** Test Cases ***
*** Test Cases ***
Create Basic Import
[Documentation] schedule a basic import/restore with data containg controller mounting itself as a NETCONF
- ... device. The configuration is documented in
- ... https://docs.opendaylight.org/projects/netconf/en/latest/user-guide.html#spawning-new-netconf-connectors
+ ... device. The configuration is documented in
+ ... https://docs.opendaylight.org/projects/netconf/en/latest/user-guide.html#spawning-new-netconf-connectors
[Tags] create restore
DaeximKeywords.Cleanup The Export Files ${FIRST_CONTROLLER_INDEX}
ClusterManagement.Stop_Members_From_List_Or_All
*** Variables ***
-${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
+${REST_CONTEXT} /rests/data/opendaylight-inventory:nodes
*** Test Cases ***
Get nodeconnector for the root node
[Documentation] Get the inventory for the root node
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:1
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_CONTEXT}/node=openflow%3A1?content=nonconfig
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content}
Get nodeconnector for a node
*** Keywords ***
Check Every Nodes
[Arguments] ${numnodes}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_CONTEXT}?content=nonconfig
+ ... expected_status=200
FOR ${IND} IN RANGE 1 ${numnodes+1}
Should Contain ${resp.content} openflow:${IND}
END
Check Every Nodes Stats
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 1 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_CONTEXT}/node=openflow%3A${IND}?content=nonconfig
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} flow-capable-node-connector-statistics
Should Contain ${resp.content} flow-table-statistics
END
Check Every Nodes Nodeconnector
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 2 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_CONTEXT}/node=openflow%3A${IND}?content=nonconfig
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content}
END
*** Variables ***
-${REST_CONTEXT} /restconf/operational/network-topology:network-topology/topology/flow:1
+${REST_CONTEXT} /rests/data/network-topology:network-topology/topology=flow%3A1?content=nonconfig
*** Test Cases ***
*** Keywords ***
Verify Element Count
[Arguments] ${URI} ${xpath_location} ${expected_count}
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} headers=${ACCEPT_XML}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_CONTEXT}
+ ... headers=${ACCEPT_XML}
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
${count} Get Element Count ${resp.content} xpath=${xpath_location}
Should Be Equal As Numbers ${count} ${expected_count}
... ${False}
... ${True}
Sleep 8
- [Teardown] BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ [Teardown] BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API}
Final Phase
[Documentation] Stops mininet.
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API}
MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
RequestsLibrary.Delete All Sessions
Final Phase
[Documentation] Stops mininet.
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API}
MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
RequestsLibrary.Delete All Sessions
Final Phase
[Documentation] Stops mininet.
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API}
MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
RequestsLibrary.Delete All Sessions
Final Phase
[Documentation] Stops mininet.
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API}
MininetKeywords.Stop Mininet And Exit ${mininet_conn_id}
RequestsLibrary.Delete All Sessions
*** Variables ***
-${XMLSDIR} ${CURDIR}/../../../../csit/variables/openflowplugin
-@{FLOWFILE} f279.xml f280.xml f281.xml f282.xml f283.xml f284.xml f278.xml
-@{GROUPFILE} g279.xml g280.xml g281.xml
-@{GROUP_ID} 1 2 3
-${FLAG_MSG} "bundle-based-reconciliation-enabled configuration property was changed to 'true'"
-${STATIC_FLOW} table=91
+${XMLSDIR} ${CURDIR}/../../../../csit/variables/openflowplugin
+@{FLOWFILE} f279.xml f280.xml f281.xml f282.xml f283.xml f284.xml f278.xml
+@{GROUPFILE} g279.xml g280.xml g281.xml
+@{GROUP_ID} 1 2 3
+${FLAG_MSG} "bundle-based-reconciliation-enabled configuration property was changed to 'true'"
+${STATIC_FLOW} table=91
@{DATA_MODELS}
-... data/opendaylight-inventory:nodes?${RFC8040_CONFIG_CONTENT}
-... data/opendaylight-inventory:nodes?${RFC8040_OPERATIONAL_CONTENT}
-${INTEGRATION_BRIDGE} br-int
+... data/opendaylight-inventory:nodes?${RFC8040_CONFIG_CONTENT}
+... data/opendaylight-inventory:nodes?${RFC8040_OPERATIONAL_CONTENT}
+${INTEGRATION_BRIDGE} br-int
*** Test Cases ***
End Suite
[Documentation] Run at end of the suite
- RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API}
KarafKeywords.Issue_Command_On_Karaf_Console
... log:set INFO org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeReconciliationImpl
SSHLibrary.Close All Connections
[Documentation] Delete all sessions.
${command}= BuiltIn.Set Variable sudo iptables -v -F
BuiltIn.Run Keyword And Ignore Error ClusterManagement.Run_Bash_Command_On_List_Or_All ${command}
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API}
RequestsLibrary.Delete All Sessions
Add Groups And Flows On Member
[Arguments] ${member_index}=1
${session}= Resolve_Http_Session_For_Member member_index=${member_index}
FOR ${switch} IN RANGE 1 ${switches+1}
- RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... ${session}
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1
- RequestsLibrary.Delete Request
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1
+ RequestsLibrary.DELETE On Session
... ${session}
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1
- RequestsLibrary.Delete Request
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1
+ RequestsLibrary.DELETE On Session
... ${session}
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000
END
Check Flow Stats Are Not Frozen
[Documentation] Extract duration for flow 1 in switch 1.
[Arguments] ${member_index}
${session}= Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... ${session}
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=1?content=nonconfig
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=1?content=nonconfig
... headers=${headers}
Log ${resp.content}
- ${json_resp}= RequestsLibrary.To_Json ${resp.content}
+ ${json_resp}= Utils.Json Parse From String ${resp.content}
${flow_list}= Collections.Get_From_Dictionary ${json_resp} flow-node-inventory:flow
${flow_stats}= Collections.Get_From_Dictionary
... ${flow_list}[0]
*** Test Cases ***
Sending Barrier
[Documentation] Test to send barrier
- ${resp}= RequestsLibrary.Post Request
+ ${resp}= RequestsLibrary.POST On Session
... session
- ... ${send_barrier_url}
+ ... url=${send_barrier_url}
... data=${RPC_SEND_BARRIER_DATA}
... headers=${HEADERS_XML}
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Sending Echo
[Documentation] Test to send echo
- ${resp}= RequestsLibrary.Post Request
+ ${resp}= RequestsLibrary.POST On Session
... session
- ... ${send_echo_url}
+ ... url=${send_echo_url}
... data=${RPC_SEND_ECHO_DATA}
... headers=${HEADERS_XML}
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
*** Keywords ***
*** Test Cases ***
Sending Update Table
[Documentation] Test to send table update request
- ${resp}= RequestsLibrary.Post Request
+ ${resp}= RequestsLibrary.POST On Session
... session
- ... ${send_update_table_url}
+ ... url=${send_update_table_url}
... data=${RPC_SEND_UPDATE_TABLE_DATA}
... headers=${HEADERS_XML}
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
*** Keywords ***
Delete Flow
[Documentation] Removes used flow
- ${resp}= RequestsLibrary.Delete Request
+ ${resp}= RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... expected_status=200
Log ${resp.content}
- ${msg}= Set Variable
- ... Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
Flow Presence Config Flow
${headers}= Create Dictionary Accept=application/xml
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}
... headers=${headers}
+ ... expected_status=anything
Log ${resp}
Log ${resp.content}
IF ${resp.status_code}!=200 RETURN ${False} ${EMPTY}
Flow Presence Operational Table
${headers}= Create Dictionary Accept=application/xml
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}?${RFC8040_OPERATIONAL_CONTENT}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}?${RFC8040_OPERATIONAL_CONTENT}
... headers=${headers}
+ ... expected_status=anything
Log ${resp}
Log ${resp.content}
IF ${resp.status_code}!=200 RETURN ${False} ${EMPTY}
Add Flow
Log ${data}
- ${resp}= RequestsLibrary.Put Request
+ ${resp}= RequestsLibrary.PUT On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}
... headers=${HEADERS_XML}
... data=${data}
- ${msg}= Set Variable
- ... Adding flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
+ ... expected_status=200
Delete Flow
- ${resp}= RequestsLibrary.Delete Request
+ ${resp}= RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}
- ${msg}= Set Variable
- ... Delete flow for ${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id} failed, http response ${resp.status_code} received.
- Should Be Equal As Strings ${resp.status_code} 200 msg=${msg}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch_idx}/flow-node-inventory:table=${table_id}/flow=${flow_id}
+ ... expected_status=200
Delete All Flows
[Documentation] Deletes all flows
[Tags] push
${body} OperatingSystem.Get File ${GROUP}
Set Suite Variable ${body}
- ${resp} RequestsLibrary.Put Request
+ ${resp} RequestsLibrary.PUT On Session
... session
- ... ${REST_CONTEXT}/flow-node-inventory:group=1
+ ... url=${REST_CONTEXT}/flow-node-inventory:group=1
... headers=${HEADERS_XML}
... data=${body}
Log ${resp.content}
- BuiltIn.Should_Match "${resp.status_code}" "20?"
Verify after adding group config
[Documentation] Get the group stat in config
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
... ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT}
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${GROUP_NAME}
Verify after adding group operational
[Tags] push
${body} OperatingSystem.Get File ${FLOW}
Set Suite Variable ${body}
- ${resp} RequestsLibrary.Put Request
+ ${resp} RequestsLibrary.PUT On Session
... session
- ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1
+ ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1
... headers=${HEADERS_XML}
... data=${body}
Log ${resp.content}
- BuiltIn.Should_Match "${resp.status_code}" "20?"
Verify after adding flow config
[Documentation] Verify the flow
[Tags] get
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT}
+ ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT}
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${FLOW_NAME}
Verify after adding flow operational
Remove the flow
[Documentation] Remove the flow
- ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1
+ ... expected_status=200
Verify after deleting flow
[Documentation] Verify the flow removal
[Tags] get
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT}
+ ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=1?${RFC8040_CONFIG_CONTENT}
Should Not Contain ${resp.content} ${FLOW_NAME}
Delete the group
[Documentation] Remove the group
[Tags] delete
- ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:group=1
+ ${resp} RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${REST_CONTEXT}/flow-node-inventory:group=1
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Verify after deleting group
[Documentation] Verify the flow removal
[Tags] get
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT}
+ ... url=${REST_CONTEXT}/flow-node-inventory:group=1?${RFC8040_CONFIG_CONTENT}
Should Not Contain ${resp.content} ${GROUP_NAME}
[Tags] push
${body} OperatingSystem.Get File ${METER}
Set Suite Variable ${body}
- ${resp} RequestsLibrary.Put Request
+ ${resp} RequestsLibrary.PUT On Session
... session
- ... ${REST_CONTEXT}/meter=1
+ ... url=${REST_CONTEXT}/meter=1
... headers=${HEADERS_XML}
... data=${body}
Log ${resp.content}
- BuiltIn.Should_Match "${resp.status_code}" "20?"
Verify after adding meter config
[Documentation] Get the meter stat in config
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT}
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${METER_NAME}
Verify after adding meter operational
[Tags] push
${body} OperatingSystem.Get File ${FLOW}
Set Suite Variable ${body}
- ${resp} RequestsLibrary.Put Request
+ ${resp} RequestsLibrary.PUT On Session
... session
- ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2
+ ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=2
... headers=${HEADERS_XML}
... data=${body}
Log ${resp.content}
- BuiltIn.Should_Match "${resp.status_code}" "20?"
Verify after adding flow config
[Documentation] Verify the flow
[Tags] get
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT}
+ ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT}
+ ... expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.content} ${FLOW_NAME}
Verify after adding flow operational
Remove the flow
[Documentation] Remove the flow
- ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=2
+ ... expected_status=200
Verify after deleting flow
[Documentation] Verify the flow removal
[Tags] get
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT}
+ ... url=${REST_CONTEXT}/flow-node-inventory:table=0/flow=2?${RFC8040_CONFIG_CONTENT}
Should Not Contain ${resp.content} ${FLOW_NAME}
Delete the meter
[Documentation] Remove the meter
[Tags] delete
- ${resp} RequestsLibrary.Delete Request session ${REST_CONTEXT}/meter=1
+ ${resp} RequestsLibrary.DELETE On Session session url=${REST_CONTEXT}/meter=1 expected_status=200
Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
Verify after deleting meter
[Documentation] Verify the flow removal
[Tags] get
- ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT}
+ ${resp} RequestsLibrary.GET On Session session url=${REST_CONTEXT}/meter=1?${RFC8040_CONFIG_CONTENT}
Should Not Contain ${resp.content} ${METER_NAME}
Get nodeconnector for the root node
[Documentation] Get the inventory for the root node
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.text}
Get nodeconnector for a node
*** Keywords ***
Check Every Nodes
[Arguments] ${numnodes}
- ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_NODES_API} expected_status=200
FOR ${IND} IN RANGE 1 ${numnodes+1}
Should Contain ${resp.text} openflow:${IND}
END
Check Every Nodes Stats
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 1 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} flow-capable-node-connector-statistics
Should Contain ${resp.text} flow-table-statistics
END
Check Every Nodes Nodeconnector
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 2 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.text}
END
*** Keywords ***
Verify Element Count
[Arguments] ${URI} ${xpath_location} ${expected_count}
- ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
+ ... headers=${ACCEPT_XML}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${count} Get Element Count ${resp.text} xpath=${xpath_location}
Should Be Equal As Numbers ${count} ${expected_count}
Get nodeconnector for the root node
[Documentation] Get the inventory for the root node
${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1?${RFC8040_OPERATIONAL_CONTENT}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.text}
Get nodeconnector for a node
*** Keywords ***
Check Every Nodes
[Arguments] ${numnodes}
- ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_NODES_API}
- Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_NODES_API} expected_status=200
FOR ${IND} IN RANGE 1 ${numnodes+1}
Should Contain ${resp.text} openflow:${IND}
END
Check Every Nodes Stats
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 1 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Should Contain ${resp.text} flow-capable-node-connector-statistics
Should Contain ${resp.text} flow-table-statistics
END
Check Every Nodes Nodeconnector
[Arguments] ${numnodes}
FOR ${IND} IN RANGE 2 ${numnodes+1}
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT}
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${IND}?${RFC8040_OPERATIONAL_CONTENT} expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.text}
END
*** Keywords ***
Verify Element Count
[Arguments] ${URI} ${xpath_location} ${expected_count}
- ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
+ ... headers=${ACCEPT_XML}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
${count} Get Element Count ${resp.text} xpath=${xpath_location}
Should Be Equal As Numbers ${count} ${expected_count}
... Check For Elements At URI
... ${RFC8040_OPERATIONAL_TOPO_API}
... ${node_list}
- ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp} RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
List all the links
*** Keywords ***
Verify Links
[Arguments] ${expected_links}
- ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
- ${result} To JSON ${resp.text}
+ ${result} Utils.Json Parse From String ${resp.text}
Log ${result}
${content} Get From Dictionary ${result} network-topology:topology
${topology} Get From List ${content} 0
*** Test Cases ***
Add a flow - Output to physical port#
[Documentation] Push a flow through REST-API
- ${resp} RequestsLibrary.Put Request
+ ${resp} RequestsLibrary.PUT On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
... headers=${HEADERS_XML}
... data=${BODY2}
- BuiltIn.Should_Match "${resp.status_code}" "20?"
Verify after adding flow config - Output to physical port#
[Documentation] Verify the flow
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
- Should Be Equal As Strings ${resp.status_code} 200
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
+ ... expected_status=200
Should Contain ${resp.text} 152
Verify after adding flow operational - Output to physical port#
Remove a flow - Output to physical port#
[Documentation] Remove a flow
- ${resp} RequestsLibrary.Delete Request
+ ${resp} RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
- Should Be Equal As Strings ${resp.status_code} 204
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=152
+ ... expected_status=204
Verify after deleting flow config - Output to physical port#
[Documentation] Verify the flow
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
- Should Be Equal As Strings ${resp.status_code} 200
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0?content=config
+ ... expected_status=200
Should Not Contain ${resp.text} 152
# Standing bug #368 - This has been fixed
... Check For Elements At URI
... ${RFC8040_OPERATIONAL_TOPO_API}
... ${node_list}
- ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_API}
+ ${resp} RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API}
Log ${resp.text}
List all the links
*** Keywords ***
Verify Links
[Arguments] ${expected_links}
- ${resp} RequestsLibrary.Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
+ ${resp} RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
+ ... expected_status=200
Log ${resp.text}
- Should Be Equal As Strings ${resp.status_code} 200
- ${result} To JSON ${resp.text}
+ ${result} Utils.Json Parse From String ${resp.text}
Log ${result}
${content} Get From Dictionary ${result} network-topology:topology
${topology} Get From List ${content} 0
*** Test Cases ***
Add a flow - Sending IPv4 Dest Address and Eth type
[Documentation] Push a flow through REST-API
- ${resp} RequestsLibrary.Put Request
+ ${resp} RequestsLibrary.PUT On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
... headers=${HEADERS_XML}
... data=${BODY1}
- BuiltIn.Should_Match "${resp.status_code}" "20?"
Verify after adding flow config - Sending IPv4 Dest Address and Eth type
[Documentation] Verify the flow
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
- Should Be Equal As Strings ${resp.status_code} 200
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
+ ... expected_status=200
Should Contain ${resp.text} 139
Verify after adding flow operational - Sending IPv4 Dest Address and Eth type
Modify a flow - Output to physical port#
[Documentation] Push a flow through REST-API
- ${resp} RequestsLibrary.Put Request
+ ${resp} RequestsLibrary.PUT On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
... headers=${HEADERS_XML}
... data=${BODY2}
- Should Be Equal As Strings ${resp.status_code} 204
+ ... expected_status=204
Verify after modifying flow config - Output to physical port#
[Documentation] Verify the flow
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
- Should Be Equal As Strings ${resp.status_code} 200
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
+ ... expected_status=200
Should Contain ${resp.text} 10.0.20.1
Verify after modifying flow operational - Output to physical port#
Remove a flow - Output to physical port#
[Documentation] Remove a flow
- ${resp} RequestsLibrary.Delete Request
+ ${resp} RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
- Should Be Equal As Strings ${resp.status_code} 204
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2/flow=139
+ ... expected_status=204
Verify after deleting flow config - Output to physical port#
[Documentation] Verify the flow
- ${resp} RequestsLibrary.Get Request
+ ${resp} RequestsLibrary.GET On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
- Should Be Equal As Strings ${resp.status_code} 200
+ ... url=${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=2?content=config
+ ... expected_status=200
Should Not Contain ${resp.text} 139
Verify after deleting flow operational - Output to physical port#
Are Switches Connected
[Documentation] Checks Topology Contains a fix number ${switches} of switces.
[Arguments] ${switches}
- ${resp}= RequestsLibrary.Get Request
+ ${resp}= RequestsLibrary.GET On Session
... tcsession
- ... ${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
+ ... url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API}
... headers=${ACCEPT_XML}
Log ${resp.content}
${count}= XML.Get Element Count ${resp.content} xpath=node
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.content}
${count}= Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${swnr}
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.content}
${count}= Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${swnr}
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.content}
${count}= Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${swnr}
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.content}
${count}= Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${swnr}
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.content}
${count}= Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${swnr}
Should Be True ${res}
Check No Switches Inventory
- ${resp}= Get Request session ${RFC8040_OPERATIONAL_NODES_API}
+ ${resp}= GET On Session session ${RFC8040_OPERATIONAL_NODES_API}
Log ${resp.content}
Should Be Equal As Strings '${resp.content}' '{"nodes":{}}'
Deconfigure Flows
[Documentation] Flows deconfiguration
- ${resp}= Delete Request session ${RFC8040_NODES_API}
- Should Be Equal As Numbers ${resp.status_code} 204
+ ${resp}= DELETE On Session session url=${RFC8040_NODES_API} expected_status=204
Check No Flows In Operational Last
[Documentation] Operational datastore to be without any flows
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.content}
${count}= Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${swnr}
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
+ ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
Log ${resp.content}
${count}= Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${swnr}
Are Switches Connected Topo
[Documentation] Checks wheather switches are connected to controller
- ${resp}= Get Request session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
+ ${resp}= GET On Session session url=${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
Log ${resp.content}
${count}= Get Element Count ${resp.content} xpath=node
Should Be Equal As Numbers ${count} ${swnr}
Remove Flows And Groups After Mininet Reconnects
[Documentation] Remove some groups and flows while network is down.
FOR ${switch} IN RANGE 1 ${switches+1}
- RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1
- RequestsLibrary.Delete Request
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1
- RequestsLibrary.Delete Request
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000
END
Check Flows In Operational DS After Mininet Reconnects
[Documentation] Delete all sessions.
${command} BuiltIn.Set Variable sudo iptables -v -F
Utils.Run Command On Controller cmd=${command}
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.DELETE On Session session url=${RFC8040_NODES_API}
RequestsLibrary.Delete All Sessions
Disconnect Controller Mininet
Get Config Topology with Bridge
[Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${resp.text} ${BRIDGE}
Get Operational Topology with Bridge
Delete the Port
[Documentation] This request will delete the port node from the bridge node and data store.
- ${resp} = RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT}
+ ... expected_status=204
Get Operational Topology after Deletion of Port
[Documentation] This request will fetch the operational topology after the Port is deleted
Delete the Bridge
[Documentation] This request will delete the bridge node from the config data store.
- ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
+ ... expected_status=204
Get Operational Topology after Deletion of Bridge
[Documentation] This request will fetch the operational topology after the Bridge is deleted
Verify Config Still Has OVS Info
[Documentation] This will fetch the configuration topology from configuration data store to verify the node is still in the data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
+ Utils.Log Content ${resp.text}
BuiltIn.Wait Until Keyword Succeeds
... 8s
... 2s
Delete the OVSDB Node
[Documentation] This request will delete the OVSDB node
- ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API} expected_status=204
Get Operational Topology to make sure the connection has been deleted
[Documentation] This request will fetch the operational topology from the connected OVSDB nodes
Get Config Topology After Reconnect
[Documentation] This will fetch the configuration topology from configuration data store after reconnect
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
+ Utils.Log Content ${resp.text}
BuiltIn.Wait Until Keyword Succeeds
... 8s
... 2s
Get QOS Config Topology with port
[Documentation] This will fetch the configuration topology from configuration data store to verify the QOS is added to the data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_CONFIG_TOPO_API}
+ ... expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
BuiltIn.Should Contain ${resp.text} ${QOS}
Get Queue Config Topology with port
[Documentation] This request will fetch the configuration topology from configuration data store to verify the Queue is added to the data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_CONFIG_TOPO_API}
+ ... expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
BuiltIn.Should Contain ${resp.text} ${QUEUE}
Delete a Queue entry from a Qos entry
[Documentation] This request will Delete a Queue entry from a Qos entry
- ${resp} = RequestsLibrary.Delete Request
+ ${resp} = RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}/queue-list=0
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}/queue-list=0
+ ... expected_status=anything
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Delete a QoS entry from a node
[Documentation] This request will Delete a QoS entry from a node.
- ${resp} = RequestsLibrary.Delete Request
+ ${resp} = RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}
+ ... expected_status=anything
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Delete a Queue entry from an ovsdb node
[Documentation] This request will Delete a Queue entry from an ovsdb node
- ${resp} = RequestsLibrary.Delete Request
+ ${resp} = RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${QUEUE}
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${QUEUE}
+ ... expected_status=anything
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Delete the OVSDB Node HOST1
[Documentation] This request will delete the OVSDB node
- ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_HOST1_API}
+ ${resp} = RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}
+ ... expected_status=anything
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Get Config Topology to verify that deleted configurations are cleaned from config datastore
[Documentation] This request will fetch the configuration topology from configuration data store to verify OVSDB NODE is deleted frrom the configuration data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
+ ${resp} = RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_CONFIG_TOPO_API}
+ ... expected_status=anything
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
BuiltIn.Should Not Contain ${resp.text} ovsdb:HOST1
Get Config Topology to verify the manually added bridge is not added to the config datastore
[Documentation] This request will fetch the configuration topology from configuration data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
+ Utils.Log Content ${resp.text}
BuiltIn.Should Not Contain ${resp.text} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}/bridge/${BRIDGE1}
Create a Bridge through controller
Get Config Topology to verify the entry added to the config datastore
[Documentation] This request will fetch the configuration topology from configuration data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
Create bridge of already added bridge
Get Config Topology to verify the entry of existing bridge added to the config datastore
[Documentation] This request will fetch the configuration topology from configuration data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE1}
Delete bridge manually
Config Topology Still Contains Bridge
[Documentation] This request will fetch the configuration topology from configuration data store
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
Delete the Bridge through rest call
[Documentation] This request will delete the bridge node from the config data store.
- ${resp} = RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
+ ... expected_status=204
Get Operational Topology after Deletion of Bridge
[Documentation] This request will fetch the operational topology after the Bridge is deleted
Delete the Port1
[Documentation] This request will delete the port node from the bridge node and data store.
- ${resp} = RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT1}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT1}
+ ... expected_status=204
Get Operational Topology after deletion of Port1
[Documentation] This request will fetch the operational topology after the Port is added to the bridge
Delete the Port2
[Documentation] This request will delete the port node from the bridge node and data store.
- ${resp} = RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT2}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT2}
+ ... expected_status=204
Get Operational Topology after Deletion of Port2
[Documentation] This request will fetch the operational topology after the Port is deleted
Delete the Bridge
[Documentation] This request will delete the bridge node from the config data store.
- ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
+ ... expected_status=204
Get Operational Topology after Deletion of Bridge
[Documentation] This request will fetch the operational topology after the Bridge is deleted
Delete the OVSDB Node
[Documentation] This request will delete the OVSDB node
- ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
+ ... expected_status=204
Get Operational Topology after Deletion of OVSDB Node
[Documentation] This request will fetch the operational topology after the OVSDB node is deleted
[Documentation] Cleans up test environment, close existing sessions.
OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_2_IP}
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
OVSDB.Log Config And Operational Topology
RequestsLibrary.Delete All Sessions
... ${TOOLS_SYSTEM_2_IP}
... ${TOOLS_SYSTEM_IP}
[Teardown] BuiltIn.Run Keywords Test Teardown
- ... AND RequestsLibrary.Delete Request session ${RFC8040_TOPO_API} data=${body}
+ ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_TOPO_API} data=${body} expected_status=anything
Bug 7414 Different Endpoint Name
[Documentation] This test case is supplemental to the other test case for bug 7414. Even when the other
... ${TOOLS_SYSTEM_2_IP}
... ${TOOLS_SYSTEM_IP}
[Teardown] BuiltIn.Run Keywords Test Teardown
- ... AND RequestsLibrary.Delete Request session ${RFC8040_TOPO_API} data=${body}
+ ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_TOPO_API} data=${body} expected_status=anything
Bug 5221
[Documentation] In the case that an ovs node is rebooted, or the ovs service is
... ${list}
... pretty_print_json=True
[Teardown] BuiltIn.Run Keywords Test Teardown
- ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${bridge}
- ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
+ ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${bridge} expected_status=anything
+ ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API} expected_status=anything
Bug 5177
[Documentation] This test case will recreate the bug using the same basic steps as
BuiltIn.Set Suite Variable ${OVSDB_UUID}
${node} = BuiltIn.Set Variable uuid/${OVSDB_UUID}
OVSDB.Add Bridge To Ovsdb Node ${node} ${TOOLS_SYSTEM_IP} ${BRIDGE} 0000000000005177
- ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
- OVSDB.Log Request ${resp.text}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
+ ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
+ Utils.Log Content ${resp.text}
BuiltIn.Should Contain ${resp.text} ${node}/bridge/${BRIDGE}
Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
@{list} = BuiltIn.Create List ${BRIDGE}
... Shard.*shard-topology-operational An exception occurred while preCommitting transaction
# TODO: Bug 5178
[Teardown] BuiltIn.Run Keywords Test Teardown
- ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}${node_id}%2Fbridge%2F${BRIDGE}
- ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}${node_id}
+ ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_API}${node_id}%2Fbridge%2F${BRIDGE} expected_status=anything
+ ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_API}${node_id} expected_status=anything
Bug 8280
[Documentation] Any config created for a bridge (e.g. added ports) should be reconciled when a bridge is
Utils.Check For Elements At URI ${RFC8040_CONFIG_TOPO_API} ${config_store_elements} pretty_print_json=True
BuiltIn.Wait Until Keyword Succeeds 5s 1s Verify Ovs-vsctl Output show Port "port2"
[Teardown] BuiltIn.Run Keywords Test Teardown
- ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE}
- ... AND RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}
+ ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE} expected_status=anything
+ ... AND RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2} expected_status=anything
Bug 7160
[Documentation] If this bug is reproduced, it's possible that the operational store will be
OVSDB.Log Config And Operational Topology
OVSDB.Create Qos Linked Queue
OVSDB.Log Config And Operational Topology
- ${resp} = RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${qos}/queue-list=0
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${qos}/queue-list=0
OVSDB.Log Config And Operational Topology
- ${resp} = RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${qos}
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${qos}
OVSDB.Log Config And Operational Topology
- ${resp} = RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${queue}
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${queue}
OVSDB.Log Config And Operational Topology
- ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_HOST1_API}
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}
OVSDB.Log Config And Operational Topology
Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
- RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
OVSDB.Log Config And Operational Topology
BuiltIn.Wait Until Keyword Succeeds 5s 1s OVSDB.Config and Operational Topology Should Be Empty
[Documentation] Cleans up test environment, close existing sessions.
Clean All Ovs Nodes
# Best effort to clean config store, by deleting all the types of nodes that are used in this suite
- RequestsLibrary.Delete Request
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE}
+ ... expected_status=anything
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}
+ ... expected_status=anything
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE}
+ ... expected_status=anything
+ RequestsLibrary.DELETE On Session
+ ... session
+ ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}
+ ... expected_status=anything
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE}
- RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}
- RequestsLibrary.Delete Request
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
+ ... expected_status=anything
+ RequestsLibrary.DELETE On Session
... session
- ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE}
- RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID2}
- RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
- RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
+ ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
+ ... expected_status=anything
OVSDB.Log Config And Operational Topology
Delete All Sessions
-/restconf/config/car-people:car-people
+/rests/data/car-people:car-people
-/restconf/config/car:cars
+/rests/data/car:cars
-/restconf/config/car:cars/car-entry/boogie
+/rests/data/car:cars/car-entry/boogie
-/restconf/config/car-people:car-people/car-person/boogie/joe
+/rests/data/car-people:car-people/car-person/boogie/joe
-/restconf/config/car:cars
+/rests/data/car:cars
-/restconf/config/car-people:car-people
+/rests/data/car-people:car-people
-/restconf/operations/odl-mdsal-lowlevel-control:become-prefix-leader
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:become-prefix-leader
-/restconf/operations/odl-mdsal-lowlevel-control:check-publish-notifications
+/rests/operations/odl-mdsal-lowlevel-control:check-publish-notifications
-/restconf/operations/odl-mdsal-lowlevel-control:create-prefix-shard
+/rests/operations/odl-mdsal-lowlevel-control:create-prefix-shard
-/restconf/operations/odl-mdsal-lowlevel-target:get-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-target:get-constant
-/restconf/operations/odl-mdsal-lowlevel-target:get-contexted-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-target:get-contexted-constant
-/restconf/operations/odl-mdsal-lowlevel-target:get-singleton-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-target:get-singleton-constant
-/restconf/operations/odl-mdsal-lowlevel-control:produce-transactions
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:produce-transactions
-/restconf/operations/odl-mdsal-lowlevel-control:register-bound-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:register-bound-constant
-/restconf/operations/odl-mdsal-lowlevel-control:register-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:register-constant
-/restconf/operations/odl-mdsal-lowlevel-control:register-flapping-singleton
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:register-flapping-singleton
-/restconf/operations/odl-mdsal-lowlevel-control:register-singleton-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:register-singleton-constant
-/restconf/operations/odl-mdsal-lowlevel-control:remove-prefix-shard
+/rests/operations/odl-mdsal-lowlevel-control:remove-prefix-shard
-/restconf/operations/odl-mdsal-lowlevel-control:shutdown-prefix-shard-replica
+/rests/operations/odl-mdsal-lowlevel-control:shutdown-prefix-shard-replica
-/restconf/operations/odl-mdsal-lowlevel-control:shutdown-shard-replica
+/rests/operations/odl-mdsal-lowlevel-control:shutdown-shard-replica
-/restconf/operations/odl-mdsal-lowlevel-control:start-publish-notifications
+/rests/operations/odl-mdsal-lowlevel-control:start-publish-notifications
-/restconf/operations/odl-mdsal-lowlevel-control:subscribe-ddtl
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:subscribe-ddtl
-/restconf/operations/odl-mdsal-lowlevel-control:subscribe-dtcl
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:subscribe-dtcl
-/restconf/operations/odl-mdsal-lowlevel-control:subscribe-ynl
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:subscribe-ynl
-/restconf/operations/odl-mdsal-lowlevel-control:unregister-bound-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:unregister-bound-constant
-/restconf/operations/odl-mdsal-lowlevel-control:unregister-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:unregister-constant
-/restconf/operations/odl-mdsal-lowlevel-control:unregister-flapping-singleton
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:unregister-flapping-singleton
-/restconf/operations/odl-mdsal-lowlevel-control:unregister-singleton-constant
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:unregister-singleton-constant
-/restconf/operations/odl-mdsal-lowlevel-control:unsubscribe-ddtl
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:unsubscribe-ddtl
-/restconf/operations/odl-mdsal-lowlevel-control:unsubscribe-dtcl
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:unsubscribe-dtcl
-/restconf/operations/odl-mdsal-lowlevel-control:unsubscribe-ynl
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:unsubscribe-ynl
-/restconf/operations/odl-mdsal-lowlevel-control:write-transactions
\ No newline at end of file
+/rests/operations/odl-mdsal-lowlevel-control:write-transactions