diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-02-21 16:27:25 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-02-22 15:51:49 +0100 |
commit | 9d818be7329929b05b93e432c408ee65726ec2c0 (patch) | |
tree | 866e87cfc163e1e4b9b6493a342f1c36e2d8d9e3 /test/e2e/create_test.go | |
parent | 6fbf73ed8bd34738f3f901df1e5d3b592a9c3354 (diff) | |
download | podman-9d818be7329929b05b93e432c408ee65726ec2c0.tar.gz podman-9d818be7329929b05b93e432c408ee65726ec2c0.tar.bz2 podman-9d818be7329929b05b93e432c408ee65726ec2c0.zip |
Fix podman network IDs handling
The libpod network logic knows about networks IDs but OCICNI
does not. We cannot pass the network ID to OCICNI. Instead we
need to make sure we only use network names internally. This
is also important for libpod since we also only store the
network names in the state. If we would add a ID there the
same networks could accidentally be added twice.
Fixes #9451
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'test/e2e/create_test.go')
-rw-r--r-- | test/e2e/create_test.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index 43da95a9d..1f1786dbe 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -9,6 +9,7 @@ import ( "strings" . "github.com/containers/podman/v3/test/utils" + "github.com/containers/storage/pkg/stringid" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) @@ -576,15 +577,20 @@ var _ = Describe("Podman create", func() { Expect(session.ExitCode()).ToNot(BeZero()) }) - It("create container in pod with network should fail", func() { + It("create container in pod with network should not fail", func() { name := "createwithnetwork" pod := podmanTest.RunTopContainerInPod("", "new:"+name) pod.WaitWithDefaultTimeout() Expect(pod.ExitCode()).To(BeZero()) - session := podmanTest.Podman([]string{"create", "--pod", name, "--network", "foobar", ALPINE, "top"}) + netName := "pod" + stringid.GenerateNonCryptoID() + session := podmanTest.Podman([]string{"network", "create", netName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + defer podmanTest.removeCNINetwork(netName) + + session = podmanTest.Podman([]string{"create", "--pod", name, "--network", netName, ALPINE, "top"}) session.WaitWithDefaultTimeout() - //Expect(session.ExitCode()).ToNot(BeZero()) Expect(session.ExitCode()).To(BeZero()) }) |