diff options
author | Arthur She <arthur.she@linaro.org> | 2020-03-25 20:32:12 -0700 |
---|---|---|
committer | mwasilew <milosz.wasilewski@linaro.org> | 2020-03-26 08:41:23 +0000 |
commit | f04b0ecbcaa78553769bc3b4d622cd52cdb6cce1 (patch) | |
tree | 78435a4666dbf66f8d7c3e71ce2f21c9993b2a09 | |
parent | a2e971370ab7e15be8704d069899b816dc466be9 (diff) |
igt: modify test definition for igt_runner
There is a test runner, igt_runner, comes with the newer version of
igt-gpu-tests. We can run the tests with it rather than piglit. Now the
test definition is compatible with both igt_runner and piglit.
Signed-off-by: Arthur She <arthur.she@linaro.org>
-rwxr-xr-x | automated/linux/igt/igt-test.sh | 22 | ||||
-rw-r--r-- | automated/linux/igt/igt-test.yaml | 3 | ||||
-rwxr-xr-x | automated/linux/igt/print-test-result.py | 28 |
3 files changed, 30 insertions, 23 deletions
diff --git a/automated/linux/igt/igt-test.sh b/automated/linux/igt/igt-test.sh index 9d6002a8..c770e44e 100755 --- a/automated/linux/igt/igt-test.sh +++ b/automated/linux/igt/igt-test.sh @@ -29,6 +29,15 @@ generate_chamelium_testlist() { ${TEST_SCRIPT} -l | grep chamelium | grep -v "dp\|vga\|suspend\|hibernate" | tee "${IGT_DIR}"/"${TEST_LIST}" } +download_piglit() { + # Download Piglit + git config --global http.postBuffer 157286400 + if [ ! -d "${IGT_DIR}/piglit" ]; then + echo "Download Piglit.." + time ${TEST_SCRIPT} -d + fi +} + usage() { echo "usage: $0 -d <igt-gpu-tools dir> -t <test-list> [-c <chamelium ip address>] [-h <HDMI device name>]" 1>&2 exit 1 @@ -56,14 +65,9 @@ TEST_SCRIPT="${IGT_DIR}/scripts/run-tests.sh" export IGT_TEST_ROOT="/usr/libexec/igt-gpu-tools" -# new run-tests.sh needs '-p' to run the tests with piglit -${TEST_SCRIPT} --help | grep -q '\-p' && TEST_SCRIPT="${TEST_SCRIPT} -p" - -# Download Piglit -git config --global http.postBuffer 157286400 -if [ ! -d "${IGT_DIR}/piglit" ]; then - echo "Download Piglit.." - time ${TEST_SCRIPT} -d +if [ ! -f "${IGT_DIR}/runner/igt_runner" ]; then + ${TEST_SCRIPT} --help | grep -q '\-p' && TEST_SCRIPT="${TEST_SCRIPT} -p" + download_piglit fi if [ "${TEST_LIST}" == "CHAMELIUM" ]; then @@ -80,5 +84,5 @@ fi # Run tests echo "Run ${TEST_LIST}" -${TEST_SCRIPT} -T "${IGT_DIR}"/"${TEST_LIST}" -v -s | tee tmp.log +${TEST_SCRIPT} -T "${IGT_DIR}"/"${TEST_LIST}" -v | tee tmp.log grep -e '^pass' -e '^skip' -e '^fail' tmp.log|awk -F':\ ' '{print $2" "$1}' > ${RESULT_LOG} diff --git a/automated/linux/igt/igt-test.yaml b/automated/linux/igt/igt-test.yaml index 4339561c..a69046f8 100644 --- a/automated/linux/igt/igt-test.yaml +++ b/automated/linux/igt/igt-test.yaml @@ -47,7 +47,8 @@ run: - echo "**********************************************"; - echo "************ Dump IGT test result ************"; - echo "**********************************************"; - - bzcat ${IGT_DIR}/results/results.json.bz2 | python print-test-result.py + - if [ -f "${IGT_DIR}/results/results.json.bz2" ]; then bunzip2 ${IGT_DIR}/results/results.json.bz2; fi + - python print-test-result.py -f ${IGT_DIR}/results/results.json - if [ -n "${ARTIFACTORIAL_TOKEN}" -a -n "${ARTIFACTORIAL_URL}" ]; then - UPLOAD_TOOL="../../utils/upload-to-artifactorial.sh" - if [ -d "/root/dump-frames/" -a -n "`ls /root/dump-frames/`" ]; then echo "Got error frames.." ; tar -C /root -zcf dump-frames.tar.gz dump-frames/; diff --git a/automated/linux/igt/print-test-result.py b/automated/linux/igt/print-test-result.py index 5eefd6fc..42a939d4 100755 --- a/automated/linux/igt/print-test-result.py +++ b/automated/linux/igt/print-test-result.py @@ -5,22 +5,24 @@ import json def print_result(results): - try: - for test, content in results['tests'].iteritems(): - print '<LAVA_SIGNAL_STARTTC %s>' % test - print '************************************************************************************************************************************' - print '%-15s %s' % ('Test:', test) - print '%-15s %s' % ('Result:', content['result']) + for test, content in results['tests'].iteritems(): + content = {k: unicode(v).encode("utf-8") for k, v in content.iteritems()} + print '<LAVA_SIGNAL_STARTTC %s>' % test + print '************************************************************************************************************************************' + print '%-15s %s' % ('Test:', test) + print '%-15s %s' % ('Result:', content['result']) + # Test result generated by igt_runner doesn't have the following values + try: print '%-15s %s' % ('Command:', content['command']) print '%-15s %s' % ('Environment:', content['environment']) print '%-15s %s' % ('Returncode:', content['returncode']) - print '%-15s %s' % ('Stdout:', content['out'].replace('\n', '\n ')) - print '%-15s %s' % ('Stderr:', content['err'].replace('\n', '\n ')) - print '%-15s %s' % ('dmesg:', content['dmesg'].replace('\n', '\n ')) - print '<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=%s>' % (test, content['result']) - print '<LAVA_SIGNAL_ENDTC %s>' % test - except KeyError: - print "Error: Can not find required data" + except KeyError: + pass + print '%-15s %s' % ('Stdout:', content['out'].replace('\n', '\n ')) + print '%-15s %s' % ('Stderr:', content['err'].replace('\n', '\n ')) + print '%-15s %s' % ('dmesg:', content['dmesg'].replace('\n', '\n ')) + print '<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=%s>' % (test, content['result']) + print '<LAVA_SIGNAL_ENDTC %s>' % test if __name__ == '__main__': |