Browse code

Fix failing deployment hook fixture

Use a more stable and predictable command to exercise failing pre-hooks
with retries. The former command assumed specific Docker 1.10 behavior
whereby missing commands produced error messages in the container output
stream, an assumption which no longer holds true in Docker 1.12.

The fixture and test assertions should now be portable across Docker
versions.

Fixes https://github.com/openshift/origin/issues/11630

Dan Mace authored on 2016/10/28 06:08:22
Showing 2 changed files
... ...
@@ -584,7 +584,7 @@ var _ = g.Describe("deploymentconfigs", func() {
584 584
 
585 585
 			g.By(fmt.Sprintf("checking the logs for substrings\n%s", out))
586 586
 			o.Expect(out).To(o.ContainSubstring("--> pre: Running hook pod ..."))
587
-			o.Expect(out).To(o.ContainSubstring("no such file or directory"))
587
+			o.Expect(out).To(o.ContainSubstring("pre hook logs"))
588 588
 			o.Expect(out).To(o.ContainSubstring("--> pre: Retrying hook pod (retry #1)"))
589 589
 		})
590 590
 	})
... ...
@@ -14,7 +14,9 @@ spec:
14 14
         execNewPod:
15 15
           containerName: myapp
16 16
           command:
17
-          - /bin/echo `date`; /bin/true
17
+          - /bin/bash
18
+          - -c
19
+          - '/bin/echo pre hook logs ; exit 1'
18 20
   template:
19 21
     metadata:
20 22
       labels: