Applying #16756 to integration-cli/docker_api_inspect_unix_test.go
Signed-off-by: Aditi Rajagopal <arajagopal@us.ibm.com>
| ... | ... |
@@ -7,6 +7,7 @@ import ( |
| 7 | 7 |
"fmt" |
| 8 | 8 |
"net/http" |
| 9 | 9 |
|
| 10 |
+ "github.com/docker/docker/pkg/integration/checker" |
|
| 10 | 11 |
"github.com/go-check/check" |
| 11 | 12 |
) |
| 12 | 13 |
|
| ... | ... |
@@ -23,16 +24,12 @@ func (s *DockerSuite) TestInspectApiCpusetInConfigPre120(c *check.C) {
|
| 23 | 23 |
c.Assert(err, check.IsNil) |
| 24 | 24 |
|
| 25 | 25 |
var inspectJSON map[string]interface{}
|
| 26 |
- if err = json.Unmarshal(body, &inspectJSON); err != nil {
|
|
| 27 |
- c.Fatalf("unable to unmarshal body for version 1.19: %v", err)
|
|
| 28 |
- } |
|
| 26 |
+ err = json.Unmarshal(body, &inspectJSON) |
|
| 27 |
+ c.Assert(err, checker.IsNil, check.Commentf("unable to unmarshal body for version 1.19"))
|
|
| 29 | 28 |
|
| 30 | 29 |
config, ok := inspectJSON["Config"] |
| 31 |
- if !ok {
|
|
| 32 |
- c.Fatal("Unable to find 'Config'")
|
|
| 33 |
- } |
|
| 30 |
+ c.Assert(ok, checker.True, check.Commentf("Unable to find 'Config'"))
|
|
| 34 | 31 |
cfg := config.(map[string]interface{})
|
| 35 |
- if _, ok := cfg["Cpuset"]; !ok {
|
|
| 36 |
- c.Fatal("Api version 1.19 expected to include Cpuset in 'Config'")
|
|
| 37 |
- } |
|
| 32 |
+ _, ok = cfg["Cpuset"] |
|
| 33 |
+ c.Assert(ok, checker.True, check.Commentf("Api version 1.19 expected to include Cpuset in 'Config'"))
|
|
| 38 | 34 |
} |