Skip to content

Commit

Permalink
Create zypper resolver and upload it
Browse files Browse the repository at this point in the history
  • Loading branch information
asmorodskyi committed Jul 14, 2024
1 parent 0272859 commit f1bcd42
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -832,16 +832,27 @@ 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(get_var('PUBLIC_CLOUD_GEN_RESOLVER')) {
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");
}
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(get_var('PUBLIC_CLOUD_GEN_RESOLVER')){
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");
}
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

0 comments on commit f1bcd42

Please sign in to comment.