Merge pull request #575 from dmcgowan/snapshot-test-checks
Update basic snapshotter test
This commit is contained in:
commit
9743a1531d
1 changed files with 12 additions and 2 deletions
|
@ -296,7 +296,8 @@ func checkSnapshotterBasic(t *testing.T, snapshotter Snapshotter, work string) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, si.Parent, "")
|
assert.Equal(t, "", si.Parent)
|
||||||
|
assert.Equal(t, KindCommitted, si.Kind)
|
||||||
|
|
||||||
next := filepath.Join(work, "nextlayer")
|
next := filepath.Join(work, "nextlayer")
|
||||||
if err := os.MkdirAll(next, 0777); err != nil {
|
if err := os.MkdirAll(next, 0777); err != nil {
|
||||||
|
@ -325,6 +326,14 @@ func checkSnapshotterBasic(t *testing.T, snapshotter Snapshotter, work string) {
|
||||||
t.Log(err)
|
t.Log(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ni, err := snapshotter.Stat(ctx, next)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.Equal(t, committed, ni.Parent)
|
||||||
|
assert.Equal(t, KindActive, ni.Kind)
|
||||||
|
|
||||||
nextCommitted := filepath.Join(work, "committed-next")
|
nextCommitted := filepath.Join(work, "committed-next")
|
||||||
if err := snapshotter.Commit(ctx, nextCommitted, next); err != nil {
|
if err := snapshotter.Commit(ctx, nextCommitted, next); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
@ -335,7 +344,8 @@ func checkSnapshotterBasic(t *testing.T, snapshotter Snapshotter, work string) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, si2.Parent, committed)
|
assert.Equal(t, committed, si2.Parent)
|
||||||
|
assert.Equal(t, KindCommitted, si2.Kind)
|
||||||
|
|
||||||
expected := map[string]Info{
|
expected := map[string]Info{
|
||||||
si.Name: si,
|
si.Name: si,
|
||||||
|
|
Loading…
Reference in a new issue