+ @staticmethod
+ def get_tg_type(tg_node):
+ """Log and return the installed traffic generator type.
+
+ :param tg_node: Node from topology file.
+ :type tg_node: dict
+ :returns: Traffic generator type string.
+ :rtype: str
+ :raises RuntimeError: If command returns nonzero return code.
+ """
+ return str(check_subtype(tg_node))
+
+ @staticmethod
+ def get_tg_version(tg_node):
+ """Log and return the installed traffic generator version.
+
+ :param tg_node: Node from topology file.
+ :type tg_node: dict
+ :returns: Traffic generator version string.
+ :rtype: str
+ :raises RuntimeError: If command returns nonzero return code.
+ """
+ subtype = check_subtype(tg_node)
+ if subtype == NodeSubTypeTG.TREX:
+ command = f"cat {Constants.TREX_INSTALL_DIR}/VERSION"
+ message = u"Get T-Rex version failed!"
+ stdout, _ = exec_cmd_no_error(tg_node, command, message=message)
+ return stdout.strip()
+ else:
+ return "none"
+
+ # TODO: pylint disable=too-many-locals.