summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
Diffstat (limited to 'test/system')
-rw-r--r--test/system/001-basic.bats4
-rw-r--r--test/system/015-help.bats4
-rw-r--r--test/system/120-load.bats20
-rw-r--r--test/system/200-pod.bats19
-rw-r--r--test/system/272-system-connection.bats8
-rw-r--r--test/system/500-networking.bats19
6 files changed, 64 insertions, 10 deletions
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index 78b8ecdfd..03f07d602 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -120,9 +120,7 @@ function setup() {
fi
run_podman 125 --remote
- is "$output" "Error: missing command 'podman COMMAND'
-Try 'podman --help' for more information." \
- "podman --remote show usage message without running endpoint"
+ is "$output" ".*Usage:" "podman --remote show usage message without running endpoint"
}
# This is for development only; it's intended to make sure our timeout
diff --git a/test/system/015-help.bats b/test/system/015-help.bats
index b0795b524..a87081687 100644
--- a/test/system/015-help.bats
+++ b/test/system/015-help.bats
@@ -149,12 +149,12 @@ function check_help() {
count=$(expr $count + 1)
done
- # Any command that takes subcommands, must throw error if called
+ # Any command that takes subcommands, prints its help and errors if called
# without one.
dprint "podman $@"
run_podman '?' "$@"
is "$status" 125 "'podman $*' without any subcommand - exit status"
- is "$output" "Error: missing command .*$@ COMMAND" \
+ is "$output" ".*Usage:.*Error: missing command '.*$@ COMMAND'" \
"'podman $*' without any subcommand - expected error message"
# Assume that 'NoSuchCommand' is not a command
diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index e9959271f..a5508b2f4 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -126,6 +126,26 @@ verify_iid_and_name() {
verify_iid_and_name $img_name
}
+@test "podman load - from URL" {
+ get_iid_and_name
+ run_podman save $img_name -o $archive
+ run_podman rmi $iid
+
+ HOST_PORT=$(random_free_port)
+ SERVER=http://127.0.0.1:$HOST_PORT
+
+ # Bind-mount the archive to a container running httpd
+ run_podman run -d --name myweb -p "$HOST_PORT:80" \
+ -v $archive:/var/www/image.tar:Z \
+ -w /var/www \
+ $IMAGE /bin/busybox-extras httpd -f -p 80
+
+ run_podman load -i $SERVER/image.tar
+ verify_iid_and_name $img_name
+
+ run_podman rm -f -t0 myweb
+}
+
@test "podman load - redirect corrupt payload" {
run_podman 125 load <<< "Danger, Will Robinson!! This is a corrupt tarball!"
is "$output" \
diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats
index 09a419914..60cfbc9dd 100644
--- a/test/system/200-pod.bats
+++ b/test/system/200-pod.bats
@@ -60,6 +60,25 @@ function teardown() {
run_podman pod rm -f -t 0 $podid
}
+
+@test "podman pod create - custom infra image" {
+ image="i.do/not/exist:image"
+
+ tmpdir=$PODMAN_TMPDIR/pod-test
+ run mkdir -p $tmpdir
+ containersconf=$tmpdir/containers.conf
+ cat >$containersconf <<EOF
+[engine]
+infra_image="$image"
+EOF
+
+ run_podman 125 pod create --infra-image $image
+ is "$output" ".*initializing source docker://$image:.*"
+
+ CONTAINERS_CONF=$containersconf run_podman 125 pod create
+ is "$output" ".*initializing source docker://$image:.*"
+}
+
function rm_podman_pause_image() {
run_podman version --format "{{.Server.Version}}-{{.Server.Built}}"
run_podman rmi -f "localhost/podman-pause:$output"
diff --git a/test/system/272-system-connection.bats b/test/system/272-system-connection.bats
index 5a90d9398..4e9ac4dd6 100644
--- a/test/system/272-system-connection.bats
+++ b/test/system/272-system-connection.bats
@@ -34,10 +34,7 @@ function teardown() {
| xargs -l1 --no-run-if-empty umount
# Remove all system connections
- run_podman system connection ls --format json
- while read name; do
- run_podman system connection rm "$name"
- done < <(jq -r '.[].Name' <<<"$output")
+ run_podman system connection rm --all
basic_teardown
}
@@ -53,7 +50,8 @@ function _run_podman_remote() {
# Very basic test, does not actually connect at any time
@test "podman system connection - basic add / ls / remove" {
run_podman system connection ls
- is "$output" "" "system connection ls: no connections"
+ is "$output" "Name URI Identity Default" \
+ "system connection ls: no connections"
c1="c1_$(random_string 15)"
c2="c2_$(random_string 15)"
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index b3471b425..21350ed36 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -78,6 +78,9 @@ load helpers
if [[ -z $cidr ]]; then
# regex to match that we are in 10.X subnet
match="10\..*"
+ # force bridge networking also for rootless
+ # this ensures that rootless + bridge + userns + ports works
+ network_arg="--network bridge"
else
# Issue #9828 make sure a custom slir4netns cidr also works
network_arg="--network slirp4netns:cidr=$cidr"
@@ -167,6 +170,13 @@ load helpers
$IMAGE nc -l -n -v -p $myport
cid="$output"
+ # FIXME: debugging for #11871
+ run_podman exec $cid cat /etc/resolv.conf
+ if is_rootless; then
+ run_podman unshare --rootless-cni cat /etc/resolv.conf
+ fi
+ ps uxww
+
# check that dns is working inside the container
run_podman exec $cid nslookup google.com
@@ -420,6 +430,7 @@ load helpers
is "$output" "[${cid:0:12}]" "short container id in network aliases"
run_podman network disconnect $netname $cid
+ is "$output" "" "Output should be empty (no errors)"
# check that we cannot curl (timeout after 3 sec)
run curl --max-time 3 -s $SERVER/index.txt
@@ -428,6 +439,7 @@ load helpers
fi
run_podman network connect $netname $cid
+ is "$output" "" "Output should be empty (no errors)"
# curl should work again
run curl --max-time 3 -s $SERVER/index.txt
@@ -444,6 +456,12 @@ load helpers
die "MAC address did not change after podman network disconnect/connect"
fi
+ # Disconnect/reconnect of a container *with no ports* should succeed quietly
+ run_podman network disconnect $netname $background_cid
+ is "$output" "" "disconnect of container with no open ports"
+ run_podman network connect $netname $background_cid
+ is "$output" "" "(re)connect of container with no open ports"
+
# FIXME FIXME FIXME: #11825: bodhi tests are failing, remote+rootless only,
# with "dnsmasq: failed to create inotify". This error has never occurred
# in CI, and Ed has been unable to reproduce it on 1minutetip. This next
@@ -454,6 +472,7 @@ load helpers
# connect a second network
run_podman network connect $netname2 $cid
+ is "$output" "" "Output should be empty (no errors)"
# check network2 alias for container short id
run_podman inspect $cid --format "{{(index .NetworkSettings.Networks \"$netname2\").Aliases}}"