Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

containers: Use SUSE repo for upstream tests on SLE #21238

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions tests/containers/buildah_integration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use containers::bats;
use version_utils qw(is_sle);

my $test_dir = "/var/tmp";
my $buildah_version = "";
my $oci_runtime = "";

sub run_tests {
Expand Down Expand Up @@ -79,9 +78,14 @@ sub run {
assert_script_run "cd $test_dir";

# Download buildah sources
$buildah_version = script_output "buildah --version | awk '{ print \$3 }'";
script_retry("curl -sL https://github.com/containers/buildah/archive/refs/tags/v$buildah_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run "cd $test_dir/buildah-$buildah_version/";
my $buildah_version = script_output "buildah --version | awk '{ print \$3 }'";
if (is_sle) {
script_retry("curl -sL https://github.com/SUSE/buildah/archive/refs/heads/v$buildah_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run "cd $test_dir/buildah-suse-v$buildah_version/";
} else {
script_retry("curl -sL https://github.com/containers/buildah/archive/refs/tags/v$buildah_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run "cd $test_dir/buildah-$buildah_version/";
}

# Patch mkdir to always use -p
assert_script_run "sed -i 's/ mkdir /& -p /' tests/*.bats tests/helpers.bash";
Expand All @@ -102,7 +106,7 @@ sub run {

sub cleanup() {
assert_script_run "cd ~";
script_run("rm -rf $test_dir/buildah-$buildah_version/");
script_run("rm -rf $test_dir/buildah-*");
bats_post_hook;
}

Expand Down
14 changes: 9 additions & 5 deletions tests/containers/podman_integration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use Utils::Architectures qw(is_x86_64 is_aarch64);
use containers::bats;

my $test_dir = "/var/tmp";
my $podman_version = "";
my $oci_runtime = "";

sub run_tests {
Expand Down Expand Up @@ -106,9 +105,14 @@ sub run {
assert_script_run "cd $test_dir";

# Download podman sources
$podman_version = get_podman_version();
script_retry("curl -sL https://github.com/containers/podman/archive/refs/tags/v$podman_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run("cd $test_dir/podman-$podman_version/");
my $podman_version = get_podman_version();
if (is_sle) {
script_retry("curl -sL https://github.com/SUSE/podman/archive/refs/heads/v$podman_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run "cd $test_dir/podman-suse-v$podman_version/";
} else {
script_retry("curl -sL https://github.com/containers/podman/archive/refs/tags/v$podman_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run("cd $test_dir/podman-$podman_version/");
}
assert_script_run "sed -i 's/bats_opts=()/bats_opts=(--tap)/' hack/bats";
assert_script_run "sed -i 's/^PODMAN_RUNTIME=/&$oci_runtime/' test/system/helpers.bash";
assert_script_run "rm -f contrib/systemd/system/podman-kube@.service.in";
Expand Down Expand Up @@ -136,7 +140,7 @@ sub run {

sub cleanup() {
assert_script_run "cd ~";
script_run("rm -rf $test_dir/podman-$podman_version/");
script_run("rm -rf $test_dir/podman-*");
bats_post_hook;
}

Expand Down
14 changes: 9 additions & 5 deletions tests/containers/skopeo_integration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use containers::bats;
use version_utils qw(is_sle is_sle_micro);

my $test_dir = "/var/tmp";
my $skopeo_version = "";

sub run_tests {
my %params = @_;
Expand Down Expand Up @@ -74,9 +73,14 @@ sub run {
assert_script_run "cd $test_dir";

# Download skopeo sources
$skopeo_version = script_output "skopeo --version | awk '{ print \$3 }'";
script_retry("curl -sL https://github.com/containers/skopeo/archive/refs/tags/v$skopeo_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run "cd $test_dir/skopeo-$skopeo_version/";
my $skopeo_version = script_output "skopeo --version | awk '{ print \$3 }'";
if (is_sle) {
script_retry("curl -sL https://github.com/SUSE/skopeo/archive/refs/heads/v$skopeo_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run "cd $test_dir/skopeo-suse-v$skopeo_version/";
} else {
script_retry("curl -sL https://github.com/containers/skopeo/archive/refs/tags/v$skopeo_version.tar.gz | tar -zxf -", retry => 5, delay => 60, timeout => 300);
assert_script_run "cd $test_dir/skopeo-$skopeo_version/";
}

my $errors = run_tests(rootless => 1, skip_tests => get_var('SKOPEO_BATS_SKIP_USER', ''));

Expand All @@ -90,7 +94,7 @@ sub run {

sub cleanup() {
assert_script_run "cd ~";
script_run("rm -rf $test_dir/skopeo-$skopeo_version/");
script_run("rm -rf $test_dir/skopeo-*");
bats_post_hook;
}

Expand Down