Skip to content

Commit

Permalink
Install certs only for SUSE and openSUSE
Browse files Browse the repository at this point in the history
Latest change is trying to install certs and use `zypper` in non-SUSE distros. This PR is paired with os-autoinst/opensuse-jobgroups#394
  • Loading branch information
Pablo Herranz Ramírez authored and dzedro committed Jun 10, 2024
1 parent a12bee7 commit 928f8b6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/containers/host_configuration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@ sub run {

# Update the system to get the latest released state of the hosts.
# Check routing table is well configured
if (get_required_var('DISTRI') =~ 'sle') { # only on OSD
my $host_version = get_required_var('HOST_VERSION');
if ($host_distri =~ /sle|opensuse/) {
my $host_version = get_var('HOST_VERSION');
$host_version = ($host_version =~ /SP/) ? ("SLE_" . $host_version =~ s/-SP/_SP/r) : $host_version;
zypper_call("--quiet up", timeout => $update_timeout);
# Cannot use `ensure_ca_certificates_suse_installed` as it will depend
# on the BCI container version instead of the host
if (script_run('rpm -qi ca-certificates-suse') == 1) {
zypper_call("ar --refresh http://download.suse.de/ibs/SUSE:/CA/$host_version/SUSE:CA.repo");
if ($host_version) {
zypper_call("ar --refresh http://download.suse.de/ibs/SUSE:/CA/$host_version/SUSE:CA.repo");
} else {
zypper_call("ar --refresh http://download.opensuse.org/repositories/SUSE:/CA/openSUSE_Tumbleweed/SUSE:CA.repo");
zypper_call("--gpg-auto-import-keys -n install ca-certificates-suse");
}
zypper_call("in ca-certificates-suse");
}
}
Expand Down

0 comments on commit 928f8b6

Please sign in to comment.