func getRexRayNoDrivers() (*core.RexRay, error) { c := config.New() c.OSDrivers = []string{""} c.VolumeDrivers = []string{""} c.StorageDrivers = []string{""} r := core.New(c) r.InitDrivers() return r, nil }
func getRexRayNoDrivers() (*core.RexRay, error) { c := config.New() c.Set("osDrivers", []string{""}) c.Set("volumeDrivers", []string{""}) c.Set("storageDrivers", []string{""}) r := core.New(c) r.InitDrivers() return r, nil }
func TestNewNoVolumeDrivers(t *testing.T) { c := config.New() c.OSDrivers = []string{mock.MockOSDriverName} c.VolumeDrivers = []string{} c.StorageDrivers = []string{mock.MockStorDriverName} r := core.New(c) if err := r.InitDrivers(); err != errors.ErrNoVolumeDrivers { t.Fatal(err) } }
func TestNewNoVolumeDrivers(t *testing.T) { c := config.New() c.Set("osDrivers", []string{mock.MockOSDriverName}) c.Set("volumeDrivers", []string{}) c.Set("storageDrivers", []string{mock.MockStorDriverName}) r := core.New(c) if err := r.InitDrivers(); err != errors.ErrNoVolumeDrivers { t.Fatal(err) } }
func getRexRay() (*core.RexRay, error) { c := config.New() c.OSDrivers = []string{mock.MockOSDriverName} c.VolumeDrivers = []string{mock.MockVolDriverName} c.StorageDrivers = []string{mock.MockStorDriverName} r := core.New(c) if err := r.InitDrivers(); err != nil { return nil, err } return r, nil }
// New creates a new REX-Ray instance and configures it with the // provided configuration instance. func New(conf *config.Config) *RexRay { if conf == nil { conf = config.New() } r := &RexRay{ Config: conf, drivers: map[string]Driver{}, } for name, ctor := range driverCtors { r.drivers[name] = ctor() log.WithField("driverName", name).Debug("constructed driver") } return r }
func init() { //tcpAddr := fmt.Sprintf("tcp://:%d", ModPort) _, fsPath, parseAddrErr := util.ParseAddress(modAddress) if parseAddrErr != nil { panic(parseAddrErr) } fsPathDir := filepath.Dir(fsPath) os.MkdirAll(fsPathDir, 0755) mc := &module.Config{ Address: modAddress, Config: config.New(), } module.RegisterModule(modName, true, newMod, []*module.Config{mc}) }