+Check No Switches In Inventory
+ [Documentation] Check no switch is in inventory
+ [Arguments] ${switches}
+ ${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}"
+ END
+
+Check No Switches In Topology
+ [Documentation] Check no switch is in topology
+ [Arguments] ${switches}
+ ${resp}= RequestsLibrary.GET On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
+ Log ${resp.text}
+ FOR ${switch} IN RANGE 1 ${switches+1}
+ Should Not Contain ${resp.text} openflow:${switch}
+ END
+
+Check Switches In Inventory
+ [Documentation] Check all switches and stats in operational inventory
+ [Arguments] ${switches}
+ FOR ${switch} IN RANGE 1 ${switches+1}
+ ${resp}= RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_NODES_API}/node=openflow%3A${switch}
+ ... expected_status=200
+ Log ${resp.text}
+ 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 On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
+ Log ${resp.text}
+ ${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 On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
+ Log ${resp.text}
+ ${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 On Session session url=${RFC8040_OPERATIONAL_TOPO_API} expected_status=200
+ Log ${resp.text}
+ FOR ${switch} IN RANGE 1 ${switches+1}
+ 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}
+ IF not ${edge}
+ Should Contain ${resp.text} "tp-id":"openflow:${switch}:3"
+ END
+ IF not ${edge}
+ Should Contain ${resp.text} "source-tp":"openflow:${switch}:3"
+ END
+ IF not ${edge}
+ Should Contain ${resp.text} "dest-tp":"openflow:${switch}:3"
+ END
+ END
+
+Check Flows Operational Datastore
+ [Documentation] Check if number of Operational Flows on member of given index is equal to ${flow_count}.
+ [Arguments] ${flow_count} ${controller_ip}=${ODL_SYSTEM_IP}
+ ${sw} ${reported_flow} ${found_flow}= ScaleClient.Flow Stats Collected controller=${controller_ip}
+ Should_Be_Equal_As_Numbers ${flow_count} ${found_flow}
+
+Check Number Of Flows
+ [Documentation] Check number of flows in the inventory.
+ [Arguments] ${flows}
+ ${resp}= RequestsLibrary.GET On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_NODES_API}
+ ... expected_status=200
+ Log ${resp.text}
+ ${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 On Session
+ ... session
+ ... url=${RFC8040_OPERATIONAL_NODES_API}
+ ... expected_status=200
+ Log ${resp.text}
+ ${group_count}= Get Count ${resp.text} "group-type"
+ Should Be Equal As Integers ${group_count} ${groups}
+