summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-11 16:34:08 -0500
committerGitHub <noreply@github.com>2022-02-11 16:34:08 -0500
commitb0a445e3545d66ba449f2e3e81bde3a2c5db4896 (patch)
tree8e17b2501364ff5c3a1f8d5bd2875a3abfa05f03 /test/system
parentc4a9aa7c73e120fc2e246f056fec83ff35854dba (diff)
parent6a3de93513947368bb27d2daf2d85e096bd5fa6b (diff)
downloadpodman-b0a445e3545d66ba449f2e3e81bde3a2c5db4896.tar.gz
podman-b0a445e3545d66ba449f2e3e81bde3a2c5db4896.tar.bz2
podman-b0a445e3545d66ba449f2e3e81bde3a2c5db4896.zip
Merge pull request #13203 from mheon/bump_rc5
Bump to v4.0.0-RC5
Diffstat (limited to 'test/system')
-rw-r--r--test/system/200-pod.bats2
-rw-r--r--test/system/220-healthcheck.bats17
-rw-r--r--test/system/250-systemd.bats30
-rw-r--r--test/system/500-networking.bats24
-rw-r--r--test/system/520-checkpoint.bats4
5 files changed, 59 insertions, 18 deletions
diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats
index bccd04e8d..34dfaa8f6 100644
--- a/test/system/200-pod.bats
+++ b/test/system/200-pod.bats
@@ -340,7 +340,7 @@ EOF
run_podman 125 pod create --share bogus --name $pod_name
is "$output" ".*Invalid kernel namespace to share: bogus. Options are: cgroup, ipc, net, pid, uts or none" \
"pod test for bogus --share option"
- run_podman pod create --share cgroup,ipc --name $pod_name
+ run_podman pod create --share ipc --name $pod_name
run_podman run --rm --pod $pod_name --hostname foobar $IMAGE hostname
is "$output" "foobar" "--hostname should work with non share UTS namespace"
}
diff --git a/test/system/220-healthcheck.bats b/test/system/220-healthcheck.bats
index 1d4a2ea7e..c502ad669 100644
--- a/test/system/220-healthcheck.bats
+++ b/test/system/220-healthcheck.bats
@@ -15,10 +15,7 @@ function _check_health {
run_podman inspect --format "{{json .State.Healthcheck}}" healthcheck_c
parse_table "$tests" | while read field expect;do
- # (kludge to deal with parse_table and empty strings)
- if [ "$expect" = "''" ]; then expect=""; fi
-
- actual=$(jq -r ".$field" <<<"$output")
+ actual=$(jq ".$field" <<<"$output")
is "$actual" "$expect" "$testname - .State.Healthcheck.$field"
done
}
@@ -77,10 +74,10 @@ EOF
is "$output" "" "output from 'podman healthcheck run'"
_check_health "All healthy" "
-Status | healthy
+Status | \"healthy\"
FailingStreak | 0
Log[-1].ExitCode | 0
-Log[-1].Output |
+Log[-1].Output | \"Life is Good on stdout\\\nLife is Good on stderr\"
"
# Force a failure
@@ -88,19 +85,19 @@ Log[-1].Output |
sleep 2
_check_health "First failure" "
-Status | healthy
+Status | \"healthy\"
FailingStreak | [123]
Log[-1].ExitCode | 1
-Log[-1].Output |
+Log[-1].Output | \"Uh-oh on stdout!\\\nUh-oh on stderr!\"
"
# After three successive failures, container should no longer be healthy
sleep 5
_check_health "Three or more failures" "
-Status | unhealthy
+Status | \"unhealthy\"
FailingStreak | [3456]
Log[-1].ExitCode | 1
-Log[-1].Output |
+Log[-1].Output | \"Uh-oh on stdout!\\\nUh-oh on stderr!\"
"
# healthcheck should now fail, with exit status 1 and 'unhealthy' output
diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats
index c47679904..3847d9510 100644
--- a/test/system/250-systemd.bats
+++ b/test/system/250-systemd.bats
@@ -281,4 +281,34 @@ LISTEN_FDNAMES=listen_fdnames" | sort)
is "$output" "" "output should be empty"
}
+# https://github.com/containers/podman/issues/13153
+@test "podman rootless-netns slirp4netns process should be in different cgroup" {
+ is_rootless || skip "only meaningful for rootless"
+
+ cname=$(random_string)
+ local netname=testnet-$(random_string 10)
+
+ # create network and container with network
+ run_podman network create $netname
+ run_podman create --name $cname --network $netname $IMAGE top
+
+ # run container in systemd unit
+ service_setup
+
+ # run second container with network
+ cname2=$(random_string)
+ run_podman run -d --name $cname2 --network $netname $IMAGE top
+
+ # stop systemd container
+ service_cleanup
+
+ # now check that the rootless netns slirp4netns process is still alive and working
+ run_podman unshare --rootless-netns ip addr
+ is "$output" ".*tap0.*" "slirp4netns interface exists in the netns"
+ run_podman exec $cname2 nslookup google.com
+
+ run_podman rm -f -t0 $cname2
+ run_podman network rm -f $netname
+}
+
# vim: filetype=sh
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 9f70c1c6c..b49f141dc 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -605,9 +605,27 @@ load helpers
"8.8.8.8",
]
EOF
- CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE grep "example.com" /etc/resolv.conf
- CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE grep $searchIP /etc/resolv.conf
- is "$output" "nameserver $searchIP" "Should only be one $searchIP not multiple"
+
+ local nl="
+"
+
+ CONTAINERS_CONF=$containersconf run_podman run --rm $IMAGE cat /etc/resolv.conf
+ is "$output" "search example.com$nl.*" "correct seach domain"
+ is "$output" ".*nameserver 1.1.1.1${nl}nameserver $searchIP${nl}nameserver 1.0.0.1${nl}nameserver 8.8.8.8" "nameserver order is correct"
+
+ # create network with dns
+ local netname=testnet-$(random_string 10)
+ local subnet=$(random_rfc1918_subnet)
+ run_podman network create --subnet "$subnet.0/24" $netname
+ # custom server overwrites the network dns server
+ CONTAINERS_CONF=$containersconf run_podman run --network $netname --rm $IMAGE cat /etc/resolv.conf
+ is "$output" "search example.com$nl.*" "correct seach domain"
+ is "$output" ".*nameserver 1.1.1.1${nl}nameserver $searchIP${nl}nameserver 1.0.0.1${nl}nameserver 8.8.8.8" "nameserver order is correct"
+
+ # we should use the integrated dns server
+ run_podman run --network $netname --rm $IMAGE cat /etc/resolv.conf
+ is "$output" "search dns.podman.*" "correct seach domain"
+ is "$output" ".*nameserver $subnet.1.*" "integrated dns nameserver is set"
}
# vim: filetype=sh
diff --git a/test/system/520-checkpoint.bats b/test/system/520-checkpoint.bats
index fcb7fbb84..046dfd126 100644
--- a/test/system/520-checkpoint.bats
+++ b/test/system/520-checkpoint.bats
@@ -15,10 +15,6 @@ function setup() {
skip "FIXME: checkpointing broken in Ubuntu 2004, 2104, 2110, ..."
fi
- if [[ "$(uname -r)" =~ "5.17" ]]; then
- skip "FIXME: checkpointing broken on kernel 5.17 (#12949)"
- fi
-
# None of these tests work rootless....
if is_rootless; then
# ...however, is that a genuine cast-in-stone limitation, or one