diff options
author | Vincent Hsu <vincent.hsu@linaro.org> | 2013-09-05 13:40:04 +0800 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2013-09-05 20:17:13 +0300 |
commit | 688fb597f1770ae40a0d325c725177a566d1caf2 (patch) | |
tree | d794dacd6ca37fff30df649c8fafd5825d27b874 /openembedded | |
parent | 4f0a15d4d9a168a40e09e3b8cbe2af1051fd2303 (diff) |
openembedded/cyclictest: fix cyclictest test
Signed-off-by: Vincent Hsu <vincent.hsu@linaro.org>
Acked-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'openembedded')
-rw-r--r-- | openembedded/cyclictest.yaml | 13 | ||||
-rwxr-xr-x | openembedded/scripts/cyclictest.py | 39 | ||||
-rwxr-xr-x | openembedded/scripts/infinite_loop.py | 14 |
3 files changed, 64 insertions, 2 deletions
diff --git a/openembedded/cyclictest.yaml b/openembedded/cyclictest.yaml index 523633a..6632602 100644 --- a/openembedded/cyclictest.yaml +++ b/openembedded/cyclictest.yaml @@ -6,5 +6,14 @@ metadata: run: steps: - - "exec cyclictest -t50 -p 80 -i 10000 -n -d 86400 -a 1 > ~/cyclictest.log" - - "lava-test-case-attach ~/cyclictest.log text/plain" + - "fping -g 127.0.0.1 127.0.0.10 -t 100 -q -l &> /dev/null &" + - "./openembedded/scripts/infinite_loop.py 864300 &> /dev/null &" + - "cyclictest -t 50 -p 80 -n -a0 -q -D 86400 > ~/cyclictest.log" + - "cat ~/cyclictest.log | ./openembedded/scripts/cyclictest.py" + - "lava-test-run-attach ~/cyclictest.log text/plain" + - "killall calibrator infinite_loop.py fping" +parse: + pattern: "^test_case_id:(?P<test_case_id>.+)\\s+result:(?P<result>\\w+)\\s+measurement:(?P<measurement>.+)\\s+units:(?P<units>.+)" + fixupdict: + PASS: pass + FAIL: fail diff --git a/openembedded/scripts/cyclictest.py b/openembedded/scripts/cyclictest.py new file mode 100755 index 0000000..ba66013 --- /dev/null +++ b/openembedded/scripts/cyclictest.py @@ -0,0 +1,39 @@ +#!/usr/bin/python +import re +import sys +import os + +threshold = 10000 +pass_threshold = True +max_lentency = 0 + +#parse format: +# T:49 ( 4518) P:31 I:4243600 C: 2 Min: 8 Act: 8 Avg: 8 Max: 9 +parser = re.compile("(?P<T>\d+)\D+(?P<T1>\d+)\D+(?P<P>\d+)\D+(?P<I>\d+)\D+(?P<C>\d+)\D+(?P<Min>\d+)\D+(?P<Act>\d+)\D+(?P<Avg>\d+)\D+(?P<Max>\d+)") + +data = sys.stdin.readlines() + +if len(data) == 0: + print "test_case_id:Test program running result:fail measurement:0 units:none" +else: + print "test_case_id:Test program running result:pass measurement:0 units:none" + + for line in data: + result = parser.search(line) + if result is not None: + if int(result.group('Max')) > threshold: + pass_threshold = False + + if int(result.group('Avg')) > threshold: + pass_threshold = False + + if int(result.group('Min')) > threshold: + pass_threshold = False + + if int(result.group('Max')) > max_lentency: + max_lentency = int(result.group('Max')) + + if pass_threshold is True: + print "test_case_id:Latency bound (<10ms) result:pass measurement:" + str(max_lentency) + " units:usecs" + else: + print "test_case_id:Latency bound (<10ms) result:fail measurement:" + str(max_lentency) + " units:usecs" diff --git a/openembedded/scripts/infinite_loop.py b/openembedded/scripts/infinite_loop.py new file mode 100755 index 0000000..0405354 --- /dev/null +++ b/openembedded/scripts/infinite_loop.py @@ -0,0 +1,14 @@ +#!/usr/bin/python +import sys +import time +import os + +t1 = time.time() + +while True: + t2 = time.time() - t1 + + if t2 > float(sys.argv[1]): + exit() + else: + os.system("calibrator 1000 500M ca.log") |