summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-23 12:52:22 -0700
committerGitHub <noreply@github.com>2021-03-23 12:52:22 -0700
commit9982923276f35fa05f259c934c6406fbce3e1dd4 (patch)
treeddec16a1db2a7f2c57f636bc2957430b9faaf70b /test
parentae1529ca191d4ab4d010703729c0ff656cc44276 (diff)
parent5b2e71dc5b939378303daecab708c4042ee3677d (diff)
downloadpodman-9982923276f35fa05f259c934c6406fbce3e1dd4.tar.gz
podman-9982923276f35fa05f259c934c6406fbce3e1dd4.tar.bz2
podman-9982923276f35fa05f259c934c6406fbce3e1dd4.zip
Merge pull request #9537 from TomSweeneyRedHat/dev/tsweeney/tz_check
Validate passed in timezone from tz option
Diffstat (limited to 'test')
-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)))