Re: [PATCH 3/8] shared: use new test setup preamble

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Wed, Jun 27, 2018 at 11:20 AM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
>
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---
[...]
> diff --git a/tests/shared/298 b/tests/shared/298
> index e7b7b233de45..fc2d090a2f66 100755
> --- a/tests/shared/298
> +++ b/tests/shared/298
> @@ -6,15 +6,22 @@
>  #
>  # Test that filesystem sends discard requests only on free blocks
>  #
> -seq=`basename $0`
> -seqres=$RESULT_DIR/$seq
> -echo "QA output created by $seq"
> +. common/setup_test
>
> -status=1       # failure is the default!
> -trap "_cleanup; exit \$status" 0 1 2 3 15
> +# test exit cleanup goes here
> +cleanup() {
> +       $UMOUNT_PROG $loop_dev &> /dev/null
> +       _destroy_loop_device $loop_dev
> +       if [ $status -eq 0 ]; then
> +               rm $img_file
> +               rm -rf $workdir
> +       fi
> +}
>
> -. ./common/rc
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
>
> +# include test specific environments here
>  _supported_fs ext4 xfs
>  _supported_os Linux
>  _require_test
> @@ -24,15 +31,8 @@ _require_xfs_io_command "fiemap"
>  _require_fs_space $TEST_DIR 307200
>  [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
>
> -_cleanup()
> -{
> -       $UMOUNT_PROG $loop_dev &> /dev/null
> -       _destroy_loop_device $loop_dev
> -       if [ $status -eq 0 ]; then
> -               rm -rf $tmp
> -               rm $img_file
> -       fi
> -}
> +workdir=$TEST_DIR/$$
> +mkdir -p $workdir

:-/ I don't like this s/tmp/workdir conversion and don't like the idea
of having to do the same thing for 16 btrfs tests + 1 generic test.
IIUC, you changed the test from using tmpdir under $here to
tmpdir under $TEST_DIR. Why not change it to tmpdir under /tmp?

Only change you will need to do is:
-tmp=`mktemp -d`
+mkdir -p $tmp

Thanks,
Amir.
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux