Skip TestBuildNotVerboseFailure if no network
| ... | ... |
@@ -5096,6 +5096,23 @@ func (s *DockerSuite) TestBuildNotVerboseSuccess(c *check.C) {
|
| 5096 | 5096 |
|
| 5097 | 5097 |
} |
| 5098 | 5098 |
|
| 5099 |
+func (s *DockerSuite) TestBuildNotVerboseFailureWithNonExistImage(c *check.C) {
|
|
| 5100 |
+ // This test makes sure that -q works correctly when build fails by |
|
| 5101 |
+ // comparing between the stderr output in quiet mode and in stdout |
|
| 5102 |
+ // and stderr output in verbose mode |
|
| 5103 |
+ testRequires(c, Network) |
|
| 5104 |
+ testName := "quiet_build_not_exists_image" |
|
| 5105 |
+ buildCmd := "FROM busybox11" |
|
| 5106 |
+ _, _, qstderr, qerr := buildImageWithStdoutStderr(testName, buildCmd, false, "-q", "--force-rm", "--rm") |
|
| 5107 |
+ _, vstdout, vstderr, verr := buildImageWithStdoutStderr(testName, buildCmd, false, "--force-rm", "--rm") |
|
| 5108 |
+ if verr == nil || qerr == nil {
|
|
| 5109 |
+ c.Fatal(fmt.Errorf("Test [%s] expected to fail but didn't", testName))
|
|
| 5110 |
+ } |
|
| 5111 |
+ if qstderr != vstdout+vstderr {
|
|
| 5112 |
+ c.Fatal(fmt.Errorf("Test[%s] expected that quiet stderr and verbose stdout are equal; quiet [%v], verbose [%v]", testName, qstderr, vstdout+vstderr))
|
|
| 5113 |
+ } |
|
| 5114 |
+} |
|
| 5115 |
+ |
|
| 5099 | 5116 |
func (s *DockerSuite) TestBuildNotVerboseFailure(c *check.C) {
|
| 5100 | 5117 |
// This test makes sure that -q works correctly when build fails by |
| 5101 | 5118 |
// comparing between the stderr output in quiet mode and in stdout |
| ... | ... |
@@ -5106,7 +5123,6 @@ func (s *DockerSuite) TestBuildNotVerboseFailure(c *check.C) {
|
| 5106 | 5106 |
}{
|
| 5107 | 5107 |
{"quiet_build_no_from_at_the_beginning", "RUN whoami"},
|
| 5108 | 5108 |
{"quiet_build_unknown_instr", "FROMD busybox"},
|
| 5109 |
- {"quiet_build_not_exists_image", "FROM busybox11"},
|
|
| 5110 | 5109 |
} |
| 5111 | 5110 |
|
| 5112 | 5111 |
for _, te := range tt {
|