summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-18 15:42:06 -0500
committerGitHub <noreply@github.com>2022-01-18 15:42:06 -0500
commit094b11cbcb528a7d120c31402a1bcd9c82d84938 (patch)
tree3ce00f13dda775d979a093658f26cea4122646d9 /test
parent62212dbf490d736ad06523a92345a480e4972dab (diff)
parentc0e07234631cfcea1d6724c05606964a4d833f39 (diff)
downloadpodman-094b11cbcb528a7d120c31402a1bcd9c82d84938.tar.gz
podman-094b11cbcb528a7d120c31402a1bcd9c82d84938.tar.bz2
podman-094b11cbcb528a7d120c31402a1bcd9c82d84938.zip
Merge pull request #12908 from Luap99/network-conf-dir
rename --cni-config-dir to --network-config-dir
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/python/rest_api/fixtures/podman.py2
-rwxr-xr-xtest/compose/test-compose4
-rw-r--r--test/e2e/common_test.go2
-rw-r--r--test/e2e/libpod_suite_remote_test.go2
-rw-r--r--test/e2e/network_test.go20
-rw-r--r--test/python/docker/__init__.py2
6 files changed, 26 insertions, 6 deletions
diff --git a/test/apiv2/python/rest_api/fixtures/podman.py b/test/apiv2/python/rest_api/fixtures/podman.py
index bae04f87d..c700571b9 100644
--- a/test/apiv2/python/rest_api/fixtures/podman.py
+++ b/test/apiv2/python/rest_api/fixtures/podman.py
@@ -44,7 +44,7 @@ class Podman:
os.environ["CNI_CONFIG_PATH"] = os.path.join(self.anchor_directory, "cni", "net.d")
os.makedirs(os.environ["CNI_CONFIG_PATH"], exist_ok=True)
- self.cmd.append("--cni-config-dir=" + os.environ["CNI_CONFIG_PATH"])
+ self.cmd.append("--network-config-dir=" + os.environ["CNI_CONFIG_PATH"])
cni_cfg = os.path.join(os.environ["CNI_CONFIG_PATH"], "87-podman-bridge.conflist")
# json decoded and encoded to ensure legal json
buf = json.loads(
diff --git a/test/compose/test-compose b/test/compose/test-compose
index beaf276fd..7c4bf2e91 100755
--- a/test/compose/test-compose
+++ b/test/compose/test-compose
@@ -220,7 +220,7 @@ function start_service() {
--root $WORKDIR/root \
--runroot $WORKDIR/runroot \
--cgroup-manager=systemd \
- --cni-config-dir $WORKDIR/cni \
+ --network-config-dir $WORKDIR/cni \
system service \
--time 0 unix://$DOCKER_SOCK \
&> $WORKDIR/server.log &
@@ -247,7 +247,7 @@ function podman() {
--storage-driver=vfs \
--root $WORKDIR/root \
--runroot $WORKDIR/runroot \
- --cni-config-dir $WORKDIR/cni \
+ --network-config-dir $WORKDIR/cni \
"$@")
echo -n "$output" >>$WORKDIR/output.log
}
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)
diff --git a/test/python/docker/__init__.py b/test/python/docker/__init__.py
index f75185192..80fc2a133 100644
--- a/test/python/docker/__init__.py
+++ b/test/python/docker/__init__.py
@@ -57,7 +57,7 @@ class Podman(object):
self.anchor_directory, "cni", "net.d"
)
os.makedirs(os.environ["CNI_CONFIG_PATH"], exist_ok=True)
- self.cmd.append("--cni-config-dir=" + os.environ["CNI_CONFIG_PATH"])
+ self.cmd.append("--network-config-dir=" + os.environ["CNI_CONFIG_PATH"])
cni_cfg = os.path.join(
os.environ["CNI_CONFIG_PATH"], "87-podman-bridge.conflist"
)