aboutsummaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-15 13:15:03 -0400
committerGitHub <noreply@github.com>2021-09-15 13:15:03 -0400
commitf9d8301c476fcd8498930c518f04920e9e8eeac5 (patch)
treeae020d660f63b6d41c016a4ca91ecd577a5c569d /test/e2e
parentc0cde378298bd8d5183155c8f62aae574be069eb (diff)
parent3e77f960f65687dcb1d571ebe70278028c6de441 (diff)
downloadpodman-f9d8301c476fcd8498930c518f04920e9e8eeac5.tar.gz
podman-f9d8301c476fcd8498930c518f04920e9e8eeac5.tar.bz2
podman-f9d8301c476fcd8498930c518f04920e9e8eeac5.zip
Merge pull request #11577 from rhatdan/tmpdir
Set default storage from containers.conf for temporary images
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/containers_conf_test.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go
index 08fc4e6cc..f5e85e723 100644
--- a/test/e2e/containers_conf_test.go
+++ b/test/e2e/containers_conf_test.go
@@ -397,4 +397,51 @@ var _ = Describe("Podman run", func() {
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(Equal(profile))
})
+
+ It("podman info image_copy_tmp_dir", func() {
+ session := podmanTest.Podman([]string{"info", "--format", "{{.Store.ImageCopyTmpDir}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(Equal("/var/tmp"))
+
+ configPath := filepath.Join(podmanTest.TempDir, "containers.conf")
+ os.Setenv("CONTAINERS_CONF", configPath)
+
+ containersConf := []byte(fmt.Sprintf("[engine]\nimage_copy_tmp_dir=\"/foobar\""))
+ err = ioutil.WriteFile(configPath, containersConf, os.ModePerm)
+ Expect(err).To(BeNil())
+
+ if IsRemote() {
+ podmanTest.RestartRemoteService()
+ }
+
+ session = podmanTest.Podman([]string{"info", "--format", "{{.Store.ImageCopyTmpDir}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(Equal("/foobar"))
+
+ containersConf = []byte(fmt.Sprintf("[engine]\nimage_copy_tmp_dir=\"storage\""))
+ err = ioutil.WriteFile(configPath, containersConf, os.ModePerm)
+ Expect(err).To(BeNil())
+ if IsRemote() {
+ podmanTest.RestartRemoteService()
+ }
+
+ session = podmanTest.Podman([]string{"info", "--format", "{{.Store.ImageCopyTmpDir}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.LineInOutputContains("containers/storage/tmp")).To(BeTrue())
+
+ containersConf = []byte(fmt.Sprintf("[engine]\nimage_copy_tmp_dir=\"storage1\""))
+ err = ioutil.WriteFile(configPath, containersConf, os.ModePerm)
+ Expect(err).To(BeNil())
+ if IsRemote() {
+ podmanTest.RestartRemoteService()
+ }
+
+ session = podmanTest.Podman([]string{"info", "--format", "{{.Store.ImageCopyTmpDir}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.ErrorToString()).To(ContainSubstring("invalid image_copy_tmp_dir"))
+ })
})