mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-27 16:02:56 +00:00
ecb66fd754
We need to call the setup_root_helper before we start messing with the loop devices. Reviewed-by: Neal Gompa <neal@gompa.dev> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
37 lines
903 B
Bash
Executable File
37 lines
903 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Make sure "btrfs check" can handle degraded raid5.
|
|
#
|
|
|
|
source "$TEST_TOP/common"
|
|
|
|
check_prereq btrfs
|
|
check_prereq mkfs.btrfs
|
|
check_global_prereq losetup
|
|
check_global_prereq wipefs
|
|
|
|
setup_root_helper
|
|
|
|
setup_loopdevs 3
|
|
prepare_loopdevs
|
|
dev1=${loopdevs[1]}
|
|
dev2=${loopdevs[2]}
|
|
dev3=${loopdevs[3]}
|
|
|
|
# Run 1: victim is dev1
|
|
run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -m raid5 -d raid5 "${loopdevs[@]}"
|
|
run_check $SUDO_HELPER wipefs -fa $dev1
|
|
run_check $SUDO_HELPER "$TOP/btrfs" check $dev2
|
|
|
|
# Run 2: victim is dev2
|
|
run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -m raid5 -d raid5 "${loopdevs[@]}"
|
|
run_check $SUDO_HELPER wipefs -fa $dev2
|
|
run_check $SUDO_HELPER "$TOP/btrfs" check $dev3
|
|
|
|
# Run 3: victim is dev3
|
|
run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f -m raid5 -d raid5 "${loopdevs[@]}"
|
|
run_check $SUDO_HELPER wipefs -fa $dev3
|
|
run_check $SUDO_HELPER "$TOP/btrfs" check $dev1
|
|
|
|
cleanup_loopdevs
|