mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-27 07:20:53 +00:00
btrfs-progs: tests: add templates for most common test types
Create a ready-to-use templates for the most common tests, copied from readme. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
5b0e18ce6c
commit
9d98ad1db5
10
tests/template/check-all-images
Normal file
10
tests/template/check-all-images
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# Run check on all images
|
||||
|
||||
source "$TEST_TOP/common"
|
||||
|
||||
check_image() {
|
||||
run_check "$TOP/btrfs" check --readonly "$1"
|
||||
}
|
||||
|
||||
check_all_images
|
16
tests/template/multi-mkfs-mount
Normal file
16
tests/template/multi-mkfs-mount
Normal file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# Create a new multi-device filesystem and test that it can be mounted
|
||||
|
||||
source "$TEST_TOP/common"
|
||||
|
||||
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
|
12
tests/template/single-mkfs-mount
Normal file
12
tests/template/single-mkfs-mount
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# Simple test to create a new filesystem and test that it can be mounted
|
||||
|
||||
source "$TEST_TOP/common"
|
||||
|
||||
setup_root_helper
|
||||
prepare_test_dev
|
||||
|
||||
run_check_mkfs_test_dev
|
||||
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
|
Loading…
Reference in New Issue
Block a user