1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Use checker assert for integration-cli/docker_cli_external_graphdriver_unix_test.go

Signed-off-by: Federico Gimenez <fgimenez@coit.es>
This commit is contained in:
Federico Gimenez 2015-10-25 10:41:41 +01:00
parent c10ef20ed8
commit 7058ec278d

View file

@ -102,9 +102,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) {
base, err := ioutil.TempDir("", "external-graph-test")
c.Assert(err, check.IsNil)
vfsProto, err := vfs.Init(base, []string{}, nil, nil)
if err != nil {
c.Fatalf("error initializing graph driver: %v", err)
}
c.Assert(err, check.IsNil, check.Commentf("error initializing graph driver"))
driver := graphdriver.NewNaiveDiffDriver(vfsProto, nil, nil)
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
@ -285,21 +283,18 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) {
respond(w, &graphDriverResponse{Size: size})
})
if err := os.MkdirAll("/etc/docker/plugins", 0755); err != nil {
c.Fatal(err)
}
err = os.MkdirAll("/etc/docker/plugins", 0755)
c.Assert(err, check.IsNil, check.Commentf("error creating /etc/docker/plugins"))
if err := ioutil.WriteFile("/etc/docker/plugins/test-external-graph-driver.spec", []byte(s.server.URL), 0644); err != nil {
c.Fatal(err)
}
err = ioutil.WriteFile("/etc/docker/plugins/test-external-graph-driver.spec", []byte(s.server.URL), 0644)
c.Assert(err, check.IsNil, check.Commentf("error writing to /etc/docker/plugins/test-external-graph-driver.spec"))
}
func (s *DockerExternalGraphdriverSuite) TearDownSuite(c *check.C) {
s.server.Close()
if err := os.RemoveAll("/etc/docker/plugins"); err != nil {
c.Fatal(err)
}
err := os.RemoveAll("/etc/docker/plugins")
c.Assert(err, check.IsNil, check.Commentf("error removing /etc/docker/plugins"))
}
func (s *DockerExternalGraphdriverSuite) TestExternalGraphDriver(c *check.C) {