Refactor IPv4 utils
[csit.git] / resources / libraries / python / topology.py
index 3ced69d..8b6905d 100644 (file)
@@ -323,7 +323,7 @@ class Topology(object):
         This method updates the topology dictionary by querying interface lists
         of all nodes mentioned in the topology dictionary.
         It does this by dumping interface list to json output from all devices
-        using vpe_api_test, and pairing known information from topology
+        using vpp_api_test, and pairing known information from topology
         (mac address/pci address of interface) to state from VPP.
         For TG/linux nodes add interface name only.
         """
@@ -647,3 +647,20 @@ class Topology(object):
                           'DUT1_BD_LINKS': dut1_bd_links,
                           'DUT2_BD_LINKS': dut2_bd_links}
         return topology_links
+
+    @staticmethod
+    def is_tg_node(node):
+        """Find out whether the node is TG
+
+        :param node: node to examine
+        :return: True if node is type of TG; False otherwise
+        """
+        return node['type'] == NodeType.TG
+
+    @staticmethod
+    def get_node_hostname(node):
+        """
+        :param node: node dictionary
+        :return: host name as 'str' type
+        """
+        return node['host']
\ No newline at end of file