Skip to content
Merged
3 changes: 2 additions & 1 deletion test/e2e/container_inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ var _ = Describe("Podman container inspect", func() {
})

It("podman inspect exposed ports includes published ports", func() {
hostPort := GetPort()
c1 := "ctr1"
c1s := podmanTest.Podman([]string{"run", "-d", "--expose", "22/tcp", "-p", "8080:80/tcp", "--name", c1, ALPINE, "top"})
c1s := podmanTest.Podman([]string{"run", "-d", "--expose", "22/tcp", "-p", fmt.Sprintf("%d:80/tcp", hostPort), "--name", c1, ALPINE, "top"})
c1s.WaitWithDefaultTimeout()
Expect(c1s).Should(ExitCleanly())

Expand Down
16 changes: 8 additions & 8 deletions test/e2e/network_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func removeNetworkDevice(name string) {
var _ = Describe("Podman network create", func() {
It("podman network create with name and subnet", func() {
netName := "subnet-" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/24", "--ip-range", "10.11.12.0/26", netName})
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.17.0/24", "--ip-range", "10.11.17.0/26", netName})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName)
Expect(nc).Should(ExitCleanly())
Expand All @@ -33,11 +33,11 @@ var _ = Describe("Podman network create", func() {
result := results[0]
Expect(result).To(HaveField("Name", netName))
Expect(result.Subnets).To(HaveLen(1))
Expect(result.Subnets[0].Subnet.String()).To(Equal("10.11.12.0/24"))
Expect(result.Subnets[0].Gateway.String()).To(Equal("10.11.12.1"))
Expect(result.Subnets[0].Subnet.String()).To(Equal("10.11.17.0/24"))
Expect(result.Subnets[0].Gateway.String()).To(Equal("10.11.17.1"))
Expect(result.Subnets[0].LeaseRange).ToNot(BeNil())
Expect(result.Subnets[0].LeaseRange.StartIP.String()).To(Equal("10.11.12.1"))
Expect(result.Subnets[0].LeaseRange.EndIP.String()).To(Equal("10.11.12.63"))
Expect(result.Subnets[0].LeaseRange.StartIP.String()).To(Equal("10.11.17.1"))
Expect(result.Subnets[0].LeaseRange.EndIP.String()).To(Equal("10.11.17.63"))

// Once a container executes a new network, the nic will be created. We should clean those up
// best we can
Expand All @@ -47,7 +47,7 @@ var _ = Describe("Podman network create", func() {
try.WaitWithDefaultTimeout()
Expect(try).To(ExitCleanly())

_, subnet, err := net.ParseCIDR("10.11.12.0/24")
_, subnet, err := net.ParseCIDR("10.11.17.0/24")
Expect(err).ToNot(HaveOccurred())
// Note this is an IPv4 test only!
containerIP, _, err := net.ParseCIDR(try.OutputToString())
Expand Down Expand Up @@ -391,9 +391,9 @@ var _ = Describe("Podman network create", func() {
})

It("podman network create with invalid gateway for subnet", func() {
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/24", "--gateway", "192.168.1.1", stringid.GenerateRandomID()})
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.15.0/24", "--gateway", "192.168.1.1", stringid.GenerateRandomID()})
nc.WaitWithDefaultTimeout()
Expect(nc).To(ExitWithError(125, "gateway 192.168.1.1 not in subnet 10.11.12.0/24"))
Expect(nc).To(ExitWithError(125, "gateway 192.168.1.1 not in subnet 10.11.15.0/24"))
})

It("podman network create two networks with same name should fail", func() {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2331,6 +2331,8 @@ WORKDIR /madethis`, BB)
})

It("podman run --shm-size-systemd", func() {
// I can reproduce this locally with sudo make localintegration FOCUS="podman run --shm-size-systemd"
SkipIfNotRootless("FIXME: This fails with 'Failed to set RLIMIT_CORE: Operation not permitted' printed in the container logs")
ctrName := "testShmSizeSystemd"
run := podmanTest.Podman([]string{"run", "--name", ctrName, "--shm-size-systemd", "10mb", "-d", SYSTEMD_IMAGE, "/sbin/init"})
run.WaitWithDefaultTimeout()
Expand Down
1 change: 1 addition & 0 deletions test/e2e/system_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ qe ssh://root@podman.test:2222/run/podman/podman.sock ~/.ssh/id_rsa false true
var u *user.User

BeforeAll(func() {
Skip("FIXME: test assumes local ssh key is setup for the own user")
// These tests are unique in as much as they require podman, podman-remote, systemd and sshd.
// podman-remote commands will be executed by ginkgo directly.
SkipIfContainerized("sshd is not available when running in a container")
Expand Down
2 changes: 1 addition & 1 deletion test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ EOF
tests="
| /home/podman /home/podman /home/podman | no vol mount
/home/x$whoami | /home/podman /home/podman /home/podman | bad vol mount
/home/$whoami | /home/podman /home/$whoami /home/$whoami | vol mount
$HOME | /home/podman $HOME $HOME | vol mount
"
while read vol expect name; do
opts=
Expand Down
4 changes: 1 addition & 3 deletions test/system/050-stop.bats
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ load helpers
sleep 0.5
done

# Other commands can acquire the lock
run_podman ps -a

# This command must be able to take the container lock.
# The container state transitioned to "stopping"
run_podman inspect --format '{{.State.Status}}' $ctrname
is "$output" "stopping" "Status of container should be 'stopping'"
Expand Down
4 changes: 3 additions & 1 deletion test/system/080-pause.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
load helpers
load helpers.systemd

# bats test_tags=ci:parallel
# SHOULD NOT BE PARALLELIZED! The use of podman ps -a makes it timing sensitive
# as this command takes locks of all containers and parallel containers may
# block for a while.
@test "podman pause/unpause" {
if is_rootless && ! is_cgroupsv2; then
skip "'podman pause' (rootless) only works with cgroups v2"
Expand Down
20 changes: 19 additions & 1 deletion test/system/220-healthcheck.bats
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function _check_health_log {
hcStatus=$PODMAN_TMPDIR/hcStatus

run_podman run -d --name $ctr \
--health-cmd "sleep 20; echo $msg" \
--health-cmd "touch /tmp/abc; sleep 20; echo $msg" \
$IMAGE /home/podman/pause

timeout --foreground -v --kill=10 60 \
Expand All @@ -440,6 +440,24 @@ function _check_health_log {
run_podman inspect $ctr --format "{{.State.Status}}"
assert "$output" == "running" "Container is running"

### Flake, sometimes it is possible that the background healthcheck runs so slow that
# it starts after the podman stop below and then fails with
# "can only create exec sessions on running containers: container state improper".
# To fix this we wait for a file th healthcheck creates right away to know it is running.
timeout=5
while :; do
run_podman '?' exec $ctr cat /tmp/abc
if [[ "$status" -eq 0 ]]; then
break
fi

timeout=$((timeout - 1))
if [[ $timeout -eq 0 ]]; then
die "timed out waiting for healthcheck to run and create test file"
fi
sleep 1
done

run_podman stop $ctr

# Wait for background healthcheck to finish and make sure the exit status is 1
Expand Down
7 changes: 4 additions & 3 deletions test/system/500-networking.bats
Original file line number Diff line number Diff line change
Expand Up @@ -856,9 +856,10 @@ nameserver 8.8.8.8" "nameserver order is correct"

local -a netmodes=("bridge")
# pasta only works rootless
if is_rootless; then
netmodes+=("pasta")
fi
# FIXME: skip pasta because this is super flaky, https://bugs.passt.top/show_bug.cgi?id=202
#if is_rootless; then
# netmodes+=("pasta")
#fi

for netmode in "${netmodes[@]}"; do
local range=$(random_free_port_range 3)
Expand Down
1 change: 1 addition & 0 deletions test/system/505-networking-pasta.bats
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ function pasta_test_do() {
}

@test "IPv6 default address assignment" {
skip "Host ipv6 set can vary vastly and may not have one true default address"
skip_if_no_ipv6 "IPv6 not routable on the host"

run_podman run --rm --net=pasta $IMAGE ip -j -6 address show
Expand Down