Project

General

Profile

action #109792

Updated by szarate about 2 years ago

There might be [cases](https://progress.opensuse.org/issues/106284) 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](https://open.qa/docs/#_configuring_amqp_message_emission) 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) 
 1. Write a daemon demon 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)

Back