-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for driver-specific options during container creation #24535
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ package integration | |
import ( | ||
"encoding/json" | ||
"fmt" | ||
"net" | ||
"path/filepath" | ||
"time" | ||
|
||
|
@@ -297,6 +298,27 @@ var _ = Describe("Podman network", func() { | |
Expect(rmAll).Should(ExitCleanly()) | ||
}) | ||
|
||
It("podman run container host interface name", func() { | ||
Skip("FIXME: We need netavark >= v1.14 for host interface support") | ||
|
||
ctrName := "testCtr" | ||
vethName := "my_veth" + stringid.GenerateRandomID()[:8] | ||
container := podmanTest.Podman([]string{"run", "-dt", "--network", "bridge:host_interface_name=" + vethName, "--name", ctrName, ALPINE, "top"}) | ||
container.WaitWithDefaultTimeout() | ||
Expect(container).Should(ExitCleanly()) | ||
|
||
if !isRootless() { | ||
veth, err := net.InterfaceByName(vethName) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(veth.Name).To(Equal(vethName)) | ||
} else { | ||
session := podmanTest.Podman([]string{"unshare", "--rootless-netns", "ip", "link", "show", vethName}) | ||
session.WaitWithDefaultTimeout() | ||
Expect(session).Should(ExitCleanly()) | ||
Expect(session.OutputToString()).To(ContainSubstring(vethName)) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go
index 018b7eb97..3d3f1d393 100644
--- a/test/e2e/network_test.go
+++ b/test/e2e/network_test.go
@@ -312,6 +312,11 @@ var _ = Describe("Podman network", func() {
veth, err := net.InterfaceByName(vethName)
Expect(err).ToNot(HaveOccurred())
Expect(veth.Name).To(Equal(vethName))
+ } else {
+ session := podmanTest.Podman([]string{"unshare", "--rootless-netns", "ip", "link", "show", vethName})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(ExitCleanly())
+ Expect(session.OutputToString()).To(ContainSubstring(vethName))
}
})
we can test rootless as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good idea, thanks. |
||
}) | ||
|
||
It("podman inspect container two CNI networks (container not running)", func() { | ||
netName1 := "net1-" + stringid.GenerateRandomID() | ||
network1 := podmanTest.Podman([]string{"network", "create", netName1}) | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you rename the test to not say invalid but rather unknown.
Also maybe add another case where add 2+ options to make sure it is working for multiple keys. I know it does as the code is simple enough but better to validate that