2015-06-09 02:46:18 +00:00
|
|
|
// +build include_rados
|
|
|
|
|
2015-04-23 16:13:52 +00:00
|
|
|
package rados
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
storagedriver "github.com/docker/distribution/registry/storage/driver"
|
|
|
|
"github.com/docker/distribution/registry/storage/driver/testsuites"
|
|
|
|
|
|
|
|
"gopkg.in/check.v1"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Hook up gocheck into the "go test" runner.
|
|
|
|
func Test(t *testing.T) { check.TestingT(t) }
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
poolname := os.Getenv("RADOS_POOL")
|
|
|
|
username := os.Getenv("RADOS_USER")
|
|
|
|
|
|
|
|
driverConstructor := func() (storagedriver.StorageDriver, error) {
|
|
|
|
parameters := DriverParameters{
|
|
|
|
poolname,
|
|
|
|
username,
|
|
|
|
defaultChunkSize,
|
|
|
|
}
|
|
|
|
|
|
|
|
return New(parameters)
|
|
|
|
}
|
|
|
|
|
|
|
|
skipCheck := func() string {
|
|
|
|
if poolname == "" {
|
|
|
|
return "RADOS_POOL must be set to run Rado tests"
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2015-06-29 23:39:45 +00:00
|
|
|
testsuites.RegisterSuite(driverConstructor, skipCheck)
|
2015-04-23 16:13:52 +00:00
|
|
|
}
|