Re: [PATCH 3/4] btrfs-progs: test clean start after failures

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

 



On Fri, Apr 03, 2020 at 10:10:42AM +0800, Anand Jain wrote:
> After a failure it fails for a different reason
> 
> === START TEST
> /btrfs-progs/tests/misc-tests/029-send-p-different-mountpoints
> $TEST_DEV not given, using /btrfs-progs/tests/test.img as fallback
> ====== RUN MAYFAIL mkdir -p
> /btrfs-progs/tests/misc-tests/029-send-p-different-mountpoints/subvol_mnt
> ====== RUN CHECK /btrfs-progs/mkfs.btrfs -f /btrfs-progs/tests/test.img
> ERROR: /btrfs-progs/tests/test.img is mounted <====
> 
> Add clean_start() helper to unmount.

The testsuite is designed to stop on first failure and it's up the user
to investigate and clean it up before starting it again. For that
there's the test-clean make target. In some cases it might not clean up
the environment completely, but that's typically if the test image is
not unmoutnable due to some process having the directory open.

> +# add all the cleanups here
> +clean_start()
> +{
> +	grep -q $TEST_MNT /proc/self/mounts && umount $TEST_MNT
> +}
> +
>  init_env()
>  {
>  	TEST_MNT="${TEST_MNT:-$TEST_TOP/mnt}"
> diff --git a/tests/misc-tests.sh b/tests/misc-tests.sh
> index 3b49ab012e78..3dc96f258540 100755
> --- a/tests/misc-tests.sh
> +++ b/tests/misc-tests.sh
> @@ -40,6 +40,7 @@ export IMAGE
>  export TEST_DEV
>  
>  rm -f "$RESULTS"
> +clean_start

Instead of this I'd rather make it a hard stop if there's some problem
with the environment, like the mountpoint still mounted, or more loop
devices from the specific tests still set up as loop devices etc.

When I get to this situation I fix it manually (checkint mount output,
losetup -D), but it'd be nice to have that automated.



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

  Powered by Linux