Project

General

Profile

Actions

action #109792

closed

[qe-core] Offline extraction of logs from Serial console

Added by szarate over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Enhancement to existing tests
Target version:
Start date:
2022-07-21
Due date:
% Done:

0%

Estimated time:
Difficulty:
Sprint:
QE-Core: August Sprint (Aug 03 - Aug 31)

Description

There might be cases where it could be convenient to extract the logs via journal or serial console, due to limitations, network availability or simply convenience, for post processing.

Ideally openQA would do something like:

cat EOF ---BEGIN OPENQA LOGFILE $test_module $log_filename ---
$log
 ---END OPENQA LOGFILE $test_module $log_filename ---
EOF > $serialdev

Ideally or something like this:

   `echo "MAKER" $( $log_string | gzip | base64encode) "END MAKER"  > $serialdev`

as a concept, this is what we want: journalctl -k | tail --lines 100 | gzip | base64 | base64 -d | zcat, os-autoinst acts here in the decoding part base64 -d | zcat to extract the files from the logs.

Upon test completion, a program monitoring the amqp events would parse the serial log, and split it into the multiple parts and upload the results to the corresponding job. It should, base64 encoding + gzip could be used to reduce the ammount of lines in the serial log.

See https://amqp.opensuse.org for o3 and for OSD the URL is configured here: https://gitlab.suse.de/openqa/salt-pillars-openqa/-/blob/master/openqa/server.sls, see https://suse.slack.com/archives/C02CANHLANP/p1649672715876659?thread_ts=1649671726.929779&cid=C02CANHLANP for a thread in Slack

This would help further down the line, making investigation of isolated systems, or certain corner cases easier to debug.

Acceptance Criteria

  1. A method that allows streaming data to the serial console, compresed and encoded with base64 (check if jeos, sle-micro don't have required binaries)
  2. Write a daemon that listens for events on jobs running on functional, that extracts the logs and uploads them to the corresponding job, once it has finished

See also: https://openqa.suse.de/tests/8533774#step/systemd_sapstart_check/44 for a test that runs without network

Constraints

Use serial console, if it proves unreliable, system journal should be looked at (do mind the kernel rate limiting for messages)

suggestions:

See https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/14681/files#diff-05f9f9adf140de4c57ec6f1c3f1034ef825689b5d16949ac3de6ea8655d768d3R258

Another idea is to save the logs to the ulogs directory, directly from the perl code


Related issues 4 (1 open3 closed)

Related to openQA Tests - action #109789: [qe-core] generate a list of installed packages in the system at the end of a testResolveddheidler2022-04-11

Actions
Related to openQA Tests - action #110097: [sle][migration][sle15sp4] Need investigate how to get scsi id from grub shell pageResolvedtinawang1232022-04-20

Actions
Related to openQA Tests - action #114433: [qe-core] call systemctl list-timers --all prior shutdown of the system Resolvedmgrifalconi2022-07-20

Actions
Related to openQA Tests - coordination #68794: [qe-core][functional][epic] rework postfail hooksBlockedszarate2020-03-31

Actions
Actions

Also available in: Atom PDF