Log more info when mke2fs fails on a guest
We have a device not found issue, but it's unclear if the device
doesn't exist at all, or it's in the wrong place. When we fail, dump
out the contents of /dev for further review.
Change-Id: I8b66b8acadc1d50a5ea7befd5ca6874c1dedcb4e
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index 2e233c5..8f5faef 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -16,6 +16,7 @@
from oslo_log import log as logging
from tempest_lib.common import ssh
+import tempest_lib.exceptions
from tempest import config
from tempest import exceptions
@@ -178,4 +179,10 @@
def make_fs(self, dev_name, fs='ext4'):
cmd_mkfs = 'sudo /usr/sbin/mke2fs -t %s /dev/%s' % (fs, dev_name)
- self.exec_command(cmd_mkfs)
+ try:
+ self.exec_command(cmd_mkfs)
+ except tempest_lib.exceptions.SSHExecCommandFailed:
+ LOG.error("Couldn't mke2fs")
+ cmd_why = 'sudo ls -lR /dev'
+ LOG.info("Contents of /dev: %s" % self.exec_command(cmd_why))
+ raise