[PATCH 3/3] Use --yes option to lvcreate

Kent Overstreet
2021-04-27T16:44:33Z

This fixes spurious test failures caused by broken pipe messages.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
---
tests/generic/081 | 2 +-
tests/generic/108 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/generic/081 b/tests/generic/081
index 5dff079852..26702007ab 100755
--- a/tests/generic/081
+++ b/tests/generic/081
@@ -70,7 +70,7 @@ _scratch_mkfs_sized $((300 * 1024 * 1024)) >>$seqres.full 2>&1
$LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1
# We use yes pipe instead of 'lvcreate --yes' because old version of lvm
# (like 2.02.95 in RHEL6) don't support --yes option
-yes | $LVM_PROG lvcreate -L 256M -n $lvname $vgname >>$seqres.full 2>&1
+$LVM_PROG lvcreate --yes -L 256M -n $lvname $vgname >>$seqres.full 2>&1
# wait for lvcreation to fully complete
$UDEV_SETTLE_PROG >>$seqres.full 2>&1

diff --git a/tests/generic/108 b/tests/generic/108
index 6fb194f43c..74945fdf3c 100755
--- a/tests/generic/108
+++ b/tests/generic/108
@@ -56,7 +56,7 @@ $LVM_PROG pvcreate -f $SCSI_DEBUG_DEV $SCRATCH_DEV >>$seqres.full 2>&1
$LVM_PROG vgcreate -f $vgname $SCSI_DEBUG_DEV $SCRATCH_DEV >>$seqres.full 2>&1
# We use yes pipe instead of 'lvcreate --yes' because old version of lvm
# (like 2.02.95 in RHEL6) don't support --yes option
-yes | $LVM_PROG lvcreate -i 2 -I 4m -L 275m -n $lvname $vgname \
+$LVM_PROG lvcreate --yes -i 2 -I 4m -L 275m -n $lvname $vgname \
>>$seqres.full 2>&1
# wait for lv creation to fully complete
$UDEV_SETTLE_PROG >>$seqres.full 2>&1
--
2.31.1