summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur She <arthur.she@linaro.org>2015-03-19 22:24:28 -0700
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2015-03-24 09:09:36 +0000
commitc058de275e948c8fe1d3671a0efbd23527c5b3aa (patch)
tree2de80ab3cdd5373c4a99df8e03a2a4074273a9c1
parent35b0474cee5f3f4aea1e2b5196c721793523a1d1 (diff)
downloadtest-definitions-pipe-c058de275e948c8fe1d3671a0efbd23527c5b3aa.tar.gz
ubuntu / openembedded: Fix kselftest-net.yaml problem
Run test by using original Makefile. Change-Id: I39f57f45ce8628dca831d2a1eaa71effccf3c1b6
-rwxr-xr-xcommon/scripts/kselftest-net.sh25
-rwxr-xr-xcommon/scripts/kselftest-runner.sh9
-rw-r--r--openembedded/kselftest-net.yaml5
-rw-r--r--ubuntu/kselftest-net.yaml5
4 files changed, 11 insertions, 33 deletions
diff --git a/common/scripts/kselftest-net.sh b/common/scripts/kselftest-net.sh
deleted file mode 100755
index a19696a..0000000
--- a/common/scripts/kselftest-net.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-cd $(dirname $0)
-BASEDIR=$(pwd)
-LAVA_ROOT="${BASEDIR}/../.."
-TEST_DIR="${LAVA_ROOT}/kselftest/net"
-TESTS="socket psock_fanout psock_tpacket"
-
-cd ${TEST_DIR}
-
-if /sbin/modprobe test_bpf; then
- /sbin/rmmod test_bpf;
- echo "test_bpf: pass";
-else
- echo "test_bpf: fail";
-fi
-
-for t in $TESTS
-do
- echo
- echo "Running $t";
- ./$t;
- [ $? -ne 0 ] && echo "$t: fail" || echo "$t: pass";
-done
-
diff --git a/common/scripts/kselftest-runner.sh b/common/scripts/kselftest-runner.sh
index f1526ac..6220051 100755
--- a/common/scripts/kselftest-runner.sh
+++ b/common/scripts/kselftest-runner.sh
@@ -1,13 +1,14 @@
#!/bin/sh
TEST_NAME=$1
-COMMAND=$(basename $2)
-DIR=$(dirname $2)
+COMMAND=$(basename "$2")
+DIR=$(dirname "$2")
LOG="result.log";
cd ${DIR}
-chmod a+x ${COMMAND}
-(./${COMMAND} 2>&1 || echo "${TEST_NAME}: [FAIL]") | tee ${LOG}
+ls ${COMMAND} > /dev/null 2>&1 && chmod a+x ${COMMAND}
+export PATH=.:${PATH}
+(${COMMAND} 2>&1 || echo "${TEST_NAME}: [FAIL]") | tee ${LOG}
if [ -n "`grep \"skip\" ${LOG}`" ]; then
echo "${TEST_NAME}: [SKIP]";
elif [ -z "`grep \"SKIP\|FAIL\" ${LOG}`" ]; then
diff --git a/openembedded/kselftest-net.yaml b/openembedded/kselftest-net.yaml
index 3b8bba7..efb782a 100644
--- a/openembedded/kselftest-net.yaml
+++ b/openembedded/kselftest-net.yaml
@@ -30,7 +30,8 @@ params:
run:
steps:
- - './common/scripts/kselftest-net.sh'
+ - 'cd kselftest/net'
+ - '../../common/scripts/kselftest-runner.sh net "make run_tests"'
parse:
- pattern: "^(?P<test_case_id>[a-z_]+):\\s(?P<result>pass|fail)"
+ pattern: "^(?P<test_case_id>[a-z_ ]+):\\s\\[(?P<result>PASS|FAIL|SKIP)\\]"
diff --git a/ubuntu/kselftest-net.yaml b/ubuntu/kselftest-net.yaml
index ad52e78..924a9c0 100644
--- a/ubuntu/kselftest-net.yaml
+++ b/ubuntu/kselftest-net.yaml
@@ -32,7 +32,8 @@ params:
run:
steps:
- - './common/scripts/kselftest-net.sh'
+ - 'cd kselftest/net'
+ - '../../common/scripts/kselftest-runner.sh net "make run_tests"'
parse:
- pattern: "^(?P<test_case_id>[a-z_]+):\\s(?P<result>pass|fail)"
+ pattern: "^(?P<test_case_id>[a-z_ ]+):\\s\\[(?P<result>PASS|FAIL|SKIP)\\]"