diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/build_test.go | 11 | ||||
-rw-r--r-- | test/e2e/commit_test.go | 6 | ||||
-rw-r--r-- | test/e2e/pod_create_test.go | 6 | ||||
-rw-r--r-- | test/e2e/trust_test.go | 9 |
4 files changed, 22 insertions, 10 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 1046ffcea..9fd82e149 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -127,8 +127,10 @@ var _ = Describe("Podman build", func() { defer Expect(os.Chdir(cwd)).To(BeNil()) // Write target and fake files - targetPath := filepath.Join(os.TempDir(), "dir") - Expect(os.MkdirAll(targetPath, 0755)).To(BeNil()) + targetPath, err := CreateTempDirInTempDir() + if err != nil { + os.Exit(1) + } fakeFile := filepath.Join(os.TempDir(), "Containerfile") Expect(ioutil.WriteFile(fakeFile, []byte("FROM alpine"), 0755)).To(BeNil()) @@ -162,7 +164,10 @@ var _ = Describe("Podman build", func() { Expect(os.Chdir(os.TempDir())).To(BeNil()) defer Expect(os.Chdir(cwd)).To(BeNil()) - targetPath := filepath.Join(os.TempDir(), "dir") + targetPath, err := CreateTempDirInTempDir() + if err != nil { + os.Exit(1) + } targetFile := filepath.Join(targetPath, "idFile") session := podmanTest.PodmanNoCache([]string{"build", "build/basicalpine", "--iidfile", targetFile}) diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go index c122ce50f..c1a213c00 100644 --- a/test/e2e/commit_test.go +++ b/test/e2e/commit_test.go @@ -257,8 +257,10 @@ var _ = Describe("Podman commit", func() { cwd, err := os.Getwd() Expect(err).To(BeNil()) Expect(os.Chdir(os.TempDir())).To(BeNil()) - targetPath := filepath.Join(os.TempDir(), "dir") - Expect(os.MkdirAll(targetPath, 0755)).To(BeNil()) + targetPath, err := CreateTempDirInTempDir() + if err != nil { + os.Exit(1) + } targetFile := filepath.Join(targetPath, "idFile") defer Expect(os.RemoveAll(targetFile)).To(BeNil()) defer Expect(os.Chdir(cwd)).To(BeNil()) diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go index 5c9b41c62..f260a123a 100644 --- a/test/e2e/pod_create_test.go +++ b/test/e2e/pod_create_test.go @@ -296,8 +296,10 @@ var _ = Describe("Podman pod create", func() { cwd, err := os.Getwd() Expect(err).To(BeNil()) Expect(os.Chdir(os.TempDir())).To(BeNil()) - targetPath := filepath.Join(os.TempDir(), "dir") - Expect(os.MkdirAll(targetPath, 0755)).To(BeNil()) + targetPath, err := CreateTempDirInTempDir() + if err != nil { + os.Exit(1) + } targetFile := filepath.Join(targetPath, "idFile") defer Expect(os.RemoveAll(targetFile)).To(BeNil()) defer Expect(os.Chdir(cwd)).To(BeNil()) diff --git a/test/e2e/trust_test.go b/test/e2e/trust_test.go index ecdf27a2e..82b0f9f26 100644 --- a/test/e2e/trust_test.go +++ b/test/e2e/trust_test.go @@ -47,9 +47,12 @@ var _ = Describe("Podman trust", func() { Expect(session.ExitCode()).To(Equal(0)) outArray := session.OutputToStringArray() Expect(len(outArray)).To(Equal(3)) - Expect(outArray[0]).Should(ContainSubstring("accept")) - Expect(outArray[1]).Should(ContainSubstring("reject")) - Expect(outArray[2]).Should(ContainSubstring("signed")) + + // image order is not guaranteed. All we can do is check that + // these strings appear in output, we can't cross-check them. + Expect(session.OutputToString()).To(ContainSubstring("accept")) + Expect(session.OutputToString()).To(ContainSubstring("reject")) + Expect(session.OutputToString()).To(ContainSubstring("signed")) }) It("podman image trust set", func() { |