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:
parent
d64df7c765
commit
d2c2c2c116
2 changed files with 5 additions and 5 deletions
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue