diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/apiv2/35-networks.at | 27 | ||||
-rw-r--r-- | test/e2e/create_test.go | 8 | ||||
-rw-r--r-- | test/e2e/import_test.go | 6 | ||||
-rw-r--r-- | test/e2e/load_test.go | 10 | ||||
-rw-r--r-- | test/e2e/pull_test.go | 7 | ||||
-rw-r--r-- | test/e2e/run_test.go | 8 | ||||
-rw-r--r-- | test/e2e/save_test.go | 18 |
7 files changed, 70 insertions, 14 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at index fd8dfd32b..713f677fa 100644 --- a/test/apiv2/35-networks.at +++ b/test/apiv2/35-networks.at @@ -170,4 +170,31 @@ t DELETE libpod/networks/macvlan1 200 \ .[0].Name~macvlan1 \ .[0].Err=null +# +# test networks with containers +# +podman pull $IMAGE &>/dev/null + +# Ensure clean slate +podman rm -a -f &>/dev/null + +# create a network +podman network create --subnet 10.10.253.0/24 --gateway 10.10.253.1 network5 +t GET libpod/networks/json?filters='{"name":["network5"]}' 200 \ + .[0].id~[0-9a-f]\\{64\\} +nid=$(jq -r '.[0].id' <<<"$output") +# create a pod on a network +CNAME=mynettest +podman run --network network5 --name $CNAME --ip 10.10.253.2 --mac-address 0a:01:73:78:43:18 -td $IMAGE top +t GET libpod/containers/json?all=true 200 \ + .[0].Id~[0-9a-f]\\{64\\} +cid=$(jq -r '.[0].Id' <<<"$output") +# compat api inspect network +t GET networks/$nid 200 .Name="network5" \ + .Containers[\"$cid\"].Name=$CNAME \ + .Containers[\"$cid\"].MacAddress=0a:01:73:78:43:18 \ + .Containers[\"$cid\"].IPv4Address=10.10.253.2/24 +# clean the network +podman network rm -f network5 + # vim: filetype=sh diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index f237d24b9..216432216 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -362,14 +362,18 @@ var _ = Describe("Podman create", func() { }) It("podman create --signature-policy", func() { - SkipIfRemote("SigPolicy not handled by remote") session := podmanTest.Podman([]string{"create", "--pull=always", "--signature-policy", "/no/such/file", ALPINE}) session.WaitWithDefaultTimeout() Expect(session).To(ExitWithError()) session = podmanTest.Podman([]string{"create", "--pull=always", "--signature-policy", "/etc/containers/policy.json", ALPINE}) session.WaitWithDefaultTimeout() - Expect(session).Should(Exit(0)) + if IsRemote() { + Expect(session).To(ExitWithError()) + Expect(session.ErrorToString()).To(ContainSubstring("unknown flag")) + } else { + Expect(session).Should(Exit(0)) + } }) It("podman create with unset label", func() { diff --git a/test/e2e/import_test.go b/test/e2e/import_test.go index 5531bed8c..e1c89753e 100644 --- a/test/e2e/import_test.go +++ b/test/e2e/import_test.go @@ -171,6 +171,12 @@ var _ = Describe("Podman import", func() { result := podmanTest.Podman([]string{"import", "--signature-policy", "/etc/containers/policy.json", outfile}) result.WaitWithDefaultTimeout() + if IsRemote() { + Expect(result).To(ExitWithError()) + Expect(result.ErrorToString()).To(ContainSubstring("unknown flag")) + result := podmanTest.Podman([]string{"import", outfile}) + result.WaitWithDefaultTimeout() + } Expect(result).Should(Exit(0)) }) }) diff --git a/test/e2e/load_test.go b/test/e2e/load_test.go index e79c1eb8a..030e9f80b 100644 --- a/test/e2e/load_test.go +++ b/test/e2e/load_test.go @@ -104,7 +104,15 @@ var _ = Describe("Podman load", func() { result := podmanTest.Podman([]string{"load", "--signature-policy", "/etc/containers/policy.json", "-i", outfile}) result.WaitWithDefaultTimeout() - Expect(result).Should(Exit(0)) + if IsRemote() { + Expect(result).To(ExitWithError()) + Expect(result.ErrorToString()).To(ContainSubstring("unknown flag")) + result = podmanTest.Podman([]string{"load", "-i", outfile}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(0)) + } else { + Expect(result).Should(Exit(0)) + } }) It("podman load with quiet flag", func() { diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go index c377f158d..fdb1b0c57 100644 --- a/test/e2e/pull_test.go +++ b/test/e2e/pull_test.go @@ -48,7 +48,7 @@ var _ = Describe("Podman pull", func() { found, _ := session.ErrorGrepString(expectedError) Expect(found).To(Equal(true)) - session = podmanTest.Podman([]string{"rmi", "busybox", "alpine", "testdigest_v2s2", "quay.io/libpod/cirros"}) + session = podmanTest.Podman([]string{"rmi", "busybox:musl", "alpine", "quay.io/libpod/cirros", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) }) @@ -104,8 +104,13 @@ var _ = Describe("Podman pull", func() { session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) + // Without a tag/digest the input is normalized with the "latest" tag, see #11964 session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2"}) session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(1)) + + session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"}) + session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) }) diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index ec64d2166..aa9037e56 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -83,14 +83,18 @@ var _ = Describe("Podman run", func() { }) It("podman run --signature-policy", func() { - SkipIfRemote("SigPolicy not handled by remote") session := podmanTest.Podman([]string{"run", "--pull=always", "--signature-policy", "/no/such/file", ALPINE}) session.WaitWithDefaultTimeout() Expect(session).To(ExitWithError()) session = podmanTest.Podman([]string{"run", "--pull=always", "--signature-policy", "/etc/containers/policy.json", ALPINE}) session.WaitWithDefaultTimeout() - Expect(session).Should(Exit(0)) + if IsRemote() { + Expect(session).To(ExitWithError()) + Expect(session.ErrorToString()).To(ContainSubstring("unknown flag")) + } else { + Expect(session).Should(Exit(0)) + } }) It("podman run --rm with --restart", func() { diff --git a/test/e2e/save_test.go b/test/e2e/save_test.go index 9f3f750b7..a8fb6c7b3 100644 --- a/test/e2e/save_test.go +++ b/test/e2e/save_test.go @@ -194,14 +194,16 @@ default-docker: session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy=sign/policy.json", "localhost:5000/alpine"}) - session.WaitWithDefaultTimeout() - Expect(session).Should(Exit(0)) - - outfile := filepath.Join(podmanTest.TempDir, "temp.tar") - save := podmanTest.Podman([]string{"save", "remove-signatures=true", "-o", outfile, "localhost:5000/alpine"}) - save.WaitWithDefaultTimeout() - Expect(save).To(ExitWithError()) + if !IsRemote() { + session = podmanTest.Podman([]string{"pull", "--tls-verify=false", "--signature-policy=sign/policy.json", "localhost:5000/alpine"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + outfile := filepath.Join(podmanTest.TempDir, "temp.tar") + save := podmanTest.Podman([]string{"save", "remove-signatures=true", "-o", outfile, "localhost:5000/alpine"}) + save.WaitWithDefaultTimeout() + Expect(save).To(ExitWithError()) + } }) It("podman save image with digest reference", func() { |