From 1f86b3de0620055a9c5f39f4ab43b2c0d2078e00 Mon Sep 17 00:00:00 2001 From: Arthur She Date: Mon, 6 Jul 2015 13:50:57 +0800 Subject: ubuntu/scripts/rt-tests-parser.sh Correct the test case id in test result and make it work for both Ubuntu and OE. Change-Id: I3f15bb19dfe4681f70ffa8a71d58e8ba0d78ece7 --- ubuntu/pmqtest.yaml | 2 +- ubuntu/ptsematest.yaml | 2 +- ubuntu/scripts/rt-tests-parser.sh | 28 ++++++---------------------- ubuntu/sigwaittest.yaml | 2 +- ubuntu/svsematest.yaml | 2 +- 5 files changed, 10 insertions(+), 26 deletions(-) (limited to 'ubuntu') diff --git a/ubuntu/pmqtest.yaml b/ubuntu/pmqtest.yaml index 6cacae0..efc3aaa 100644 --- a/ubuntu/pmqtest.yaml +++ b/ubuntu/pmqtest.yaml @@ -28,7 +28,7 @@ params: run: steps: - 'pmqtest -l ${LOOPS} -S | tee result.log' - - './ubuntu/scripts/rt-tests-parser.sh result.log' + - './ubuntu/scripts/rt-tests-parser.sh pmqtest result.log' - 'lava-test-run-attach result.log' parse: diff --git a/ubuntu/ptsematest.yaml b/ubuntu/ptsematest.yaml index b1fa0fa..b916580 100644 --- a/ubuntu/ptsematest.yaml +++ b/ubuntu/ptsematest.yaml @@ -28,7 +28,7 @@ params: run: steps: - 'ptsematest -l ${LOOPS} -t | tee result.log' - - './ubuntu/scripts/rt-tests-parser.sh result.log' + - './ubuntu/scripts/rt-tests-parser.sh ptsematest result.log' - 'lava-test-run-attach result.log' parse: diff --git a/ubuntu/scripts/rt-tests-parser.sh b/ubuntu/scripts/rt-tests-parser.sh index b5cea6e..e86c931 100755 --- a/ubuntu/scripts/rt-tests-parser.sh +++ b/ubuntu/scripts/rt-tests-parser.sh @@ -1,39 +1,23 @@ #!/bin/sh -LOG=$1 +TESTNAME=$1 +LOG=$2 # Find the last line number which starting with control character -N=`grep -n "#0:" ${LOG} | tail -n1 | cut -d':' -f1` -# The rest of lines from #N is the final test result we want -sed -i "s/\x1b\[[0-9]A//" ${LOG} # Remove the control code +N=`grep -n "^#1 -> #0" ${LOG} | tail -n1 | cut -d':' -f1` sed -n "${N},$ p" ${LOG} > tmp.log -mv tmp.log ${LOG} -sed "s/.*> //" ${LOG} | sed "s/^#/A/" > tmp.log - -grep "CPU" tmp.log > v.log -grep -v "CPU" tmp.log > res.log -while read l; -do - k="`echo ${l} | cut -d: -f1`" - v="`echo ${l} | cut -d, -f3|sed 's/^ //'`" - eval ${k}=${v} - while read m; - do - eval sed -i "s/${k}/\$${k}/" res.log - done < res.log -done < v.log while read l do TC="`echo ${l} | cut -d',' -f1`" - R="`echo ${l} | sed 's/^CPU[0-9]*, //'`" + R="`echo ${l} | cut -d',' -f2-`" IFS=',' for c in ${R} do c="`echo $c|sed 's/^[ ]*//'`" t="`echo ${c} | cut -d' ' -f1`" v="`echo ${c} | cut -d' ' -f2`" - echo "${TC}_${t}: ${v} usec pass" + echo "${TESTNAME} ${TC} (${t}): ${v} usec pass" done unset IFS -done < res.log +done < tmp.log diff --git a/ubuntu/sigwaittest.yaml b/ubuntu/sigwaittest.yaml index 5570cb7..1d42e2f 100644 --- a/ubuntu/sigwaittest.yaml +++ b/ubuntu/sigwaittest.yaml @@ -27,7 +27,7 @@ params: run: steps: - 'sigwaittest -l ${LOOPS} -t | tee result.log' - - './ubuntu/scripts/rt-tests-parser.sh result.log' + - './ubuntu/scripts/rt-tests-parser.sh sigwaittest result.log' - 'lava-test-run-attach result.log' parse: diff --git a/ubuntu/svsematest.yaml b/ubuntu/svsematest.yaml index ca25a7a..c02e79f 100644 --- a/ubuntu/svsematest.yaml +++ b/ubuntu/svsematest.yaml @@ -28,7 +28,7 @@ params: run: steps: - 'svsematest -l ${LOOPS} -t | tee result.log' - - './ubuntu/scripts/rt-tests-parser.sh result.log' + - './ubuntu/scripts/rt-tests-parser.sh svsematest result.log' - 'lava-test-run-attach result.log' parse: -- cgit v1.2.3