summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-11-24 15:09:20 +0100
committerPaul Holzinger <paul.holzinger@web.de>2020-11-24 15:16:23 +0100
commit9602e290de75bdd7fb5b42f6d36069dd19271735 (patch)
tree60077e068f422fa971dc733c85a00211bbe6c0e3 /test
parentcd6c4cb0affdb1e8a647079b2808da6bf833d543 (diff)
downloadpodman-9602e290de75bdd7fb5b42f6d36069dd19271735.tar.gz
podman-9602e290de75bdd7fb5b42f6d36069dd19271735.tar.bz2
podman-9602e290de75bdd7fb5b42f6d36069dd19271735.zip
Fix custom mac address with a custom cni network
The cni plugin `tuning` is required to set a custom mac address. This plugin is configured in the default cni config file which is packaged with podman but was not included the generated config form `podman network create`. Fixes #8385 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/create_staticmac_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/e2e/create_staticmac_test.go b/test/e2e/create_staticmac_test.go
index adffdc1ca..1ac431da2 100644
--- a/test/e2e/create_staticmac_test.go
+++ b/test/e2e/create_staticmac_test.go
@@ -5,6 +5,7 @@ import (
"github.com/containers/podman/v2/pkg/rootless"
. "github.com/containers/podman/v2/test/utils"
+ "github.com/containers/storage/pkg/stringid"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
@@ -45,4 +46,21 @@ var _ = Describe("Podman run with --mac-address flag", func() {
Expect(result.OutputToString()).To(ContainSubstring("92:d0:c6:0a:29:34"))
}
})
+
+ It("Podman run --mac-address with custom network", func() {
+ net := "n1" + stringid.GenerateNonCryptoID()
+ session := podmanTest.Podman([]string{"network", "create", net})
+ session.WaitWithDefaultTimeout()
+ defer podmanTest.removeCNINetwork(net)
+ Expect(session.ExitCode()).To(BeZero())
+
+ result := podmanTest.Podman([]string{"run", "--network", net, "--mac-address", "92:d0:c6:00:29:34", ALPINE, "ip", "addr"})
+ result.WaitWithDefaultTimeout()
+ if rootless.IsRootless() {
+ Expect(result.ExitCode()).To(Equal(125))
+ } else {
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(result.OutputToString()).To(ContainSubstring("92:d0:c6:00:29:34"))
+ }
+ })
})