btrfs-progs: tests: add missing protection against running out of test suite

Executing the script inside the directories as './test.sh' is not
supposed to work but could happen accidentally. With an exit after
attempting to source the we can fix that. Not all cases have been fixed
in f6bbe06c08 ("btrfs-progs: tests: add protection against running
out of test suite").

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-04-19 17:08:41 +02:00
parent 5dad958662
commit 3e7cc11ecb
35 changed files with 35 additions and 35 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs-image

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs-corrupt-block
check_prereq mkfs.btrfs

View File

@ -1,6 +1,6 @@
#!/bin/bash
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -11,7 +11,7 @@
#
# a buggy check leads to the above messages
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -20,7 +20,7 @@
# For both fs tree and data reloc tree.
# Special for its backref pointing to itself and its short life span.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -2,7 +2,7 @@
# confirm whether 'btrfs check' supports check ing of a partially dropped
# snapshot
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -1,7 +1,7 @@
#!/bin/bash
# check whether btrfsck can detect running qgroup rescan
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -5,7 +5,7 @@
# Fixed by patch:
# btrfs-progs: Fix stack overflow for checking qgroup on tree reloc tree
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -1,7 +1,7 @@
#!/bin/bash
# confirm that clearing space cache works
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
check_prereq mkfs.btrfs

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Confirm btrfs check can check file extents without causing false alert
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
check_prereq mkfs.btrfs

View File

@ -3,7 +3,7 @@
# An image with mis-aligned superblock total_bytes, that will be found and
# fixed by 'check' or fixed by 'rescue fix-device-size'
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
setup_root_helper

View File

@ -4,7 +4,7 @@
# deletion. # Orphan inode/root will is not referenced and will have an orphan
# item, which should not be reported as error.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -31,7 +31,7 @@
# mount /dev/sdb /mnt
# umount /mnt
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -2,7 +2,7 @@
# To check if "btrfs check" can detect metadata dump (restored by btrfs-image)
# and ignore --check-data-csum option
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
check_prereq mkfs.btrfs

View File

@ -4,7 +4,7 @@
# deletion. Orphan inode/root is not referenced and will have an orphan
# item, which should not be reported as error.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -3,7 +3,7 @@
# doesn't result in false positives. This test is specifically targeted at
# lowmem mode.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
check_prereq mkfs.btrfs

View File

@ -3,7 +3,7 @@
# with immutable/append attributes that are not possible to set by standard
# syscall or ioctl so they're handled as corruption
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -4,7 +4,7 @@
# This old regression could be caught by tree-check code.
# This test case will check if btrfs check could detect and repair it.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -8,7 +8,7 @@
# This test case contains hand crafted minimal image, to test if btrfs check
# can detect and report such error.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -6,7 +6,7 @@
# This test case verifies a special case when 'btrfs check' does not report
# qgroup accounting difference as an error, thus no false alert for btrfs/166.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -6,7 +6,7 @@
# Note: this needs a patched kernel to exercise extents and bitmaps
# ff51bf02d107 ("btrfs: block-group: fix free-space bitmap threshold")
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
setup_root_helper
prepare_test_dev 256M

View File

@ -12,7 +12,7 @@
#
# So btrfs check should report such compressed extent without csum as error.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -23,7 +23,7 @@
# - Sync the fs
# - Replay the log
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -7,7 +7,7 @@
#
# Make sure btrfs check can at least detect such error
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -7,7 +7,7 @@
#
# Make sure btrfs check can at least detect such error.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -3,7 +3,7 @@
# Verify that `btrfs check --init-csum-tree` can handle various nodatasum
# cases.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
check_global_prereq fallocate

View File

@ -7,7 +7,7 @@
#
# Make sure btrfs check can at least detect such error.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -9,7 +9,7 @@
# btrfs_truncate_inode_items() and removing the orphan item at evict time, and
# then rm -rf'ed a directory.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -4,7 +4,7 @@
# data.
#
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
check_prereq mkfs.btrfs

View File

@ -3,7 +3,7 @@
# Make sure "btrfs check" won't report false alerts on sprouted filesystems
#
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
check_prereq mkfs.btrfs

View File

@ -4,7 +4,7 @@
# in device item
#
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
setup_root_helper

View File

@ -3,7 +3,7 @@
# Make sure "btrfs check" can handle degraded raid5.
#
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs
check_prereq mkfs.btrfs

View File

@ -7,7 +7,7 @@
#
# Make sure btrfs check can at least detect such error.
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Ensure that clearning ino cache removes all related items
source "$TEST_TOP/common"
source "$TEST_TOP/common" || exit
check_prereq btrfs