- try:
- vat.script_should_have_passed()
- except AssertionError:
- raise RuntimeError('Failed to get VPP interfaces on host: {name}'.
- format(name=node['host']))
-
- @staticmethod
- def vpp_show_crypto_device_mapping(node):
- """Run "show crypto device mapping" CLI command.
-
- :param node: Node to run command on.
- :type node: dict
- """
- vat = VatExecutor()
- vat.execute_script("show_crypto_device_mapping.vat", node,
- json_out=False)
+ cmd = 'sw_interface_dump'
+ args = dict(name_filter_valid=0, name_filter='')
+ err_msg = 'Failed to get interface dump on host {host}'.format(
+ host=node['host'])
+ with PapiSocketExecutor(node) as papi_exec:
+ details = papi_exec.add(cmd, **args).get_details(err_msg)
+
+ for if_dump in details:
+ if_dump['interface_name'] = if_dump['interface_name'].rstrip('\x00')
+ if_dump['tag'] = if_dump['tag'].rstrip('\x00')
+ if_dump['l2_address'] = L2Util.bin_to_mac(if_dump['l2_address'])
+ # TODO: return only base data
+ logger.trace('Interface data of host {host}:\n{details}'.format(
+ host=node['host'], details=details))