Hi,
I'm recently working on some test cases which involve the measurement, but have no idea how to handle it after several failures occurred. For example:
https://validation.linaro.org/scheduler/job/126298
<LAVA_SIGNAL_STARTRUN fio-ubuntu db652397-5831-4cc3-b2b3-1246879ac696>
echo LAVA_ACK
/root
test_case_id:fio_device_existence result:PASS
which fio
The FIO binary location is: /usr/bin/fio
test_case_id:fio_existence result:PASS
sudo fio -filename=/dev/sda -rw=read -direct=1 -iodepth 1 -thread -ioengine=psync -bs=4k -numjobs=1 -runtime=10 -group_reporting -name=fio_read > fio_read.txt 2>&1
0
The IOPS number in fio_read test is: 1104
test_case_id:fio_read result:PASS measurement:1104 units:persecond
<LAVA_SIGNAL_ENDRUN fio-ubuntu db652397-5831-4cc3-b2b3-1246879ac696>
<LAVA_DISPATCHER>2014-05-13 12:30:39 PM WARNING: Invalid measurement
<LAVA_DISPATCHER>2014-05-13 12:30:39 PM WARNING: Invalid measurement
The regular expression I'm using is:
"^test_case_id:(?P<test_case_id>fio_\\w+)\\sresult:(?P<result>(PASS|FAIL))\\s*(measurement:)*(?P<measurement>\\d*)\\s*(units:)*(?P<units>\\s*)\\s*"
which if convert it to a solid one would be:
"^test_case_id:fio_\w+\sresult:(PASS|FAIL)\s*(measurement:)*\d*\s*(units:)*\s*\s*"
And it has been tested locally which can capture following 3 different results (sample):
test_case_id:fio_read result:PASS measurement:1105 units:persecond
test_case_id:fio_read result:PASS
test_case_id:fio_read result:FAIL - Command ran failed on /dev/sda
A local test script in Python is:
#!/usr/bin/env python
import re
pattern_solid = "^test_case_id:fio_\w+\sresult:(PASS|FAIL)\s*(measurement:)*\d*\s*(units:)*\s*\s*"
testcase_name = "fio_read"
iops_result = "1105"
test_string_pass = "test_case_id:" + testcase_name + " result:PASS " + "measurement:" + iops_result + " units:persecond"
test_string_pass_simple = "test_case_id:" + testcase_name + " result:PASS"
test_string_fail = "test_case_id:" + testcase_name + " result:FAIL" + " - Command ran failed on /dev/sda"
print re.search(pattern_solid, test_string_pass)
print re.search(pattern_solid, test_string_pass_simple)
print re.search(pattern_solid, test_string_fail)
So would you provide an example about how to deal with the measurement in LAVA?
Thanks.
Best Regards
Botao Sun