+
+ @staticmethod
+ def vpp_get_tap_interface_name(node, sw_if_idx):
+ """Get VPP tap interface name from hardware interfaces dump.
+
+ :param node: DUT node.
+ :param sw_if_idx: DUT node.
+ :type node: dict
+ :type sw_if_idx: int
+ :returns: VPP tap interface name.
+ :rtype: str
+ """
+ with VatTerminal(node, json_param=False) as vat:
+ response = vat.vat_terminal_exec_cmd_from_template(
+ 'show_hardware_detail.vat')
+
+ for line in str(response[0]).splitlines():
+ if line.startswith('tap-'):
+ line_split = line.split()
+ if line_split[1] == sw_if_idx:
+ return line_split[0]
+
+ return None
+
+ @staticmethod
+ def vpp_get_tap_interface_mac(node, sw_if_idx):
+ """Get tap interface MAC address from hardware interfaces dump.
+
+ :param node: DUT node.
+ :param sw_if_idx: DUT node.
+ :type node: dict
+ :type sw_if_idx: int
+ :returns: Tap interface MAC address.
+ :rtype: str
+ """
+ with VatTerminal(node, json_param=False) as vat:
+ response = vat.vat_terminal_exec_cmd_from_template(
+ 'show_hardware_detail.vat')
+
+ tap_if_match = False
+ for line in str(response[0]).splitlines():
+ if tap_if_match:
+ line_split = line.split()
+ return line_split[-1]
+ if line.startswith('tap-'):
+ line_split = line.split()
+ if line_split[1] == sw_if_idx:
+ tap_if_match = True
+
+ return None