Skip to content

Commit

Permalink
Merge pull request os-autoinst#18347 from mloviska/tw_def_netavark
Browse files Browse the repository at this point in the history
Tumbleweed switched from cni to netavark
  • Loading branch information
ricardobranco777 authored Dec 19, 2023
2 parents 63d956a + 856fe7e commit e876882
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/containers/podman_netavark.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
use Mojo::Base 'containers::basetest';
use testapi;
use serial_terminal qw(select_serial_terminal);
use version_utils qw(package_version_cmp is_transactional is_jeos is_alp is_sle_micro);
use version_utils qw(package_version_cmp is_transactional is_jeos is_leap is_sle_micro is_leap_micro is_sle);
use containers::utils qw(get_podman_version registry_url);
use transactional qw(trup_call check_reboot_changes);
use utils qw(zypper_call);
use Utils::Systemd qw(systemctl);

sub is_cni_default {
return is_sle || is_leap || is_sle_micro('<6.0') || is_leap_micro;
}

sub remove_subtest_setup {
assert_script_run("podman container rm -af");
assert_script_run("podman network prune -f");
Expand All @@ -37,16 +41,14 @@ sub is_container_running {

# clean up routine only for systems that run CNI as default network backend
sub _cleanup {
return if is_alp;
return unless is_cni_default;
my $podman = shift->containers_factory('podman');
select_console 'log-console';
remove_subtest_setup;
script_run('rm -rf /etc/containers/containers.conf');
$podman->cleanup_system_host();
unless (is_alp || is_sle_micro('6.0+')) {
validate_script_output('podman info --format {{.Host.NetworkBackend}}', sub { /cni/ });
validate_script_output('podman network ls', sub { /podman\s+bridge/ });
}
validate_script_output('podman info --format {{.Host.NetworkBackend}}', sub { /cni/ });
validate_script_output('podman network ls', sub { /podman\s+bridge/ });
}

sub switch_to_netavark {
Expand Down Expand Up @@ -78,7 +80,7 @@ sub run {
return 1;
}

switch_to_netavark unless (is_alp || is_sle_micro('6.0+'));
switch_to_netavark if is_cni_default;
$podman->cleanup_system_host();

# it is turned off in
Expand Down

0 comments on commit e876882

Please sign in to comment.