btrfs-progs/tests/convert-tests/022-reiserfs-parent-ref/test.sh
Qu Wenruo 666f3c971d btrfs-progs: tests: add support check to convert-tests/022
[BUG]
The test case convert/022 will fail if the system doesn't have
reiserfs support nor reiserfs user space tools:

  # make TEST=022\* test-convert
    [TEST]   convert-tests.sh
  WARNING: reiserfs filesystem not listed in /proc/filesystems, some tests might be skipped
    [TEST/conv]   022-reiserfs-parent-ref
  Failed system wide prerequisities: mkreiserfs
  test failed for case 022-reiserfs-parent-ref
  make: *** [Makefile:443: test-convert] Error 1

[CAUSE]
Unlike other test cases, convert/022 doesn't even check if we have
kernel support for it.

[FIX]
Add the proper check before doing system wide prerequisities checks.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:12 +02:00

26 lines
715 B
Bash
Executable File

#!/bin/sh
# Test that only toplevel directory self-reference is created
source "$TEST_TOP/common"
source "$TEST_TOP/common.convert"
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"