From c2d3f549960e3a21196dc535e123b709abd55f34 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 13 Mar 2017 18:07:28 +0100 Subject: [PATCH] btrfs-progs: tests: cleanup use of IMAGE and replace by helpers Nearly each use of IMAGE can be replaced by common helpers as there are no specific requirements on the testing filesystem. There are still a few left that need to be evaluated and converted eventually. Signed-off-by: David Sterba --- tests/misc-tests/009-subvolume-sync-must-wait/test.sh | 8 ++++---- tests/misc-tests/013-subvolume-sync-crash/test.sh | 8 ++++---- tests/misc-tests/014-filesystem-label/test.sh | 8 ++++---- tests/misc-tests/016-send-clone-src/test.sh | 4 ++-- tests/misc-tests/017-recv-stream-malformatted/test.sh | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/misc-tests/009-subvolume-sync-must-wait/test.sh b/tests/misc-tests/009-subvolume-sync-must-wait/test.sh index 92c896f9..fa3f09ab 100755 --- a/tests/misc-tests/009-subvolume-sync-must-wait/test.sh +++ b/tests/misc-tests/009-subvolume-sync-must-wait/test.sh @@ -9,9 +9,9 @@ check_prereq btrfs setup_root_helper -run_check truncate -s 2G $IMAGE -run_check $TOP/mkfs.btrfs -f $IMAGE -run_check $SUDO_HELPER mount $IMAGE $TEST_MNT +prepare_test_dev +run_check $TOP/mkfs.btrfs -f "$TEST_DEV" +run_check_mount_test_dev run_check $SUDO_HELPER chmod a+rw $TEST_MNT cd $TEST_MNT @@ -49,4 +49,4 @@ run_check $SUDO_HELPER $TOP/btrfs subvolume list -d . wait cd .. -run_check $SUDO_HELPER umount $TEST_MNT +run_check_umount_test_dev diff --git a/tests/misc-tests/013-subvolume-sync-crash/test.sh b/tests/misc-tests/013-subvolume-sync-crash/test.sh index 4cb1b4e7..cd445961 100755 --- a/tests/misc-tests/013-subvolume-sync-crash/test.sh +++ b/tests/misc-tests/013-subvolume-sync-crash/test.sh @@ -10,9 +10,9 @@ check_prereq btrfs setup_root_helper -run_check truncate -s 2G $IMAGE -run_check $TOP/mkfs.btrfs -f $IMAGE -run_check $SUDO_HELPER mount $IMAGE $TEST_MNT +prepare_test_dev +run_check "$TOP/mkfs.btrfs" -f "$TEST_DEV" +run_check_mount_test_dev run_check $SUDO_HELPER chmod a+rw $TEST_MNT cd $TEST_MNT @@ -46,4 +46,4 @@ run_check $SUDO_HELPER $TOP/btrfs subvolume list -d . wait cd .. -run_check $SUDO_HELPER umount $TEST_MNT +run_check_umount_test_dev diff --git a/tests/misc-tests/014-filesystem-label/test.sh b/tests/misc-tests/014-filesystem-label/test.sh index a5e08ccc..753aa9ea 100755 --- a/tests/misc-tests/014-filesystem-label/test.sh +++ b/tests/misc-tests/014-filesystem-label/test.sh @@ -9,9 +9,9 @@ check_prereq btrfs setup_root_helper -run_check truncate -s 2G $IMAGE -run_check $TOP/mkfs.btrfs -L BTRFS-TEST-LABEL -f $IMAGE -run_check $SUDO_HELPER mount $IMAGE $TEST_MNT +prepare_test_dev +run_check "$TOP/mkfs.btrfs" -L BTRFS-TEST-LABEL -f "$TEST_DEV" +run_check_mount_test_dev run_check $SUDO_HELPER chmod a+rw $TEST_MNT cd $TEST_MNT @@ -66,4 +66,4 @@ run_check $SUDO_HELPER $TOP/btrfs filesystem label $TEST_MNT cd .. -run_check $SUDO_HELPER umount $TEST_MNT +run_check_umount_test_dev diff --git a/tests/misc-tests/016-send-clone-src/test.sh b/tests/misc-tests/016-send-clone-src/test.sh index e256eef9..479da677 100755 --- a/tests/misc-tests/016-send-clone-src/test.sh +++ b/tests/misc-tests/016-send-clone-src/test.sh @@ -9,9 +9,9 @@ check_prereq mkfs.btrfs check_prereq btrfs setup_root_helper -prepare_test_dev 1g -run_check $TOP/mkfs.btrfs -f $IMAGE +prepare_test_dev 1g +run_check "$TOP/mkfs.btrfs" -f "$TEST_DEV" run_check_mount_test_dev here=`pwd` diff --git a/tests/misc-tests/017-recv-stream-malformatted/test.sh b/tests/misc-tests/017-recv-stream-malformatted/test.sh index 884b7d42..3756be27 100755 --- a/tests/misc-tests/017-recv-stream-malformatted/test.sh +++ b/tests/misc-tests/017-recv-stream-malformatted/test.sh @@ -8,9 +8,9 @@ check_prereq mkfs.btrfs check_prereq btrfs setup_root_helper -prepare_test_dev 1g -run_check $TOP/mkfs.btrfs -f $IMAGE +prepare_test_dev 1g +run_check "$TOP/mkfs.btrfs" -f "$TEST_DEV" run_check_mount_test_dev echo -n '' | run_mayfail $SUDO_HELPER "$TOP/btrfs" receive "$TEST_MNT" &&