Skip to content

Commit

Permalink
Check HOST_VERSION before installing certs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Herranz Ramírez committed Nov 29, 2023
1 parent a926953 commit 316e000
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/containers/host_configuration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Mojo::Base qw(consoletest);
use testapi;
use serial_terminal 'select_serial_terminal';
use utils;
use version_utils qw(check_os_release get_os_release is_sle);
use version_utils qw(check_os_release get_os_release is_sle is_sle_micro);
use containers::common;
use containers::utils qw(reset_container_network_if_needed);

Expand All @@ -23,12 +23,22 @@ sub run {
my $update_timeout = 2400; # aarch64 takes sometimes 20-30 minutes for completion
my ($version, $sp, $host_distri) = get_os_release;
my $engine = get_required_var('CONTAINER_RUNTIMES');
my $host_version = get_required_var('HOST_VERSION');

# Update the system to get the latest released state of the hosts.
# Check routing table is well configured
if ($host_distri =~ /sles|opensuse/) {
zypper_call("--quiet up", timeout => $update_timeout);
ensure_ca_certificates_suse_installed();
# 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 (is_sle_micro) {
transactional::trup_call('--continue pkg install ca-certificates-suse');
} else {
zypper_call("in ca-certificates-suse");
}
}
else {
if ($host_distri eq 'ubuntu') {
Expand Down

0 comments on commit 316e000

Please sign in to comment.