-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Detect end of agama auto-installation in s390x using for example logs #20426
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'd rerun this branch to see if it works after their fix was in.
fixed in agama-project/agama#1688
@@ -120,7 +120,7 @@ sub prepare_parmfile { | |||
set_var('AUTOYAST', $url); | |||
} | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function cannot be used in O3, needs to be conditional for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. will change it.
2728707
to
85d96d4
Compare
960ab7e
to
059ac6d
Compare
059ac6d
to
ac52456
Compare
Detect end of agama auto-installation in s390x using for example logs