Working in memory donut driver

This commit is contained in:
Frederick F. Kautz IV
2015-03-15 00:41:06 -07:00
parent 15d5e74837
commit 3e453a394a
5 changed files with 193 additions and 20 deletions

View File

@@ -29,10 +29,11 @@ type StorageDriver struct {
}
// Start a single disk subsystem
func Start() (chan<- string, <-chan error, storage.Storage) {
func Start(donutBox donutbox.DonutBox) (chan<- string, <-chan error, storage.Storage) {
ctrlChannel := make(chan string)
errorChannel := make(chan error)
s := new(StorageDriver)
s.donutBox = donutBox
go start(ctrlChannel, errorChannel, s)
return ctrlChannel, errorChannel, s
}

View File

@@ -23,6 +23,7 @@ import (
mstorage "github.com/minio-io/minio/pkg/storage"
"github.com/minio-io/minio/pkg/donutbox/donutmem"
. "gopkg.in/check.v1"
)
@@ -33,13 +34,13 @@ type MySuite struct{}
var _ = Suite(&MySuite{})
func (s *MySuite) TestAPISuite(c *C) {
c.Skip("Not implemented yet.")
//c.Skip("Not implemented yet.")
var storageList []string
create := func() mstorage.Storage {
path, err := ioutil.TempDir(os.TempDir(), "minio-fs-")
c.Check(err, IsNil)
storageList = append(storageList, path)
_, _, store := Start() // TODO Make InMemory driver
_, _, store := Start(donutmem.NewDonutMem()) // TODO Make InMemory driver
return store
}
mstorage.APITestSuite(c, create)