- [Documentation] A GET on the /node/${node_id} inventory API is made and flow stats string is checked for existence.
- ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}/node/${node_id}/table/2
- Log ${resp.content}
- Should Be Equal As Strings ${resp.status_code} 200
- Should Contain X Times ${resp.content} priority ${flows}
+ ${resp}= RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_NODES_API}/node=${node_id}/flow-node-inventory:table=2
+ ... expected_status=200
+ Log ${resp.text}
+ Should Contain X Times ${resp.text} priority ${flows}
+
+Check Number Of Hosts
+ [Documentation] Check number of hosts in topology
+ [Arguments] ${hosts}
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
+ Log ${resp.text}
+ ${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 On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
+ Should Not Contain ${resp.text} "node-id":"host:
+
+Add Table Miss Flows
+ [Documentation] Add table miss flows to switches.
+ [Arguments] ${switches}
+ ${switches}= Convert To Integer ${switches}
+ ${data}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/table_miss_flow.json
+ FOR ${switch} IN RANGE 1 ${switches+1}
+ TemplatedRequests.Put As Json To Uri
+ ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=default
+ ... ${data}
+ ... session
+ END
+
+Check Table Miss Flows
+ [Documentation] Check table miss flows in switches.
+ [Arguments] ${switches}
+ ${switches}= Convert To Integer ${switches}
+ FOR ${switch} IN RANGE 1 ${switches+1}
+ TemplatedRequests.Get As Json From Uri
+ ... ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=default
+ ... session
+ END