diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-31 11:12:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-31 11:12:05 +0100 |
commit | 5a53c6e5c97afe4c4add1d649b6f9d68204a8918 (patch) | |
tree | 3db189d698634e27a7a756b5f8ca5cb81a87c2f5 /test | |
parent | b6ab2df9d11a736c7781f200ff39c886f41e172d (diff) | |
parent | 2704dfbb7a3fc079a74e9c8edf1acd7be24db035 (diff) | |
download | podman-5a53c6e5c97afe4c4add1d649b6f9d68204a8918.tar.gz podman-5a53c6e5c97afe4c4add1d649b6f9d68204a8918.tar.bz2 podman-5a53c6e5c97afe4c4add1d649b6f9d68204a8918.zip |
Merge pull request #8203 from Luap99/fix-8194
Fix dnsname when joining a different network namespace in a pod
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_networking_test.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 9f6fd8602..a3cc352b1 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -594,4 +594,39 @@ var _ = Describe("Podman run networking", func() { Expect(run.ExitCode()).To(BeZero()) Expect(strings.Contains(run.OutputToString(), hostname)).To(BeTrue()) }) + + It("podman run check dnsname plugin", func() { + pod := "testpod" + session := podmanTest.Podman([]string{"pod", "create", "--name", pod}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + + net := "dnsNetTest" + session = podmanTest.Podman([]string{"network", "create", net}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + defer podmanTest.removeCNINetwork(net) + + pod2 := "testpod2" + session = podmanTest.Podman([]string{"pod", "create", "--network", net, "--name", pod2}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + + session = podmanTest.Podman([]string{"run", "--name", "con1", "--network", net, ALPINE, "nslookup", "con1"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + + session = podmanTest.Podman([]string{"run", "--name", "con2", "--pod", pod, "--network", net, ALPINE, "nslookup", "con2"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + + session = podmanTest.Podman([]string{"run", "--name", "con3", "--pod", pod2, ALPINE, "nslookup", "con3"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(1)) + Expect(session.ErrorToString()).To(ContainSubstring("can't resolve 'con3'")) + + session = podmanTest.Podman([]string{"run", "--name", "con4", "--network", net, ALPINE, "nslookup", pod2}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + }) }) |