On Wed, Nov 11, 2015 at 05:57:33PM +0800, Zhaolei wrote:
....
> Fix:
>  Add a condition to to check if current lvm support --yes option,
>  Tested in above RHEL 6.3 platform.
> 
> Changelog v1->v2:
>  Use yes pipe, suggested by: Eryu Guan <[email protected]>
> 
> Signed-off-by: Zhao Lei <[email protected]>
> ---
>  tests/generic/081 | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/081 b/tests/generic/081
> index 8334ec9..1970075 100755
> --- a/tests/generic/081
> +++ b/tests/generic/081
> @@ -65,7 +65,11 @@ 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
> +if $LVM_PROG lvcreate --yes --version >>$seqres.full 2>&1; then
> +     $LVM_PROG lvcreate --yes -L 256M -n $lvname $vgname >>$seqres.full 2>&1
> +else
> +     yes | $LVM_PROG lvcreate -L 256M -n $lvname $vgname >>$seqres.full 2>&1
> +fi

If the current version of lvm works with the pipe version, then just
use that unconditionally.

-Dave.
-- 
Dave Chinner
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to