From aa60a2a8ab33b46034b88046cb9cf95425f3dc09 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Mon, 21 Dec 2015 17:07:16 +1100 Subject: [PATCH] generic/081: Support old version of lvm generic/081 and 108 fails in RHEL 6.3, like: # ./check generic/081 FSTYP -- btrfs PLATFORM -- Linux/x86_64 kerneldev 4.2.0-rc5_HEAD_d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754_+ MKFS_OPTIONS -- /dev/vdd MOUNT_OPTIONS -- /dev/vdd /var/ltf/tester/scratch_mnt generic/081 [failed, exit status 1] - output mismatch (see /var/lib/xfstests/results//generic/081.out.bad) --- tests/generic/081.out 2015-07-13 17:07:03.000000000 +0800 +++ /var/lib/xfstests/results//generic/081.out.bad 2015-10-28 12:20:49.000000000 +0800 @@ -1,2 +1,3 @@ QA output created by 081 Silence is golden +ERROR: checking status of /dev/mapper/vg_081-base_081: No such file or directory Ran: generic/081 Failures: generic/081 Failed 1 of 1 tests Reason: Command of "lvm lvcreate --yes" failed because lvm in RHEL 6.3 don't support '--yes' option. Fix: Use yes pipe instead '--yes' option for lvm, to make the command support both new and old version of lvm. Suggested-by: Dave Chinner Suggested-by: Eryu Guan Signed-off-by: Zhao Lei Reviewed-by: Eryu Guan Signed-off-by: Dave Chinner --- tests/generic/081 | 4 +++- tests/generic/108 | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/generic/081 b/tests/generic/081 index 8334ec93..11755d4d 100755 --- a/tests/generic/081 +++ b/tests/generic/081 @@ -65,7 +65,9 @@ mkdir -p $mnt # lvm uses some space for metadata _scratch_mkfs_sized $((300 * 1024 * 1024)) >>$seqres.full 2>&1 $LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1 -$LVM_PROG lvcreate --yes -L 256M -n $lvname $vgname >>$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 # wait for lvcreation to fully complete $UDEV_SETTLE_PROG >>$seqres.full 2>&1 diff --git a/tests/generic/108 b/tests/generic/108 index ff3d3e69..cc8d7038 100755 --- a/tests/generic/108 +++ b/tests/generic/108 @@ -72,7 +72,9 @@ echo "SCSI debug device $SCSI_DEBUG_DEV" >>$seqres.full # create striped volume with 4MB stripe size $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 -$LVM_PROG lvcreate --yes -i 2 -I 4m -l 100%FREE -n $lvname $vgname \ +# 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 100%FREE -n $lvname $vgname \ >>$seqres.full 2>&1 # wait for lv creation to fully complete $UDEV_SETTLE_PROG >>$seqres.full 2>&1 -- 2.30.2