Add content test suite run to client
Fix bugs in content deletion and upload status Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
@@ -11,21 +11,23 @@ import (
|
||||
"github.com/containerd/containerd/content/testsuite"
|
||||
)
|
||||
|
||||
func TestContent(t *testing.T) {
|
||||
testsuite.ContentSuite(t, "metadata", func(ctx context.Context, root string) (content.Store, func(), error) {
|
||||
// TODO: Use mocked or in-memory store
|
||||
cs, err := local.NewStore(root)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
func createContentStore(ctx context.Context, root string) (content.Store, func() error, error) {
|
||||
// TODO: Use mocked or in-memory store
|
||||
cs, err := local.NewStore(root)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
db, err := bolt.Open(filepath.Join(root, "metadata.db"), 0660, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
db, err := bolt.Open(filepath.Join(root, "metadata.db"), 0660, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
return NewContentStore(db, cs), func() {
|
||||
db.Close()
|
||||
}, nil
|
||||
})
|
||||
return NewContentStore(db, cs), func() error {
|
||||
return db.Close()
|
||||
}, nil
|
||||
}
|
||||
|
||||
func TestContent(t *testing.T) {
|
||||
testsuite.ContentSuite(t, "metadata", createContentStore)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user