summaryrefslogtreecommitdiff
path: root/test/system/500-networking.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2020-09-16 10:06:33 -0600
committerEd Santiago <santiago@redhat.com>2020-09-19 15:55:00 -0600
commitbd3c66fc8151350ad6562959054eddb5508cf028 (patch)
tree487c34a3af99796784538929d8cc61a536a07622 /test/system/500-networking.bats
parent852943516606f32ccc2406f41bcf3df42d7c622c (diff)
downloadpodman-bd3c66fc8151350ad6562959054eddb5508cf028.tar.gz
podman-bd3c66fc8151350ad6562959054eddb5508cf028.tar.bz2
podman-bd3c66fc8151350ad6562959054eddb5508cf028.zip
system tests: new tests
- podman network create: new test - podman pull by-sha + podman images -a (#7651) - podman image mount: new test - podman pod: --infra-image and --infra-command (#7167) For convenience and robustness, build a new testimage containing a custom file /home/podman/testimage-id with contents YYYYMMDD (same as image tag). The image-mount test checks that this file exists and has the desired content. New testimage also includes a dummy 'pause' executable, for testing pod infra. Updates from testimage:20200902 to :20200917 Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/500-networking.bats')
-rw-r--r--test/system/500-networking.bats29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 39de8ad54..d2454fbf4 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -80,4 +80,33 @@ load helpers
run_podman rm $cid
}
+# "network create" now works rootless, with the help of a special container
+@test "podman network create" {
+ local mynetname=testnet-$(random_string 10)
+ local mysubnet=$(random_rfc1918_subnet)
+
+ run_podman network create --subnet "${mysubnet}.0/24" $mynetname
+ is "$output" ".*/cni/net.d/$mynetname.conflist" "output of 'network create'"
+
+ # WARNING: this pulls a ~100MB image from quay.io, hence is slow/flaky
+ run_podman run --rm --network $mynetname $IMAGE ip a
+ is "$output" ".* inet ${mysubnet}\.2/24 brd ${mysubnet}\.255 " \
+ "sdfsdf"
+
+ # Cannot create network with the same name
+ run_podman 125 network create $mynetname
+ is "$output" "Error: the network name $mynetname is already used" \
+ "Trying to create an already-existing network"
+
+ run_podman network rm $mynetname
+ run_podman 125 network rm $mynetname
+
+ # rootless CNI leaves behind an image pulled by SHA, hence with no tag.
+ # Remove it if present; we can only remove it by ID.
+ run_podman images --format '{{.Id}}' rootless-cni-infra
+ if [ -n "$output" ]; then
+ run_podman rmi $output
+ fi
+}
+
# vim: filetype=sh