2017-03-16 06:20:04 +00:00
|
|
|
package boltdb
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/docker/containerd/snapshot/storage"
|
|
|
|
"github.com/docker/containerd/snapshot/storage/testsuite"
|
2017-03-16 22:06:15 +00:00
|
|
|
|
|
|
|
// Does not require root but flag must be defined for snapshot tests
|
|
|
|
_ "github.com/docker/containerd/testutil"
|
2017-03-16 06:20:04 +00:00
|
|
|
)
|
|
|
|
|
2017-03-22 06:16:39 +00:00
|
|
|
func TestBoltDB(t *testing.T) {
|
|
|
|
testsuite.MetaStoreSuite(t, "BoltDB", func(ctx context.Context, root string) (storage.MetaStore, error) {
|
|
|
|
return NewMetaStore(ctx, filepath.Join(root, "metadata.db"))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2017-03-16 06:20:04 +00:00
|
|
|
func BenchmarkSuite(b *testing.B) {
|
2017-03-22 06:16:39 +00:00
|
|
|
testsuite.Benchmarks(b, "BoltDBBench", func(ctx context.Context, root string) (storage.MetaStore, error) {
|
2017-03-16 06:20:04 +00:00
|
|
|
return NewMetaStore(ctx, filepath.Join(root, "metadata.db"))
|
|
|
|
})
|
|
|
|
}
|