2016-11-22 12:32:18 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# additional arguments to various commands
|
|
|
|
|
|
|
|
# already defined, eg. via make argument
|
2017-09-28 07:29:19 +00:00
|
|
|
if [ -z "$TEST_ENABLE_OVERRIDE" ]; then
|
|
|
|
# set to 'true'
|
|
|
|
TEST_ENABLE_OVERRIDE=false
|
2016-11-22 12:32:18 +00:00
|
|
|
|
2017-09-28 07:29:19 +00:00
|
|
|
TEST_ARGS_CHECK=--mode=lowmem
|
|
|
|
fi
|
2016-11-22 12:32:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
# 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
|
2017-03-01 01:21:51 +00:00
|
|
|
#
|
|
|
|
# Return 0 if we need to skip option override
|
|
|
|
# Return 1 if we don't need to skip option override
|
2016-11-22 12:32:18 +00:00
|
|
|
_skip_spec()
|
|
|
|
{
|
2017-03-01 01:21:51 +00:00
|
|
|
local beacon
|
|
|
|
|
|
|
|
beacon=.lowmem_repairable
|
|
|
|
|
|
|
|
# For lowmem repair, only support fs tree repair for now
|
|
|
|
# So we place lowmem repair beacon in the same dir of the test case
|
2017-02-21 08:34:37 +00:00
|
|
|
if echo "$TEST_ARGS_CHECK" | grep -q 'mode=lowmem' &&
|
2016-11-22 12:32:18 +00:00
|
|
|
echo "$@" | grep -q -- '--repair'; then
|
2017-03-01 01:21:51 +00:00
|
|
|
dir="$(dirname ${@: -1})"
|
|
|
|
if [ -f ${dir}/${beacon} ]; then
|
|
|
|
return 1;
|
|
|
|
fi
|
|
|
|
return 0;
|
2016-11-22 12:32:18 +00:00
|
|
|
fi
|
|
|
|
return 1
|
|
|
|
}
|