[PATCH kvm-unit-tests 4/6] run_tests: generalize check

Radim Krčmář
2015-12-14T21:24:39Z

config attribute "check" is currently unused.
Provide a simple implementation instead of removing it.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
run_tests.sh | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/run_tests.sh b/run_tests.sh
index 4d813b9a7084..b0b064f2e341 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -35,17 +35,10 @@ function run()
return
fi

- # check a file for a particular value before running a test
- # the check line can contain multiple files to check separated by a space
- # but each check parameter needs to be of the form <path>=<value>
- for check_param in ${check[@]}; do
- path=${check_param%%=*}
- value=${check_param#*=}
- if [ "$path" ] && [ "$(cat $path)" != "$value" ]; then
- echo "skip $1 ($path not equal to $value)"
- return
- fi
- done
+ eval $check || {
+ echo "skip $1 (failed \$($check))"
+ return
+ }

cmdline="TESTNAME=$testname ACCEL=$accel ./$TEST_DIR-run $kernel -smp $smp $opts"
if [ $verbose != 0 ]; then
--
2.6.4