Esempio n. 1
0
func (s *environInstSuite) TestControllerInstancesMixed(c *gc.C) {
	other := lxdclient.NewInstance(lxdclient.InstanceSummary{}, nil)
	s.Client.Insts = []lxdclient.Instance{*s.RawInstance, *other}

	ids, err := s.Env.ControllerInstances()
	c.Assert(err, jc.ErrorIsNil)

	c.Check(ids, jc.DeepEquals, []instance.Id{"spam"})
}
Esempio n. 2
0
func (s *BaseSuiteUnpatched) NewRawInstance(c *gc.C, name string) *lxdclient.Instance {
	summary := lxdclient.InstanceSummary{
		Name:      name,
		Status:    lxdclient.StatusRunning,
		Hardware:  *s.Hardware,
		Metadata:  s.Metadata,
		Addresses: s.Addresses,
	}
	instanceSpec := lxdclient.InstanceSpec{
		Name:      name,
		Profiles:  []string{},
		Ephemeral: false,
		Metadata:  s.Metadata,
	}
	return lxdclient.NewInstance(summary, &instanceSpec)
}