summaryrefslogtreecommitdiff
path: root/test/e2e/network_test.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2021-02-01 14:42:38 -0600
committerbaude <bbaude@redhat.com>2021-02-01 14:42:38 -0600
commite11d8f15e8d7559bc70ebef2dd0125be9d692da5 (patch)
tree93cb63e3a92b39ebb33ceb8aed07e31a283011e9 /test/e2e/network_test.go
parent20183349fd2c6a9a569c6c79234af48bb5d92ff7 (diff)
downloadpodman-e11d8f15e8d7559bc70ebef2dd0125be9d692da5.tar.gz
podman-e11d8f15e8d7559bc70ebef2dd0125be9d692da5.tar.bz2
podman-e11d8f15e8d7559bc70ebef2dd0125be9d692da5.zip
add macvlan as a supported network driver
instead of using the --macvlan to indicate that you want to make a macvlan network, podman network create now honors the driver name of *macvlan*. Any options to macvlan, like the parent device, should be specified as a -o option. For example, -o parent=eth0. the --macvlan option was marked as deprecated in the man page but is still supported for the duration of 3.0. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e/network_test.go')
-rw-r--r--test/e2e/network_test.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go
index 2f5290c76..124ee7e29 100644
--- a/test/e2e/network_test.go
+++ b/test/e2e/network_test.go
@@ -457,6 +457,47 @@ var _ = Describe("Podman network", func() {
Expect(nc.ExitCode()).To(Equal(0))
})
+ It("podman network create/remove macvlan as driver (-d) no device name", func() {
+ net := "macvlan" + stringid.GenerateNonCryptoID()
+ nc := podmanTest.Podman([]string{"network", "create", "-d", "macvlan", net})
+ nc.WaitWithDefaultTimeout()
+ defer podmanTest.removeCNINetwork(net)
+ Expect(nc.ExitCode()).To(Equal(0))
+
+ inspect := podmanTest.Podman([]string{"network", "inspect", net})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.ExitCode()).To(BeZero())
+
+ out, err := inspect.jq(".[0].plugins[0].master")
+ Expect(err).To(BeNil())
+ Expect(out).To(Equal("\"\""))
+
+ nc = podmanTest.Podman([]string{"network", "rm", net})
+ nc.WaitWithDefaultTimeout()
+ Expect(nc.ExitCode()).To(Equal(0))
+ })
+
+ It("podman network create/remove macvlan as driver (-d) with device name", func() {
+ net := "macvlan" + stringid.GenerateNonCryptoID()
+ nc := podmanTest.Podman([]string{"network", "create", "-d", "macvlan", "-o", "parent=lo", net})
+ nc.WaitWithDefaultTimeout()
+ defer podmanTest.removeCNINetwork(net)
+ Expect(nc.ExitCode()).To(Equal(0))
+
+ inspect := podmanTest.Podman([]string{"network", "inspect", net})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.ExitCode()).To(BeZero())
+ fmt.Println(inspect.OutputToString())
+
+ out, err := inspect.jq(".[0].plugins[0].master")
+ Expect(err).To(BeNil())
+ Expect(out).To(Equal("\"lo\""))
+
+ nc = podmanTest.Podman([]string{"network", "rm", net})
+ nc.WaitWithDefaultTimeout()
+ Expect(nc.ExitCode()).To(Equal(0))
+ })
+
It("podman network exists", func() {
net := "net" + stringid.GenerateNonCryptoID()
session := podmanTest.Podman([]string{"network", "create", net})