TestBuildNotVerboseFailure use a non-exist image busybox1,
it requires network connection to access to Dockerhub, skip
this test if there is no network.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
| ... | ... |
@@ -4879,6 +4879,23 @@ func (s *DockerSuite) TestBuildNotVerboseSuccess(c *check.C) {
|
| 4879 | 4879 |
|
| 4880 | 4880 |
} |
| 4881 | 4881 |
|
| 4882 |
+func (s *DockerSuite) TestBuildNotVerboseFailureWithNonExistImage(c *check.C) {
|
|
| 4883 |
+ // This test makes sure that -q works correctly when build fails by |
|
| 4884 |
+ // comparing between the stderr output in quiet mode and in stdout |
|
| 4885 |
+ // and stderr output in verbose mode |
|
| 4886 |
+ testRequires(c, Network) |
|
| 4887 |
+ testName := "quiet_build_not_exists_image" |
|
| 4888 |
+ buildCmd := "FROM busybox11" |
|
| 4889 |
+ _, _, qstderr, qerr := buildImageWithStdoutStderr(testName, buildCmd, false, "-q", "--force-rm", "--rm") |
|
| 4890 |
+ _, vstdout, vstderr, verr := buildImageWithStdoutStderr(testName, buildCmd, false, "--force-rm", "--rm") |
|
| 4891 |
+ if verr == nil || qerr == nil {
|
|
| 4892 |
+ c.Fatal(fmt.Errorf("Test [%s] expected to fail but didn't", testName))
|
|
| 4893 |
+ } |
|
| 4894 |
+ if qstderr != vstdout+vstderr {
|
|
| 4895 |
+ c.Fatal(fmt.Errorf("Test[%s] expected that quiet stderr and verbose stdout are equal; quiet [%v], verbose [%v]", testName, qstderr, vstdout+vstderr))
|
|
| 4896 |
+ } |
|
| 4897 |
+} |
|
| 4898 |
+ |
|
| 4882 | 4899 |
func (s *DockerSuite) TestBuildNotVerboseFailure(c *check.C) {
|
| 4883 | 4900 |
// This test makes sure that -q works correctly when build fails by |
| 4884 | 4901 |
// comparing between the stderr output in quiet mode and in stdout |
| ... | ... |
@@ -4889,7 +4906,6 @@ func (s *DockerSuite) TestBuildNotVerboseFailure(c *check.C) {
|
| 4889 | 4889 |
}{
|
| 4890 | 4890 |
{"quiet_build_no_from_at_the_beginning", "RUN whoami"},
|
| 4891 | 4891 |
{"quiet_build_unknown_instr", "FROMD busybox"},
|
| 4892 |
- {"quiet_build_not_exists_image", "FROM busybox11"},
|
|
| 4893 | 4892 |
} |
| 4894 | 4893 |
|
| 4895 | 4894 |
for _, te := range tt {
|