Skip to content

Commit 2c40377

Browse files
Merge pull request #27472 from Luap99/test-fixes
various different test fixes
2 parents 8084057 + 3f87f07 commit 2c40377

File tree

8 files changed

+179
-338
lines changed

8 files changed

+179
-338
lines changed

hack/bats

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $0 is a wrapper for invoking podman system tests.
1212
1313
--root Run only as root
1414
--rootless Run only as user (i.e. you)
15-
--remote Run with podman-remote (see below)
15+
--remote Run with podman-remote
1616
1717
FILENAME-PATTERN Run only test files that match 'test/system/*name*',
1818
e.g. '500' or 'net' will match 500-networking.bats.
@@ -36,16 +36,6 @@ By default, tests ./bin/podman. To test a different podman, do:
3636
3737
\$ env PODMAN=/abs/path/to/podman $0 ....
3838
39-
To test podman-remote, start your own servers (root and rootless) via:
40-
41-
\$ bin/podman system service --timeout=0 &
42-
\$ sudo !!
43-
44-
...then invoke this script with --remote. (This script can't start the
45-
servers, because we can sudo *starting* the service but can't sudo
46-
stopping it: by the time the bats tests finish, the sudo timeout will
47-
have expired. We apologize for the inconvenience.)
48-
4939
Examples:
5040
5141
\$ $0 220:\"restart cleans up\"
@@ -113,13 +103,7 @@ if [[ "$REMOTE" ]]; then
113103
if ! [[ $PODMAN =~ -remote ]]; then
114104
PODMAN=${PODMAN}-remote
115105
fi
116-
117-
if [[ -n "$TEST_ROOT" ]]; then
118-
sudo $PODMAN info >/dev/null || exit 1
119-
fi
120-
if [[ -n "$TEST_ROOTLESS" ]]; then
121-
$PODMAN info >/dev/null || exit 1
122-
fi
106+
export REMOTESYSTEM_TRANSPORT=unix
123107
fi
124108

125109
# END initialization and command-line arg checking

test/e2e/prune_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
. "github.com/containers/podman/v6/test/utils"
1313
. "github.com/onsi/ginkgo/v2"
1414
. "github.com/onsi/gomega"
15+
. "github.com/onsi/gomega/gexec"
1516
)
1617

1718
var pruneImage = fmt.Sprintf(`
@@ -601,7 +602,7 @@ var _ = Describe("Podman prune", func() {
601602
err := os.WriteFile(containerFilePath, []byte(longBuildImage), 0o755)
602603
Expect(err).ToNot(HaveOccurred())
603604

604-
build := podmanTest.Podman([]string{"build", "-f", containerFilePath, "-t", "podmanleaker"})
605+
build := podmanTest.Podman([]string{"build", "--network=none", "-f", containerFilePath, "-t", "podmanleaker"})
605606
// Build will never finish so let's wait for build to ask for SIGKILL to simulate a failed build that leaves stage containers.
606607
matchedOutput := false
607608
for range 900 {
@@ -616,6 +617,10 @@ var _ = Describe("Podman prune", func() {
616617
Fail("Did not match special string in podman build")
617618
}
618619

620+
// kill is async, wait for process exit here and make sure it was killed (137).
621+
build.WaitWithDefaultTimeout()
622+
Expect(build).To(Exit(137))
623+
619624
// Check Intermediate image of stage container
620625
none := podmanTest.Podman([]string{"images", "-a"})
621626
none.WaitWithDefaultTimeout()

test/system/520-checkpoint.bats

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ function setup() {
2222
skip "checkpoint does not work rootless"
2323
fi
2424

25+
basic_setup
26+
27+
# Note basic_setup defines $PODMAN_RUNTIME so this must be after it
28+
2529
# As of 2024-05, crun on Debian is not built with criu support:
2630
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008249
27-
runtime=$(podman_runtime)
31+
runtime="$PODMAN_RUNTIME"
2832
run $runtime checkpoint --help
2933
if [[ $status -ne 0 ]]; then
3034
skip "runtime $runtime does not support checkpoint/restore"
3135
fi
32-
33-
basic_setup
3436
}
3537

3638
# bats test_tags=ci:parallel
@@ -236,6 +238,12 @@ function setup() {
236238

237239
# bats test_tags=ci:parallel
238240
@test "podman checkpoint/restore ip and mac handling" {
241+
# Broken only debian as it seems the host's /etc/hosts file keeps changing
242+
# which causes false positives in the before/after restore comparison.
243+
OS_RELEASE_ID="${OS_RELEASE_ID:-$(source /etc/os-release; echo $ID)}"
244+
if [[ "$OS_RELEASE_ID" == "debian" ]]; then
245+
skip "Test flakes on debian in CI"
246+
fi
239247
# Refer to https://github.com/containers/podman/issues/16666#issuecomment-1337860545
240248
# for the correct behavior, this should cover all cases listed there.
241249
local netname="net-$(safename)"

test/system/700-artifact.bats

Lines changed: 0 additions & 113 deletions
This file was deleted.

test/system/701-artifact-created.bats

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)