Debugging information when dpdk bind fails should be improved 59/66459/3
authorDanielMartinBuckley <daniel.m.buckley@intel.com>
Thu, 17 Jan 2019 14:50:46 +0000 (14:50 +0000)
committerEmma Foley <emma.l.foley@intel.com>
Wed, 6 Feb 2019 17:40:46 +0000 (17:40 +0000)
JIRA: YARDSTICK-1585

When dpdk-devbind.py is failing, the information provided is poor,
making it difficult to debug.

At least the exact command used should be printed, ideally with the
returned error. As of today, the more interesting line is

DpdkBindHelperException: /opt/nsb_bin/dpdk-devbind.py command
failed with rc=1

Change-Id: I7831c81ffa9e1f4695480eb140fa97a58ff88f8c
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
yardstick/network_services/helpers/dpdkbindnic_helper.py
yardstick/network_services/vnf_generic/vnf/sample_vnf.py
yardstick/ssh.py

index 1c74355..0fc63f8 100644 (file)
@@ -284,6 +284,7 @@ printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \
         res = self.ssh_helper.execute(*args, **kwargs)
         if res[0] != 0:
             template = '{} command failed with rc={}'
+            LOG.critical("DPDK_DEVBIND Failure %s", res[1])
             raise DpdkBindHelperException(template.format(self.dpdk_devbind, res[0]))
         return res
 
index aec0850..b044523 100644 (file)
@@ -231,6 +231,9 @@ class DpdkVnfSetupEnvHelper(SetupEnvHelper):
         exit_status = self.dpdk_bind_helper.check_dpdk_driver()
         if exit_status == 0:
             return
+        else:
+            LOG.critical("DPDK Driver not installed")
+            return
 
     def _setup_resources(self):
         # what is this magic?  how do we know which socket is for which port?
index 438e815..6bc6010 100644 (file)
@@ -80,6 +80,7 @@ from yardstick.common import exceptions
 from yardstick.common.utils import try_int, NON_NONE_DEFAULT, make_dict_from_map
 from yardstick.network_services.utils import provision_tool
 
+LOG = logging.getLogger(__name__)
 
 def convert_key_to_str(key):
     if not isinstance(key, (paramiko.RSAKey, paramiko.DSSKey)):
@@ -337,6 +338,7 @@ class SSH(object):
             details = fmt % {"cmd": cmd, "status": exit_status}
             if stderr_data:
                 details += " Last stderr data: '%s'." % stderr_data
+            LOG.critical("PROX ERROR: %s", details)
             raise exceptions.SSHError(error_msg=details)
         return exit_status