Fixing grep in validate mount point
When we look for the mount point of a labeled partition it can
happen that the grep command reports more than one mount point
because the devices start with the same path.
As an example, let's consider /dev/vda1, assigned from the
command ``/sbin/blkid | grep 'ephemeral0' | cut -d':'``
If we now call the ``mount`` command and grep for that
device, we actually get 2 different mount point:
sudo mount | grep '/dev/vda1' | cut -d' ' -f1
/dev/vda1
/dev/vda15
This output will make the test fail.
As a fix, we call the grep command with the -w option that match
only entire words:
sudo mount | grep -w '/dev/vda1' | cut -d' ' -f1
/dev/vda1
Change-Id: I2eaad4c91d9beec7077fb71186713e552afaa11a
diff --git a/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py b/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py
index 61e5323..ae00efc 100644
--- a/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py
+++ b/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py
@@ -107,7 +107,7 @@
self.assertNotEqual('', device)
# Validate the mount point for the device
- cmd = "mount | grep '%s' | cut -d' ' -f3" % device
+ cmd = "mount | grep -w '%s' | cut -d' ' -f3" % device
actual_mount = client.exec_command(cmd).rstrip('\n')
LOG.debug("Partition mount point is %s", actual_mount)
self.assertEqual(actual_mount, mount)