diff options
Diffstat (limited to 'test/e2e/play_build_test.go')
-rw-r--r-- | test/e2e/play_build_test.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/e2e/play_build_test.go b/test/e2e/play_build_test.go index 564735e07..a56560634 100644 --- a/test/e2e/play_build_test.go +++ b/test/e2e/play_build_test.go @@ -95,6 +95,7 @@ LABEL marge=mom // Setup yamlDir := filepath.Join(tempdir, RandomString(12)) err := os.Mkdir(yamlDir, 0755) + Expect(err).To(BeNil(), "mkdir "+yamlDir) err = writeYaml(testYAML, filepath.Join(yamlDir, "top.yaml")) Expect(err).To(BeNil()) app1Dir := filepath.Join(yamlDir, "foobar") @@ -124,13 +125,14 @@ LABEL marge=mom Expect(inspect).Should(Exit(0)) inspectData := inspect.InspectContainerToJSON() Expect(len(inspectData)).To(BeNumerically(">", 0)) - Expect(inspectData[0].Config.Labels["homer"]).To(Equal("dad")) + Expect(inspectData[0].Config.Labels).To(HaveKeyWithValue("homer", "dad")) }) It("Check that image is built using Containerfile", func() { // Setup yamlDir := filepath.Join(tempdir, RandomString(12)) err := os.Mkdir(yamlDir, 0755) + Expect(err).To(BeNil(), "mkdir "+yamlDir) err = writeYaml(testYAML, filepath.Join(yamlDir, "top.yaml")) Expect(err).To(BeNil()) app1Dir := filepath.Join(yamlDir, "foobar") @@ -160,13 +162,14 @@ LABEL marge=mom Expect(inspect).Should(Exit(0)) inspectData := inspect.InspectContainerToJSON() Expect(len(inspectData)).To(BeNumerically(">", 0)) - Expect(inspectData[0].Config.Labels["homer"]).To(Equal("dad")) + Expect(inspectData[0].Config.Labels).To(HaveKeyWithValue("homer", "dad")) }) It("Do not build image if already in the local store", func() { // Setup yamlDir := filepath.Join(tempdir, RandomString(12)) err := os.Mkdir(yamlDir, 0755) + Expect(err).To(BeNil(), "mkdir "+yamlDir) err = writeYaml(testYAML, filepath.Join(yamlDir, "top.yaml")) Expect(err).To(BeNil()) @@ -205,14 +208,15 @@ LABEL marge=mom Expect(inspect).Should(Exit(0)) inspectData := inspect.InspectContainerToJSON() Expect(len(inspectData)).To(BeNumerically(">", 0)) - Expect(inspectData[0].Config.Labels["homer"]).To(Equal("")) - Expect(inspectData[0].Config.Labels["marge"]).To(Equal("mom")) + Expect(inspectData[0].Config.Labels).To(Not(HaveKey("homer"))) + Expect(inspectData[0].Config.Labels).To(HaveKeyWithValue("marge", "mom")) }) It("--build should override image in store", func() { // Setup yamlDir := filepath.Join(tempdir, RandomString(12)) err := os.Mkdir(yamlDir, 0755) + Expect(err).To(BeNil(), "os.Mkdir "+yamlDir) err = writeYaml(testYAML, filepath.Join(yamlDir, "top.yaml")) Expect(err).To(BeNil()) @@ -251,8 +255,8 @@ LABEL marge=mom Expect(inspect).Should(Exit(0)) inspectData := inspect.InspectContainerToJSON() Expect(len(inspectData)).To(BeNumerically(">", 0)) - Expect(inspectData[0].Config.Labels["homer"]).To(Equal("dad")) - Expect(inspectData[0].Config.Labels["marge"]).To(Equal("")) + Expect(inspectData[0].Config.Labels).To(HaveKeyWithValue("homer", "dad")) + Expect(inspectData[0].Config.Labels).To(Not(HaveKey("marge"))) }) }) |