btrfs-progs: tests: Add testcase for rootdir inline extent size
[platform/upstream/btrfs-progs.git] / tests / common.local
1 #!/bin/bash
2 #
3 # additional arguments to various commands
4
5 # already defined, eg. via make argument
6 if [ -z "$TEST_ENABLE_OVERRIDE" ]; then
7     # set to 'true'
8     TEST_ENABLE_OVERRIDE=false
9
10     TEST_ARGS_CHECK=--mode=lowmem
11 fi
12
13
14 # gets arguments of a current command and can decide if the argument insertion
15 # should happen, eg. if some option combination does not make sense or would
16 # break tests
17 #
18 # Return 0 if we need to skip option override
19 # Return 1 if we don't need to skip option override
20 _skip_spec()
21 {
22         local beacon
23
24         beacon=.lowmem_repairable
25
26         # For lowmem repair, only support fs tree repair for now
27         # So we place lowmem repair beacon in the same dir of the test case
28         if echo "$TEST_ARGS_CHECK" | grep -q 'mode=lowmem' &&
29            echo "$@" | grep -q -- '--repair'; then
30                 dir="$(dirname ${@: -1})"
31                 if [ -f ${dir}/${beacon} ]; then
32                         return 1;
33                 fi
34                 return 0;
35         fi
36         return 1
37 }