WIP: Detect end of agama auto-installation in s390x using for example logs#20426
WIP: Detect end of agama auto-installation in s390x using for example logs#20426hjluo wants to merge 1 commit intoos-autoinst:masterfrom
Conversation
9637552 to
ee7570a
Compare
8aa4da4 to
2728707
Compare
| sub expect_is_shown { | ||
| my ($self, %args) = @_; | ||
| my $timeout = $args{timeout}; | ||
|
|
||
| while (1) { | ||
| # agama log error | ||
| script_run('journalctl -u agama > /tmp/journal.log'); | ||
| my $errors_in_log = script_output "grep 'ERROR -- :' /tmp/journal.log"; | ||
| if ($errors_in_log) { | ||
| record_info('Found errors in agama journal', | ||
| "Error is $errors_in_log please check it", | ||
| result => 'fail'); | ||
| die "agama failed with ($errors_in_log), please check the agama log."; | ||
| } | ||
| my $agama_auto_finished = script_run("grep 'agama-auto.service: Deactivated successfully' /tmp/journal.log"); | ||
| if (!$agama_auto_finished) { | ||
| record_info('Install finished', "agama-auto Deactivated successfully", result => 'pass'); | ||
| return; | ||
| } | ||
|
|
||
| # agama-auto service check | ||
| script_run('journalctl -u agama-auto > /tmp/journal_auto.log'); | ||
| script_run('cat /tmp/journal_auto.log'); | ||
|
|
||
| $errors_in_log = script_output "grep 'agama-auto service: Main process exited' /tmp/journal_auto.log | grep FAILURE"; | ||
| if ($errors_in_log) { | ||
| record_info('Found errors in agama auto journal', | ||
| "Error is $errors_in_log please check it", | ||
| result => 'fail'); | ||
| die "agama failed with ($errors_in_log), please check the agama log."; | ||
| } | ||
| # wait the installation to be finished. | ||
| my $yast_install_finished = script_run("grep 'Error output: Installation finished. No error reported.' /var/log/YaST2/y2log"); | ||
| if ($yast_install_finished) { | ||
| record_info('Install finished', "$yast_install_finished", result => 'pass'); | ||
| return; | ||
| } | ||
|
|
||
| die "timeout ($timeout) hit on during installation" if $timeout <= 0; | ||
| $timeout -= 30; | ||
| diag("left total timeout: $timeout"); | ||
| next; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
I don't understand why you need so much code here, I guess what you are trying to do is to to not wait so much time if the installation doesn't succeeds, that is good, not really required in this ticket, but what we could do is just to check every 30 seconds for the message of installation finished and if doesn't appear check for other message, it would be better if it would be just one single message and in the same file, do we really need to check also journal.log or agama-auto to do that? is not enough with y2log? In any case we should not try to display those errors or handle them, we would just die and the test should collect logs. You can ask developers for some generic message to check when auto-installation fails if you don't see it clearly in the logs.
There was a problem hiding this comment.
This is a WIP, and I've asked in the agama chanel for answer and still no reply. will be back on this once the bug was resolved. Thanks!
There was a problem hiding this comment.
It is not a bug, it is a feature (not a Jira one but something that developers plan to do), this ticket it is to workaround the problem until the feature is implemented:
https://trello.com/c/kdvo6Dtw/447-agama-add-an-agama-monitor-command
There was a problem hiding this comment.
OK, I'd rerun this branch to see if it works after their fix was in.
fixed in agama-project/agama#1688
| } | ||
| if (get_var('AGAMA_AUTO')) { | ||
| my $url = data_url(get_var('AGAMA_AUTO')); | ||
| my $url = shorten_url(data_url(get_var('AGAMA_AUTO'))); |
There was a problem hiding this comment.
this function cannot be used in O3, needs to be conditional for now.
2728707 to
85d96d4
Compare
960ab7e to
059ac6d
Compare
059ac6d to
ac52456
Compare
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Thanks, let's close this, we are using since long time ago puppeteer to check it. |
Detect end of agama auto-installation in s390x using for example logs