From 7d16785ab438d5b2475b4ecb2bd358682d5aa47c Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 20 Sep 2021 11:45:56 +0200 Subject: [PATCH] btrfs-progs: tests: test options for defrag -c Regression test for "btrfs-progs: fix defrag -c option parsing" Signed-off-by: David Sterba --- tests/cli-tests/015-defrag-compress/test.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tests/cli-tests/015-defrag-compress/test.sh diff --git a/tests/cli-tests/015-defrag-compress/test.sh b/tests/cli-tests/015-defrag-compress/test.sh new file mode 100755 index 00000000..accbba8c --- /dev/null +++ b/tests/cli-tests/015-defrag-compress/test.sh @@ -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