diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-11 00:25:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-11 00:25:09 +0100 |
commit | ed9ef59e7ea439b670875863132b68fd094501c7 (patch) | |
tree | 02ef3d057b928b7903954a54dc7ba0f7ab466763 /test/e2e | |
parent | 2790b5c69c729df7ba83b214800de387fd43c646 (diff) | |
parent | 19a475906612b603b11fbbf6ee6a6978a4bd9586 (diff) | |
download | podman-ed9ef59e7ea439b670875863132b68fd094501c7.tar.gz podman-ed9ef59e7ea439b670875863132b68fd094501c7.tar.bz2 podman-ed9ef59e7ea439b670875863132b68fd094501c7.zip |
Merge pull request #12780 from rhatdan/pod
Use the InfraImage defined in containers.conf
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/containers_conf_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go index 2a6f177f2..838221dd5 100644 --- a/test/e2e/containers_conf_test.go +++ b/test/e2e/containers_conf_test.go @@ -452,4 +452,36 @@ var _ = Describe("Podman run", func() { Expect(result).Should(Exit(0)) Expect(result.OutputToString()).To(ContainSubstring("(default 1234)")) }) + + It("podman bad infra_image name in containers.conf", func() { + infra1 := "i.do/not/exist:image" + infra2 := "i.still.do/not/exist:image" + errorString := "initializing source docker://" + infra1 + error2String := "initializing source docker://" + infra2 + configPath := filepath.Join(podmanTest.TempDir, "containers.conf") + os.Setenv("CONTAINERS_CONF", configPath) + + containersConf := []byte("[engine]\ninfra_image=\"" + infra1 + "\"") + err = ioutil.WriteFile(configPath, containersConf, os.ModePerm) + Expect(err).To(BeNil()) + + if IsRemote() { + podmanTest.RestartRemoteService() + } + + result := podmanTest.Podman([]string{"pod", "create", "--infra-image", infra2}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(125)) + Expect(result.ErrorToString()).To(ContainSubstring(error2String)) + + result = podmanTest.Podman([]string{"pod", "create"}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(125)) + Expect(result.ErrorToString()).To(ContainSubstring(errorString)) + + result = podmanTest.Podman([]string{"create", "--pod", "new:pod1", ALPINE}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(125)) + Expect(result.ErrorToString()).To(ContainSubstring(errorString)) + }) }) |