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 committed Dec 1, 2023
1 parent 1710928 commit 3180f67
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/containers/host_configuration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ 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("in ca-certificates-suse");
}
}
Expand Down

0 comments on commit 3180f67

Please sign in to comment.