From c0e07234631cfcea1d6724c05606964a4d833f39 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 18 Jan 2022 16:17:53 +0100 Subject: rename --cni-config-dir to --network-config-dir Since this option will also be used for netavark we should rename it to something more generic. It is important that --cni-config-dir still works otherwise we could break existing container cleanup commands. Signed-off-by: Paul Holzinger --- test/e2e/common_test.go | 2 +- test/e2e/libpod_suite_remote_test.go | 2 +- test/e2e/network_test.go | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'test/e2e') diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 64f40d2ed..56f050665 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -817,7 +817,7 @@ func (p *PodmanTestIntegration) makeOptions(args []string, noEvents, noCache boo eventsType = "none" } - podmanOptions := strings.Split(fmt.Sprintf("%s--root %s --runroot %s --runtime %s --conmon %s --cni-config-dir %s --cgroup-manager %s --tmpdir %s --events-backend %s", + podmanOptions := strings.Split(fmt.Sprintf("%s--root %s --runroot %s --runtime %s --conmon %s --network-config-dir %s --cgroup-manager %s --tmpdir %s --events-backend %s", debug, p.Root, p.RunRoot, p.OCIRuntime, p.ConmonBinary, p.CNIConfigDir, p.CgroupManager, p.TmpDir, eventsType), " ") if os.Getenv("HOOK_OPTION") != "" { podmanOptions = append(podmanOptions, os.Getenv("HOOK_OPTION")) diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go index 37381a561..4c5e9955f 100644 --- a/test/e2e/libpod_suite_remote_test.go +++ b/test/e2e/libpod_suite_remote_test.go @@ -153,7 +153,7 @@ func (p *PodmanTestIntegration) StopRemoteService() { // MakeOptions assembles all the podman main options func getRemoteOptions(p *PodmanTestIntegration, args []string) []string { - podmanOptions := strings.Split(fmt.Sprintf("--root %s --runroot %s --runtime %s --conmon %s --cni-config-dir %s --cgroup-manager %s", + podmanOptions := strings.Split(fmt.Sprintf("--root %s --runroot %s --runtime %s --conmon %s --network-config-dir %s --cgroup-manager %s", p.Root, p.RunRoot, p.OCIRuntime, p.ConmonBinary, p.CNIConfigDir, p.CgroupManager), " ") if os.Getenv("HOOK_OPTION") != "" { podmanOptions = append(podmanOptions, os.Getenv("HOOK_OPTION")) diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go index 877ad37b8..70793fc32 100644 --- a/test/e2e/network_test.go +++ b/test/e2e/network_test.go @@ -38,6 +38,26 @@ var _ = Describe("Podman network", func() { }) + It("podman --cni-config-dir backwards compat", func() { + SkipIfRemote("--cni-config-dir only works locally") + netDir, err := CreateTempDirInTempDir() + Expect(err).ToNot(HaveOccurred()) + defer os.RemoveAll(netDir) + session := podmanTest.Podman([]string{"--cni-config-dir", netDir, "network", "ls", "--noheading"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + // default network always exists + Expect(session.OutputToStringArray()).To(HaveLen(1)) + + // check that the only file in the directory is the network lockfile + dir, err := os.Open(netDir) + Expect(err).ToNot(HaveOccurred()) + names, err := dir.Readdirnames(5) + Expect(err).ToNot(HaveOccurred()) + Expect(names).To(HaveLen(1)) + Expect(names[0]).To(Or(Equal("netavark.lock"), Equal("cni.lock"))) + }) + It("podman network list", func() { name, path := generateNetworkConfig(podmanTest) defer removeConf(path) -- cgit v1.2.3-54-g00ecf