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

devmapper: rename Create() to OnCreate(), cleanup tests

This commit is contained in:
Solomon Hykes 2013-11-01 19:30:30 +00:00
parent d64df7c765
commit d2c2c2c116
2 changed files with 5 additions and 5 deletions

View file

@ -44,7 +44,7 @@ func (b *DMBackend) Cleanup() error {
return b.DeviceSet.Shutdown()
}
func (b *DMBackend) Create(img Image, layer archive.Archive) error {
func (b *DMBackend) OnCreate(img Image, layer archive.Archive) error {
// Determine the source of the snapshot (parent id or init device)
var parentID string
if parent, err := img.Parent(); err != nil {

View file

@ -2,7 +2,7 @@ package devmapper
import (
"io/ioutil"
_ "os"
"os"
"testing"
)
@ -42,7 +42,7 @@ func mkTestDirectory(t *testing.T) string {
func TestInit(t *testing.T) {
home := mkTestDirectory(t)
// defer os.RemoveAll(home)
defer os.RemoveAll(home)
plugin, err := Init(home)
if err != nil {
t.Fatal(err)
@ -54,8 +54,8 @@ func TestInit(t *testing.T) {
}
}()
img := mkTestImage(t)
// defer os.RemoveAll(img.(*TestImage).path)
if err := plugin.Create(img, nil); err != nil {
defer os.RemoveAll(img.(*TestImage).path)
if err := plugin.OnCreate(img, nil); err != nil {
t.Fatal(err)
}
}