summaryrefslogtreecommitdiff
path: root/tests/misc-tests/008-leaf-crossing-stripes
diff options
context:
space:
mode:
authorNicholas D Steeves <nsteeves@gmail.com>2016-04-23 00:41:30 +0100
committerNicholas D Steeves <nsteeves@gmail.com>2016-04-23 00:41:30 +0100
commitcec572daccafa1e912cbed363df6f84687778c6f (patch)
tree7d99ab9f73d25c1ed8eaf6393f6374edf5316b03 /tests/misc-tests/008-leaf-crossing-stripes
btrfs-progs (4.4.1-1.1) unstable; urgency=medium
* Non-maintainer upload. * New upstream release. * Rename package to btrfs-progs (Closes: #780081) * Update standards version to 3.9.7 (no changes needed). * debian/control: Add "Breaks" per Gianfranco Costamagna's suggestion * Change lintian override to reflect package rename * Switch from using postinst and postrm to using triggers per Christian Seiler's recommendation. # imported from the archive
Diffstat (limited to 'tests/misc-tests/008-leaf-crossing-stripes')
-rwxr-xr-xtests/misc-tests/008-leaf-crossing-stripes/test.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/misc-tests/008-leaf-crossing-stripes/test.sh b/tests/misc-tests/008-leaf-crossing-stripes/test.sh
new file mode 100755
index 00000000..03818062
--- /dev/null
+++ b/tests/misc-tests/008-leaf-crossing-stripes/test.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# test if btrfs-convert creates a filesystem without leaf crossing stripes
+
+source $TOP/tests/common
+
+check_prereq btrfs-convert
+check_prereq btrfs
+
+# In my test, it happened in 514M~560M, 737M~769M, 929M~917M,
+# and HAVE_ERROR=((size + 1) / 2) % 2 if size >= 970
+#
+SIZE_FROM=514
+SIZE_END=560
+A_PRIME_NUM=17
+for ((size = SIZE_FROM; size <= SIZE_END; size += A_PRIME_NUM)); do
+ run_check truncate -s "$size"M "$IMAGE"
+ run_check mkfs.ext4 -F "$IMAGE"
+ run_check $TOP/btrfs-convert "$IMAGE"
+ run_check_stdout $TOP/btrfs check "$IMAGE" 2>&1 |
+ grep -q "crossing stripe boundary" &&
+ _fail "leaf crossing stripes after btrfs-convert"
+done
+
+# grep will expectedly fail
+exit 0