btrfs-progs/tests/convert-tests/022-reiserfs-parent-ref/test.sh
David Sterba f6bbe06c08 btrfs-progs: tests: add 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.

Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-25 16:59:41 +02:00

26 lines
731 B
Bash
Executable File

#!/bin/sh
# Test that only toplevel directory self-reference is created
source "$TEST_TOP/common" || exit
source "$TEST_TOP/common.convert" || exit
setup_root_helper
prepare_test_dev
if ! check_kernel_support_reiserfs >/dev/null; then
_not_run "no reiserfs support"
fi
check_global_prereq mkreiserfs
check_prereq btrfs-convert
run_check $SUDO_HELPER mkreiserfs -q -f -b 4096 "$TEST_DEV"
run_check_mount_test_dev -t reiserfs
run_check $SUDO_HELPER mkdir "$TEST_MNT/a"
run_check $SUDO_HELPER dd if=/dev/urandom of="$TEST_MNT/a/x" bs=1M count=64
run_check $SUDO_HELPER mkdir "$TEST_MNT/a/y"
run_check_umount_test_dev
run_check $SUDO_HELPER "$TOP/btrfs-convert" "$TEST_DEV"
run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV"