Skip to content
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

Create zypper resolver and upload it #19731

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions lib/utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -832,16 +832,29 @@ the second run will update the system.
sub ssh_fully_patch_system {
my $remote = shift;
my $cmd_time = time();
my $resolver_option = get_var('PUBLIC_CLOUD_GEN_RESOLVER') ? '--debug-solver' : '';
my $cmd = "ssh $remote 'sudo zypper -n patch $resolver_option --with-interactive -l'";
# first run, possible update of packager -- exit code 103
my $ret = script_run("ssh $remote 'sudo zypper -n patch --with-interactive -l'", 1500);
my $ret = script_run($cmd, 1500);
record_info('zypper patch', 'The command zypper patch took ' . (time() - $cmd_time) . ' seconds.');
die "Zypper failed with $ret" if ($ret != 0 && $ret != 102 && $ret != 103);

if ($ret != 0 && $ret != 102 && $ret != 103) {
if ($resolver_option) {
script_run("ssh $remote 'tar -czvf /tmp/solver.tar.gz /var/log/zypper.solverTestCase'");
script_run("scp $remote:/tmp/solver.tar.gz /tmp/solver.tar.gz");
upload_logs('/tmp/solver.tar.gz', failok => 1);
}
croak("Zypper failed with $ret");
}
$cmd_time = time();
# second run, full system update
$ret = script_run("ssh $remote 'sudo zypper -n patch --with-interactive -l'", 6000);
$ret = script_run($cmd, 6000);
record_info('zypper patch', 'The second command zypper patch took ' . (time() - $cmd_time) . ' seconds.');
die "Zypper failed with $ret" if ($ret != 0 && $ret != 102);
if ($resolver_option) {
script_run("ssh $remote 'tar -czvf /tmp/solver.tar.gz /var/log/zypper.solverTestCase'");
script_run("scp $remote:/tmp/solver.tar.gz /tmp/solver.tar.gz");
upload_logs('/tmp/solver.tar.gz', failok => 1);
}
croak("Zypper failed with $ret") if ($ret != 0 && $ret != 102);
}

=head2 minimal_patch_system
Expand Down
1 change: 1 addition & 0 deletions variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ PUBLIC_CLOUD_EMBARGOED_UPDATES_DETECTED | boolean | true | Internal variable wri
PUBLIC_CLOUD_INFRA | boolean | false | Would trigger special flow in [check_registercloudguest.pm](tests/publiccloud/check_registercloudguest.pm) needed for run test against special test infra (DO NOT use the variable if you don't know what is about)
PUBLIC_CLOUD_INFRA_RMT_V4 | string | "" | Defines IPv4 registration server in test infra. Must be used together with PUBLIC_CLOUD_INFRA. (DO NOT use the variable if you don't know what is about)
PUBLIC_CLOUD_INFRA_RMT_V6 | string | "" | Defines IPv6 registration server in test infra. Must be used together with PUBLIC_CLOUD_INFRA. (DO NOT use the variable if you don't know what is about)
PUBLIC_CLOUD_GEN_RESOLVER | boolean | 0 | Control use of `--debug-resolver` option during maintenance updates testing . In case option was used also controls uploading of resolver case into the test


### Wicked testsuite specific variables
Expand Down
Loading