... ELSE IF '${device_type}' == 'org.opendaylight.mdsal.ServiceEntityType' Extract_Service_Entity_Type ${data}
... ELSE Fail Not recognized device type: ${device_type}
${json} = RequestsLibrary.To_Json ${clear_data}
- ${entity_type_list} = Collections.Get_From_Dictionary &{json}[entity-owners] entity-type
+ ${entity_type_list} = Collections.Get_From_Dictionary ${json}[entity-owners] entity-type
${entity_type_index} = Utils.Get_Index_From_List_Of_Dictionaries ${entity_type_list} type ${entity_type}
BuiltIn.Should_Not_Be_Equal_As_Integers ${entity_type_index} -1 No Entity Owner found for ${device_type}
- ${entity_list} = Collections.Get_From_Dictionary @{entity_type_list}[${entity_type_index}] entity
+ ${entity_list} = Collections.Get_From_Dictionary ${entity_type_list}[${entity_type_index}] entity
${entity_index} = Utils.Get_Index_From_List_Of_Dictionaries ${entity_list} id ${device_name}
BuiltIn.Should_Not_Be_Equal_As_Integers ${entity_index} -1 Device ${device_name} not found in Entity Owner ${device_type}
- ${entity_owner} = Collections.Get_From_Dictionary @{entity_list}[${entity_index}] owner
+ ${entity_owner} = Collections.Get_From_Dictionary ${entity_list}[${entity_index}] owner
BuiltIn.Should_Not_Be_Empty ${entity_owner} No owner found for ${device_name}
${owner} = String.Replace_String ${entity_owner} member- ${EMPTY}
${owner} = BuiltIn.Convert_To_Integer ${owner}
- ${entity_candidates_list} = Collections.Get_From_Dictionary @{entity_list}[${entity_index}] candidate
+ ${entity_candidates_list} = Collections.Get_From_Dictionary ${entity_list}[${entity_index}] candidate
FOR ${entity_candidate} IN @{entity_candidates_list}
- ${candidate} = String.Replace_String &{entity_candidate}[name] member- ${EMPTY}
+ ${candidate} = String.Replace_String ${entity_candidate}[name] member- ${EMPTY}
${candidate} = BuiltIn.Convert_To_Integer ${candidate}
Collections.Append_To_List ${candidate_list} ${candidate}
END
${data} = TemplatedRequests.Get_As_Json_From_Uri uri=${ENTITY_OWNER_URI} session=${session} http_timeout=${http_timeout}
${candidate_list} = BuiltIn.Create_List
${json} = RequestsLibrary.To_Json ${data}
- ${entity_type_list} = Collections.Get_From_Dictionary &{json}[entity-owners] entity-type
+ ${entity_type_list} = Collections.Get_From_Dictionary ${json}[entity-owners] entity-type
${entity_type_index} = Utils.Get_Index_From_List_Of_Dictionaries ${entity_type_list} type ${type}
BuiltIn.Should_Not_Be_Equal_As_Integers ${entity_type_index} -1 No Entity Owner found for ${type}
- ${entity_list} = Collections.Get_From_Dictionary @{entity_type_list}[${entity_type_index}] entity
+ ${entity_list} = Collections.Get_From_Dictionary ${entity_type_list}[${entity_type_index}] entity
${entity_index} = Utils.Get_Index_From_List_Of_Dictionaries ${entity_list} id ${id}
BuiltIn.Should Not_Be_Equal_As_Integers ${entity_index} -1 Id ${id} not found in Entity Owner ${type}
- ${entity_owner} = Collections.Get_From_Dictionary @{entity_list}[${entity_index}] owner
+ ${entity_owner} = Collections.Get_From_Dictionary ${entity_list}[${entity_index}] owner
BuiltIn.Should_Not_Be_Empty ${entity_owner} No owner found for type=${type} id=${id}
${owner} = String.Replace_String ${entity_owner} member- ${EMPTY}
${owner} = BuiltIn.Convert_To_Integer ${owner}
- ${entity_candidates_list} = Collections.Get_From_Dictionary @{entity_list}[${entity_index}] candidate
+ ${entity_candidates_list} = Collections.Get_From_Dictionary ${entity_list}[${entity_index}] candidate
FOR ${entity_candidate} IN @{entity_candidates_list}
- ${candidate} = String.Replace_String &{entity_candidate}[name] member- ${EMPTY}
+ ${candidate} = String.Replace_String ${entity_candidate}[name] member- ${EMPTY}
${candidate} = BuiltIn.Convert_To_Integer ${candidate}
Collections.Append_To_List ${candidate_list} ${candidate}
END
[Documentation] Check Linear topology.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_TOPO_API}
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
- Should Contain ${resp.content} "node-id":"openflow:${switch}"
- Should Contain ${resp.content} "tp-id":"openflow:${switch}:1"
- Should Contain ${resp.content} "tp-id":"openflow:${switch}:2"
- Should Contain ${resp.content} "source-tp":"openflow:${switch}:2"
- Should Contain ${resp.content} "dest-tp":"openflow:${switch}:2"
+ Should Contain ${resp.text} "node-id":"openflow:${switch}"
+ Should Contain ${resp.text} "tp-id":"openflow:${switch}:1"
+ Should Contain ${resp.text} "tp-id":"openflow:${switch}:2"
+ Should Contain ${resp.text} "source-tp":"openflow:${switch}:2"
+ Should Contain ${resp.text} "dest-tp":"openflow:${switch}:2"
${edge} Evaluate ${switch}==1 or ${switch}==${switches}
- Run Keyword Unless ${edge} Should Contain ${resp.content} "tp-id":"openflow:${switch}:3"
- Run Keyword Unless ${edge} Should Contain ${resp.content} "source-tp":"openflow:${switch}:3"
- Run Keyword Unless ${edge} Should Contain ${resp.content} "dest-tp":"openflow:${switch}:3
+ Run Keyword Unless ${edge} Should Contain ${resp.text} "tp-id":"openflow:${switch}:3"
+ Run Keyword Unless ${edge} Should Contain ${resp.text} "source-tp":"openflow:${switch}:3"
+ Run Keyword Unless ${edge} Should Contain ${resp.text} "dest-tp":"openflow:${switch}:3
END
Check No Switches On Member
[Documentation] Check no switch is in topology
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_TOPO_API}
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${switch} IN RANGE 1 ${switches+1}
- Should Not Contain ${resp.content} openflow:${switch}
+ Should Not Contain ${resp.text} openflow:${switch}
END
Check Number Of Flows On Member
[Documentation] Check number of flows in the inventory.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
${resp}= RequestsLibrary.Get Request ${session} ${OPERATIONAL_NODES_API}
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- ${count}= Get Count ${resp.content} "priority"
+ ${count}= Get Count ${resp.text} "priority"
Should Be Equal As Integers ${count} ${flows}
Check Number Of Groups On Member
[Documentation] Check number of groups in the inventory.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
${resp}= RequestsLibrary.Get Request ${session} ${OPERATIONAL_NODES_API}
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- ${group_count}= Get Count ${resp.content} "group-type"
+ ${group_count}= Get Count ${resp.text} "group-type"
Should Be Equal As Integers ${group_count} ${groups}
"""
result = ''
for s in strings:
- if isinstance(s, str) or isinstance(s, unicode):
+ if isinstance(s, str) or isinstance(s, str):
result += s
if result == '':
return None
with particular depth and fanout parameters
'''
result = 0
- for i in xrange(depth):
+ for i in range(depth):
result += fanout**i
return result
if __name__ == '__main__':
- print(num_of_nodes(3, 4))
+ print((num_of_nodes(3, 4)))
while loop:
try:
flowlist = inqueue.get(timeout=1)
- except Queue.Empty:
+ except queue.Empty:
if exitevent.is_set() and inqueue.empty():
loop = False
continue
# lets fill the queue with details needed for one http requests
# we have lists with flow details for particular (switch, table) tupples, now we need to split the lists
# according to the flows per request (fpr) paramer
- sendqueue = Queue.Queue()
+ sendqueue = queue.Queue()
for flowgroup, flow_list in flowgroups.items():
while len(flow_list) > 0:
sendqueue.put(flow_list[:int(fpr)])
flow_list = flow_list[int(fpr):]
# result_gueue
- resultqueue = Queue.Queue()
+ resultqueue = queue.Queue()
# creaet exit event
exitevent = threading.Event()
${index}= Set Variable -1
FOR ${i} IN RANGE ${length}
${dictionary}= Get From List ${dictionary_list} ${i}
- Run Keyword If """&{dictionary}[${key}]""" == """${value}""" Set Test Variable ${index} ${i}
+ Run Keyword If """${dictionary}[${key}]""" == """${value}""" Set Test Variable ${index} ${i}
END
[Return] ${index}
[Arguments] ${string} ${dictionary_item_occurrence}
[Documentation] Check string for occurrences of items expressed in a list of dictionaries {item=occurrences}. 0 occurences means item is not present.
FOR ${item} IN @{dictionary_item_occurrence}
- Should Contain X Times ${string} ${item} &{dictionary_item_occurrence}[${item}]
+ Should Contain X Times ${string} ${item} ${dictionary_item_occurrence}[${item}]
END
Post Log Check
regroups = re.finditer(pat, text)
outdict = {}
for g in regroups:
- print(g.group())
+ print((g.group()))
if g.group('key') == '_uuid':
cntl_uuid = g.group('value')
outdict[cntl_uuid] = {}
cntls = copy.deepcopy(controllers)
# replacing string value of is_connected key with boolean
- for key, cntl in cntls.iteritems():
+ for key, cntl in cntls.items():
if cntl['is_connected'] == 'false':
cntl['is_connected'] = False
elif cntl['is_connected'] == 'true':
cntl['is_connected'] = None
# replacing keys with the same values
- for key, value in bridges.iteritems():
+ for key, value in bridges.items():
brs[value['name'][1:-1]] = brs[key]
del brs[key]
- for key, value in brs.iteritems():
+ for key, value in brs.items():
# replace string with references with dict of controllers
ctl_refs = value['controller'][1:-1].split(',')
value['controller'] = {}
if ctl_ref is not '':
value['controller'][ctl_ref] = cntls[ctl_ref]
- for brkey, bridge in brs.iteritems():
+ for brkey, bridge in brs.items():
new_cntls = {}
- for cnkey, cntl in bridge['controller'].iteritems():
+ for cnkey, cntl in bridge['controller'].items():
# port 6654 is set by OvsMAnager.robot to disconnect from controller
if '6653' in cntl['target'] or '6633' in cntl['target'] or '6654' in cntl['target']:
new_key = cntl['target'].split(":")[1] # getting middle from "tcp:ip:6653"
Log ${resp.content}
${json_resp} = RequestsLibrary.To_Json ${resp.content}
${flow_list} = Collections.Get_From_Dictionary ${json_resp} flow-node-inventory:flow
- ${flow_stats} = Collections.Get_From_Dictionary @{flow_list}[0] opendaylight-flow-statistics:flow-statistics
- ${duration} = Collections.Get_From_Dictionary &{flow_stats}[duration] second
+ ${flow_stats} = Collections.Get_From_Dictionary ${flow_list}[0] opendaylight-flow-statistics:flow-statistics
+ ${duration} = Collections.Get_From_Dictionary ${flow_stats}[duration] second
Return From Keyword ${duration}
[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
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content}
+ Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.text}
Get nodeconnector for a node
[Documentation] Get the inventory for a node
${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${IND} IN RANGE 1 ${numnodes+1}
- Should Contain ${resp.content} openflow:${IND}
+ Should Contain ${resp.text} 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}
- Log ${resp.content}
+ Log ${resp.text}
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
+ 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 session ${REST_CONTEXT}/node/openflow:${IND}
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content}
+ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.text}
END
Check conn loop
Verify Element Count
[Arguments] ${URI} ${xpath_location} ${expected_count}
${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} headers=${ACCEPT_XML}
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- ${count}= Get Element Count ${resp.content} xpath=${xpath_location}
+ ${count}= Get Element Count ${resp.text} xpath=${xpath_location}
Should Be Equal As Numbers ${count} ${expected_count}
[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
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content}
+ Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.text}
Get nodeconnector for a node
[Documentation] Get the inventory for a node
${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}
Should Be Equal As Strings ${resp.status_code} 200
FOR ${IND} IN RANGE 1 ${numnodes+1}
- Should Contain ${resp.content} openflow:${IND}
+ Should Contain ${resp.text} 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}
- Log ${resp.content}
+ Log ${resp.text}
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
+ 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 session ${REST_CONTEXT}/node/openflow:${IND}
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content}
+ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.text}
END
Check conn loop
Verify Element Count
[Arguments] ${URI} ${xpath_location} ${expected_count}
${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} headers=${ACCEPT_XML}
- Log ${resp.content}
+ Log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
- ${count}= Get Element Count ${resp.content} xpath=${xpath_location}
+ ${count}= Get Element Count ${resp.text} xpath=${xpath_location}
Should Be Equal As Numbers ${count} ${expected_count}