"User-Agent": "csit agent",
},
auth=("admin", "admin"),
+ timeout=5.0,
)
info(
- "Response %s ",
+ "Response %s",
resp,
)
+ info(
+ "Response JSON %s",
+ resp.json(),
+ )
- return resp.json()
+ if resp.status_code == status_codes["bad_request"]:
+ info(
+ "Status code is '%s' - trying operational data instead.",
+ resp.status_code,
+ )
+ result = get_entities_data(restconf_url)
+ else:
+ result = resp.json()
+
+ return result
def get_entity_name(e_type, e_name):
},
data=data,
auth=("admin", "admin"),
+ timeout=5.0,
)
info(
- "Entity json %s",
+ "Response %s",
+ resp,
+ )
+ info(
+ "Response JSON %s",
resp.json(),
)
},
data=data,
auth=("admin", "admin"),
+ timeout=5.0,
)
info(
- "Response %s ",
+ "Response %s",
resp,
)
+ info(
+ "Response JSON %s",
+ resp.json(),
+ )
if resp.status_code == status_codes["bad_request"]:
info(
return result
+def get_entities_data(restconf_url):
+ """
+ Get the entity information from the datastore for Silicon
+ or earlier versions.
+ :param restconf_url: RESTCONF URL up to the RESTCONF root
+ """
+ resp = get(
+ url=restconf_url + "/data/entity-owners:entity-owners",
+ headers={
+ "Accept": "application/yang-data+json",
+ "User-Agent": "csit agent",
+ },
+ auth=("admin", "admin"),
+ timeout=5.0,
+ )
+
+ info(
+ "Response %s",
+ resp,
+ )
+ info(
+ "Response JSON %s",
+ resp.json(),
+ )
+
+ return resp.json()
+
+
def get_entity_type_data(restconf_url, e_type):
"""
Get the entity information for the given entity type from the datastore
"User-Agent": "csit agent",
},
auth=("admin", "admin"),
+ timeout=5.0,
)
info(
- "Response %s ",
+ "Response %s",
resp,
)
info(
- "Entity json %s",
+ "Response JSON %s",
resp.json(),
)
${ip} = Resolve_IP_Address_For_Member member_index=${index}
${entity_type} = BuiltIn.Set_Variable_If '${device_type}' == 'netconf' netconf-node/${device_name} ${device_type}
${url} = BuiltIn.Catenate SEPARATOR= http:// ${ip} :8181/ ${RESTCONF_URI}
- ${entity_result} = ClusterEntities.get entity ${url} ${entity_type} ${device_name}
+ ${entity_result} = ClusterEntities.Get_Entity ${url} ${entity_type} ${device_name}
${entity_candidates} = Collections.Get_From_Dictionary ${entity_result} candidates
${entity_owner} = Collections.Get_From_Dictionary ${entity_result} owner
BuiltIn.Should_Not_Be_Empty ${entity_owner} No owner found for ${device_name}
Library SSHLibrary
Library RequestsLibrary
Library XML
+Library Collections
+Library ${CURDIR}/../../../libraries/ClusterEntities.py
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/Utils.robot
Resource ${CURDIR}/../../../libraries/FlowLib.robot
Resource ${CURDIR}/../../../libraries/OvsManager.robot
Resource ${CURDIR}/../../../libraries/ClusterManagement.robot
Resource ${CURDIR}/../../../libraries/ClusterOpenFlow.robot
-Library Collections
+Resource ${CURDIR}/../../../variables/openflowplugin/Variables.robot
*** Variables ***
${SWITCHES} 1
${START_CMD} sudo mn --topo linear,${SWITCHES}
@{CONTROLLER_NODES} ${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP}
@{cntls_idx_list} ${1} ${2} ${3}
-${ENTITY_OWNER_URI} rests/data/entity-owners:entity-owners
*** Test Cases ***
Start Mininet To All Nodes
Check No Device Owners In Controller
[Documentation] Check there is no owners in controllers
- ${session} = Resolve_Http_Session_For_Member member_index=${active_member}
- # FIXME: The URI only works for Silicon & earlier versions. This should be replaced with new RPC calls for Phosphorus.
- ${data} = TemplatedRequests.Get_As_Json_From_Uri uri=${ENTITY_OWNER_URI} session=${session}
+ ${ip} = Resolve_IP_Address_For_Member member_index=${active_member}
+ ${url} = BuiltIn.Catenate SEPARATOR= http:// ${ip} :8181 ${RFC8040_RESTCONF_ROOT}
+ ${data} = ClusterEntities.Get_Entities ${url}
+ ${data} = BuiltIn.Convert_To_String ${data}
#ofp-topology-manager entity is introduced in the OPNFLWPLUG-1022 bug fix, and this entity will
#always be present in the EOS output. All 3 controller nodes will be candidate, so EOS output will
#contain 6 members (members show 2 times).