summaryrefslogtreecommitdiff
path: root/tests/common.local
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-11-22 13:32:18 +0100
committerDavid Sterba <dsterba@suse.com>2016-11-23 11:07:06 +0100
commit50e742a6b096116b0a0117127127775f8e03bff6 (patch)
treebd317440e5b03d905b3fbc2fbb76ecdf3f0397c2 /tests/common.local
parent55db7bf0598ab782d64cd1605a3c9a7162997a54 (diff)
btrfs-progs: tests: add support for additional command arguments
Add convenient support for extending command arguments, now implemented for 'btrfs check' to cover the low-memory mode. If defined, arguments are inserted to any 'btrfs check' command in tests. Exceptions could be defined in common.local. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests/common.local')
-rw-r--r--tests/common.local25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/common.local b/tests/common.local
new file mode 100644
index 00000000..9f567c27
--- /dev/null
+++ b/tests/common.local
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# additional arguments to various commands
+
+# already defined, eg. via make argument
+if [ -n "$TEST_ENABLE_OVERRIDE" ]; then
+ return
+fi
+
+# set to 'true'
+TEST_ENABLE_OVERRIDE=false
+
+TEST_ARGS_CHECK=--mode=lowmem
+
+# gets arguments of a current command and can decide if the argument insertion
+# should happen, eg. if some option combination does not make sense or would
+# break tests
+_skip_spec()
+{
+ if echo "$TEST_CHECK" | grep -q 'mode=lowmem' &&
+ echo "$@" | grep -q -- '--repair'; then
+ return 0
+ fi
+ return 1
+}