Skip to content

Commit

Permalink
Merge pull request #19965 from ricardobranco777/nmap
Browse files Browse the repository at this point in the history
containers: Re-enable podman upstream tests on aarch64
  • Loading branch information
ricardobranco777 authored Aug 14, 2024
2 parents ea35c6e + ce17635 commit 07380a0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
26 changes: 23 additions & 3 deletions lib/containers/bats.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,40 @@ use testapi;
use utils;
use strict;
use warnings;
use version_utils qw(is_transactional is_sle);
use version_utils qw(is_transactional is_sle is_sle_micro is_tumbleweed);
use transactional qw(trup_call check_reboot_changes);
use serial_terminal qw(select_user_serial_terminal);
use registration qw(add_suseconnect_product get_addon_fullname);
use Utils::Architectures 'is_aarch64';

our @EXPORT = qw(install_bats install_htpasswd install_ncat remove_mounts_conf switch_to_user delegate_controllers enable_modules patch_logfile);

sub install_ncat {
return if (script_run("rpm -q ncat") == 0);

my $ncat_version = get_required_var("NCAT_VERSION");
my $version = "SLE_15";
if (is_sle_micro('<6.0')) {
if (is_sle_micro('=5.5')) {
$version = "SLE_15_SP5";
} elsif (is_sle_micro('>5.2')) {
$version = "SLE_15_SP4";
} else {
$version = "SLE_15_SP3";
}
} elsif (is_sle('<15-SP6')) {
$version = get_required_var("VERSION");
$version =~ s/-/_/g;
$version = "SLE_" . $version;
} elsif (is_tumbleweed) {
$version = "openSUSE_Factory";
$version .= "_ARM" if (is_aarch64);
}

my $repo = "https://download.opensuse.org/repositories/network:/utilities/$version/network:utilities.repo";

my @cmds = (
"rpm -vhU https://nmap.org/dist/ncat-$ncat_version.x86_64.rpm",
"zypper addrepo $repo",
"zypper --gpg-auto-import-keys -n install ncat",
"ln -sf /usr/bin/ncat /usr/bin/nc"
);
foreach my $cmd (@cmds) {
Expand Down
2 changes: 1 addition & 1 deletion lib/main_containers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ sub load_container_tests {
loadtest 'containers/skopeo_integration' if (is_tumbleweed || is_microos || is_sle || is_leap || is_sle_micro('>=5.5'));
}
if (!check_var('PODMAN_BATS_SKIP', 'all')) {
loadtest 'containers/podman_integration' if (is_x86_64);
loadtest 'containers/podman_integration';
}
if (!check_var('RUNC_BATS_SKIP', 'all')) {
loadtest 'containers/runc_integration' if (is_tumbleweed || is_sle || is_leap);
Expand Down
4 changes: 2 additions & 2 deletions tests/containers/netavark_integration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use serial_terminal qw(select_serial_terminal);
use utils qw(script_retry);
use containers::common;
use containers::bats qw(install_bats install_ncat patch_logfile enable_modules);
use version_utils qw(is_sle is_tumbleweed);
use version_utils qw(is_sle is_tumbleweed is_microos);

my $test_dir = "/var/tmp";
my $netavark = "";
Expand All @@ -39,7 +39,7 @@ sub run {

# Install tests dependencies
my @pkgs = qw(aardvark-dns firewalld iproute2 iptables jq netavark);
if (is_tumbleweed) {
if (is_tumbleweed || is_microos) {
push @pkgs, qw(dbus-1-daemon);
} elsif (is_sle) {
push @pkgs, qw(dbus-1);
Expand Down
2 changes: 1 addition & 1 deletion tests/containers/runc_integration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ sub run {
assert_script_run "cd $test_dir/runc-$runc_version/";

# Compile helpers used by the tests
assert_script_run "make \$(ls contrib/cmd/)";
script_run "make \$(ls contrib/cmd/)";

run_tests(rootless => 1, skip_tests => get_var('RUNC_BATS_SKIP_USER', ''));

Expand Down

0 comments on commit 07380a0

Please sign in to comment.