diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-11-11 17:49:18 +0100 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-11-11 17:50:10 +0100 |
commit | 3af19917a1666fc3f29d98f7f0b937eb488f706c (patch) | |
tree | 6733c72cc63af681881b93d718b401debcded38c /libpod/network/netavark | |
parent | fe90a45e0d914723b8c26e4e9497f414312b6af0 (diff) | |
download | podman-3af19917a1666fc3f29d98f7f0b937eb488f706c.tar.gz podman-3af19917a1666fc3f29d98f7f0b937eb488f706c.tar.bz2 podman-3af19917a1666fc3f29d98f7f0b937eb488f706c.zip |
Add failing run test for netavark
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/network/netavark')
-rw-r--r-- | libpod/network/netavark/run_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libpod/network/netavark/run_test.go b/libpod/network/netavark/run_test.go index e44828496..3279203cc 100644 --- a/libpod/network/netavark/run_test.go +++ b/libpod/network/netavark/run_test.go @@ -619,6 +619,37 @@ var _ = Describe("run netavark", func() { Expect(err).To(HaveOccurred()) }) }) + + It("test netavark error", func() { + runTest(func() { + intName := "eth0" + err := netNSContainer.Do(func(_ ns.NetNS) error { + defer GinkgoRecover() + + attr := netlink.NewLinkAttrs() + attr.Name = "eth0" + err := netlink.LinkAdd(&netlink.Bridge{LinkAttrs: attr}) + Expect(err).ToNot(HaveOccurred()) + return nil + }) + Expect(err).ToNot(HaveOccurred()) + defNet := types.DefaultNetworkName + opts := types.SetupOptions{ + NetworkOptions: types.NetworkOptions{ + ContainerID: "someID", + ContainerName: "someName", + Networks: map[string]types.PerNetworkOptions{ + defNet: { + InterfaceName: intName, + }, + }, + }, + } + _, err = libpodNet.Setup(netNSContainer.Path(), opts) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("interface eth0 already exists on container namespace")) + }) + }) }) func runNetListener(wg *sync.WaitGroup, protocol, ip string, port int, expectedData string) { |