btrfs-progs: tests: test options for defrag -c

Regression test for "btrfs-progs: fix defrag -c option parsing"

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-09-20 11:45:56 +02:00
parent 96a5cf0719
commit 7d16785ab4
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/bin/bash
# Test parsing of option 'defrag -c'
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 $SUDO_HELPER "$TOP/btrfs" filesystem defrag -v -c "$TEST_MNT/file"
run_check $SUDO_HELPER "$TOP/btrfs" filesystem defrag -v -clzo "$TEST_MNT/file"
run_check $SUDO_HELPER "$TOP/btrfs" filesystem defrag -v -czlib "$TEST_MNT/file"
run_check $SUDO_HELPER "$TOP/btrfs" filesystem defrag -v -czstd "$TEST_MNT/file"
run_check_umount_test_dev