- try:
- vat.script_should_have_passed()
- except AssertionError:
- raise RuntimeError('Failed to get VPP version on host: {name}'.
- format(name=node['host']))
+ with PapiExecutor(node) as papi_exec:
+ data = papi_exec.add('show_version').execute_should_pass().\
+ verify_reply()
+ version = ('VPP version: {ver}\n'.
+ format(ver=data['version'].rstrip('\0x00')))
+ if verbose:
+ version += ('Compile date: {date}\n'
+ 'Compile location: {cl}\n '.
+ format(date=data['build_date'].rstrip('\0x00'),
+ cl=data['build_directory'].rstrip('\0x00')))
+ logger.info(version)
+ return data['version'].rstrip('\0x00')
+
+ @staticmethod
+ def vpp_show_version_verbose(node):
+ """Run "show_version" API command and return verbose string of version
+ data.
+
+ :param node: Node to run command on.
+ :type node: dict
+ """
+ VPPUtil.vpp_show_version(node, verbose=True)