Skip to content

WIP: Detect end of agama auto-installation in s390x using for example logs#20426

Closed
hjluo wants to merge 1 commit intoos-autoinst:masterfrom
hjluo:detect_s390x_finish
Closed

WIP: Detect end of agama auto-installation in s390x using for example logs#20426
hjluo wants to merge 1 commit intoos-autoinst:masterfrom
hjluo:detect_s390x_finish

Conversation

@hjluo
Copy link
Copy Markdown
Contributor

@hjluo hjluo commented Oct 18, 2024

Detect end of agama auto-installation in s390x using for example logs

@hjluo hjluo force-pushed the detect_s390x_finish branch 30 times, most recently from 9637552 to ee7570a Compare October 22, 2024 02:36
@hjluo hjluo force-pushed the detect_s390x_finish branch 13 times, most recently from 8aa4da4 to 2728707 Compare October 22, 2024 09:11
Comment on lines +25 to +71
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;
}
}

Copy link
Copy Markdown
Contributor

@jknphy jknphy Oct 25, 2024

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.

Copy link
Copy Markdown
Contributor Author

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!

Copy link
Copy Markdown
Contributor

@jknphy jknphy Nov 13, 2024

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

Copy link
Copy Markdown
Contributor Author

@hjluo hjluo Nov 14, 2024

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

}
if (get_var('AGAMA_AUTO')) {
my $url = data_url(get_var('AGAMA_AUTO'));
my $url = shorten_url(data_url(get_var('AGAMA_AUTO')));
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. will change it.

@hjluo hjluo force-pushed the detect_s390x_finish branch from 2728707 to 85d96d4 Compare November 13, 2024 10:25
@hjluo hjluo force-pushed the detect_s390x_finish branch 8 times, most recently from 960ab7e to 059ac6d Compare December 6, 2024 07:22
@hjluo hjluo force-pushed the detect_s390x_finish branch from 059ac6d to ac52456 Compare December 6, 2024 07:41
@stale
Copy link
Copy Markdown

stale bot commented Apr 26, 2025

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.
If it's still needed, you can add labels WIP or notready to it

@stale stale bot added the stale Stale pull request, are to be deleted within 90 days label Apr 26, 2025
@jknphy
Copy link
Copy Markdown
Contributor

jknphy commented Apr 27, 2025

Thanks, let's close this, we are using since long time ago puppeteer to check it.

@jknphy jknphy closed this Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale pull request, are to be deleted within 90 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants