예제 #1
0
파일: local_test.go 프로젝트: klyachin/juju
func (s *localServerSuite) TestFindImageInvalidInstanceConstraint(c *gc.C) {
	// Prevent falling over to the public datasource.
	s.BaseSuite.PatchValue(&imagemetadata.DefaultBaseURL, "")

	env := s.Open(c)
	_, err := openstack.FindInstanceSpec(env, "precise", "amd64", "instance-type=m1.large")
	c.Assert(err, gc.ErrorMatches, `no instance types in some-region matching constraints "instance-type=m1.large"`)
}
예제 #2
0
파일: local_test.go 프로젝트: klyachin/juju
func (s *localServerSuite) TestFindImageInstanceConstraint(c *gc.C) {
	// Prevent falling over to the public datasource.
	s.BaseSuite.PatchValue(&imagemetadata.DefaultBaseURL, "")

	env := s.Open(c)
	spec, err := openstack.FindInstanceSpec(env, "precise", "amd64", "instance-type=m1.tiny")
	c.Assert(err, gc.IsNil)
	c.Assert(spec.InstanceType.Name, gc.Equals, "m1.tiny")
}
예제 #3
0
파일: local_test.go 프로젝트: klyachin/juju
func (s *localServerSuite) TestFindImageBadDefaultImage(c *gc.C) {
	// Prevent falling over to the public datasource.
	s.BaseSuite.PatchValue(&imagemetadata.DefaultBaseURL, "")

	env := s.Open(c)

	// An error occurs if no suitable image is found.
	_, err := openstack.FindInstanceSpec(env, "saucy", "amd64", "mem=1G")
	c.Assert(err, gc.ErrorMatches, `no "saucy" images in some-region with arches \[amd64\]`)
}