summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-09-08 18:06:44 +0200
committerDavid Sterba <dsterba@suse.com>2016-09-21 11:48:37 +0200
commitfaaeee5bf3d260b2c011c42a208cffea2e2e1ea5 (patch)
tree74a434062f67f4b0dad0b0f19291204a8ab3091d /tests
parent9fc5aefe458d2a5ad2f24759d094228aee40e27a (diff)
btrfs-progs: tests: add fuzz test to try btrfs-image on all images
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/fuzz-tests/002-simple-image/test.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/fuzz-tests/002-simple-image/test.sh b/tests/fuzz-tests/002-simple-image/test.sh
new file mode 100755
index 00000000..42470ecc
--- /dev/null
+++ b/tests/fuzz-tests/002-simple-image/test.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# iterate over all fuzzed images and run 'btrfs-image'
+
+source $TOP/tests/common
+
+setup_root_helper
+check_prereq btrfs-image
+
+# redefine the one provided by common
+check_image() {
+ local image
+
+ image=$1
+ truncate -s0 target
+ run_mayfail $TOP/btrfs-image "$image" target
+ truncate -s0 target
+}
+
+check_all_images $TOP/tests/fuzz-tests/images
+
+rm -- target
+
+exit 0