From f81cdf9d3a475b6135c0951d1c7169f226164baf Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Tue, 13 Nov 2018 13:22:51 +0200 Subject: runner: Handle escaped characters from kmsg Characters in kernel logs, when read from /dev/kmsg, are escaped as \xNN if they are not between 32 and 127 of if they are "\". Decode what we can when creating results.json. Signed-off-by: Petri Latvala Cc: Tvrtko Ursulin Cc: Arkadiusz Hiler Reviewed-by: Arkadiusz Hiler --- .../json_tests_data/dmesg-escapes/reference.json | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 runner/json_tests_data/dmesg-escapes/reference.json (limited to 'runner/json_tests_data/dmesg-escapes/reference.json') diff --git a/runner/json_tests_data/dmesg-escapes/reference.json b/runner/json_tests_data/dmesg-escapes/reference.json new file mode 100644 index 00000000..9b4df640 --- /dev/null +++ b/runner/json_tests_data/dmesg-escapes/reference.json @@ -0,0 +1,72 @@ +{ + "__type__":"TestrunResult", + "results_version":9, + "name":"normal-run", + "uname":"Linux hostname 4.18.0-1-amd64 #1 SMP Debian 4.18.6-1 (2018-09-06) x86_64", + "time_elapsed":{ + "__type__":"TimeAttribute", + "start":1539953735.1110389, + "end":1539953735.1723731 + }, + "tests":{ + "igt@successtest@first-subtest":{ + "out":"Starting subtest: first-subtest\nSubtest first-subtest: SUCCESS (0.000s)\n", + "igt-version":"IGT-Version: 1.23-g0c763bfd (x86_64) (Linux: 4.18.0-1-amd64 x86_64)", + "result":"pass", + "time":{ + "__type__":"TimeAttribute", + "start":0, + "end":0 + }, + "err":"Starting subtest: first-subtest\nSubtest first-subtest: SUCCESS (0.000s)\n", + "dmesg":"<6> [3216186.095083] Console: switching to colour dummy device 80x25\n<6> [3216186.095097] [IGT] successtest: executing\n<6> [3216186.101115] [IGT] successtest: starting subtest first-subtest\n<6> [3216186.101159] String with a\nnewline\n<6> [3216186.101159] String with a\ttab\n<6> [3216186.101159] String with an explicit\\x00NUL\n<6> [3216186.101159] The character \\x13 should be nonprintable\n<6> [3216186.101159] Escaped backslash is \\\n<6> [3216186.101159] Kernel shouldn't output this but cutoff escape \\x1\n<6> [3216186.101159] More cutoff \\x\n<6> [3216186.101159] One more \\\n<6> [3216186.101160] [IGT] successtest: exiting, ret=0\n<6> [3216186.101299] Console: switching to colour frame buffer device 240x75\n", + }, + }, + "totals":{ + "":{ + "crash":0, + "pass":1, + "dmesg-fail":0, + "dmesg-warn":0, + "skip":0, + "incomplete":0, + "timeout":0, + "notrun":0, + "fail":0, + "warn":0 + }, + "root":{ + "crash":0, + "pass":1, + "dmesg-fail":0, + "dmesg-warn":0, + "skip":0, + "incomplete":0, + "timeout":0, + "notrun":0, + "fail":0, + "warn":0 + }, + "igt@successtest":{ + "crash":0, + "pass":1, + "dmesg-fail":0, + "dmesg-warn":0, + "skip":0, + "incomplete":0, + "timeout":0, + "notrun":0, + "fail":0, + "warn":0 + }, + }, + "runtimes":{ + "igt@successtest":{ + "time":{ + "__type__":"TimeAttribute", + "start":0, + "end":0.014 + } + }, + } +} -- cgit v1.2.3