mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 21:21:42 +00:00
Fixing statusCode checks for sockRequest
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
This commit is contained in:
@@ -350,9 +350,6 @@ func sockRequestRaw(method, endpoint string, data io.Reader, ct string) (int, io
|
||||
defer client.Close()
|
||||
return resp.Body.Close()
|
||||
})
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return resp.StatusCode, body, fmt.Errorf("received status != 200 OK: %s", resp.Status)
|
||||
}
|
||||
|
||||
return resp.StatusCode, body, err
|
||||
}
|
||||
@@ -1062,10 +1059,9 @@ func daemonTime(c *check.C) time.Time {
|
||||
return time.Now()
|
||||
}
|
||||
|
||||
_, body, err := sockRequest("GET", "/info", nil)
|
||||
if err != nil {
|
||||
c.Fatalf("daemonTime: failed to get /info: %v", err)
|
||||
}
|
||||
status, body, err := sockRequest("GET", "/info", nil)
|
||||
c.Assert(status, check.Equals, http.StatusOK)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
type infoJSON struct {
|
||||
SystemTime string
|
||||
|
||||
Reference in New Issue
Block a user