btrfs-progs: tests: add 002-no-force-mixed-on-small-volume
authorDavid Sterba <dsterba@suse.com>
Mon, 19 Oct 2015 16:12:35 +0000 (18:12 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 2 Nov 2015 08:35:05 +0000 (09:35 +0100)
Verify that we do not force mixed block groups on small volumes anymore.

Signed-off-by: David Sterba <dsterba@suse.com>
tests/mkfs-tests/002-no-force-mixed-on-small-volume/test.sh [new file with mode: 0755]

diff --git a/tests/mkfs-tests/002-no-force-mixed-on-small-volume/test.sh b/tests/mkfs-tests/002-no-force-mixed-on-small-volume/test.sh
new file mode 100755 (executable)
index 0000000..007a0eb
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+#
+# Verify that we do not force mixed block groups on small volumes anymore
+
+source $TOP/tests/common
+
+check_prereq btrfs-show-super
+check_prereq mkfs.btrfs
+setup_root_helper
+
+run_check truncate -s 512M $IMAGE
+mixed=$(run_check_stdout $TOP/mkfs.btrfs -n 64k -f $IMAGE | egrep 'Data|Metadata')
+echo "$mixed" | grep -q -v 'Data+Metadata:' || _fail "unexpected: created a mixed-bg filesystem"