summaryrefslogtreecommitdiff
path: root/test/e2e/run_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/run_test.go')
-rw-r--r--test/e2e/run_test.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 4e5106731..bb1f9590d 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -1412,7 +1412,28 @@ USER mail`
})
It("podman run --tz", func() {
- session := podmanTest.Podman([]string{"run", "--tz", "foo", "--rm", ALPINE, "date"})
+ testDir := filepath.Join(podmanTest.RunRoot, "tz-test")
+ err := os.MkdirAll(testDir, 0755)
+ Expect(err).To(BeNil())
+
+ tzFile := filepath.Join(testDir, "tzfile.txt")
+ file, err := os.Create(tzFile)
+ Expect(err).To(BeNil())
+
+ _, err = file.WriteString("Hello")
+ Expect(err).To(BeNil())
+ file.Close()
+
+ badTZFile := fmt.Sprintf("../../../%s", tzFile)
+ session := podmanTest.Podman([]string{"run", "--tz", badTZFile, "--rm", ALPINE, "date"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ Expect(session.ErrorToString()).To(ContainSubstring("error finding timezone for container"))
+
+ err = os.Remove(tzFile)
+ Expect(err).To(BeNil())
+
+ session = podmanTest.Podman([]string{"run", "--tz", "foo", "--rm", ALPINE, "date"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Not(Equal(0)))