btrfs-progs/tests/template/multi-mkfs-mount
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

17 lines
417 B
Bash

#!/bin/bash
# Create a new multi-device filesystem and test that it can be mounted
source "$TEST_TOP/common" || exit
setup_root_helper
setup_loopdevs 4
prepare_loopdevs
TEST_DEV=${loopdevs[1]}
run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -d raid1 -m raid1 "${loopdevs[@]}"
run_check_mount_test_dev
run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file bs=1M count=1
run_check_umount_test_dev
cleanup_loopdevs