btrfs: test btrfs snapshots with driver suite
We now include btrfs in the snapshot driver test suite. This includes the addition of parent links and name hashing into the btrfs driver. We'll probably endup replacing this with a common metadata store, as these relationships are generally identical between implementations. A small bug was discovered in the delete implementation in the course testing, so the btrfs package has been updated with a fix. The overlay driver was modified accordingly with the btrfs driver to use `Driver` as the exported type of each driver packge. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
127882fca7
commit
aeffd4f92c
7 changed files with 276 additions and 71 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/docker/containerd"
|
||||
"github.com/docker/containerd/testutil"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
// Driver defines the methods required to implement a snapshot driver for
|
||||
|
@ -258,9 +259,7 @@ func checkDriverBasic(t *testing.T, driver Driver, work string) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if parent != "" {
|
||||
t.Fatalf("parent of new layer should be empty, got driver.Parent(%q) == %q", committed, parent)
|
||||
}
|
||||
assert.Equal(t, parent, "")
|
||||
|
||||
next := filepath.Join(work, "nextlayer")
|
||||
if err := os.MkdirAll(next, 0777); err != nil {
|
||||
|
@ -295,7 +294,9 @@ func checkDriverBasic(t *testing.T, driver Driver, work string) {
|
|||
}
|
||||
|
||||
parent, err = driver.Parent(nextCommitted)
|
||||
if parent != committed {
|
||||
t.Fatalf("parent of new layer should be %q, got driver.Parent(%q) == %q", committed, next, parent)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, parent, committed)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue