Permalink
Browse files

Fix the vsphere tests.

  • Loading branch information...
1 parent 6e605a7 commit 9757821b5070ff26510cedc58e7919450ebfa9a6 @howbazaar committed May 13, 2015
Showing with 6 additions and 2 deletions.
  1. +5 −1 provider/vsphere/environ_broker_test.go
  2. +1 −1 provider/vsphere/image_metadata.go
@@ -18,6 +18,7 @@ import (
"github.com/juju/juju/constraints"
"github.com/juju/juju/environs"
"github.com/juju/juju/environs/config"
+ "github.com/juju/juju/environs/imagemetadata"
"github.com/juju/juju/instance"
"github.com/juju/juju/juju/arch"
"github.com/juju/juju/provider/common"
@@ -37,6 +38,9 @@ func (s *environBrokerSuite) SetUpTest(c *gc.C) {
}
func (s *environBrokerSuite) PrepareStartInstanceFakes(c *gc.C) {
+ // Prevent falling over to the public datasource.
+ s.BaseSuite.PatchValue(&imagemetadata.DefaultBaseURL, "")
+
client := vsphere.ExposeEnvFakeClient(s.Env)
client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties)
s.FakeInstances(client)
@@ -90,7 +94,7 @@ func (s *environBrokerSuite) TestStartInstanceWithUnsupportedConstraints(c *gc.C
startInstArgs.Tools[0].Version.Arch = "someArch"
_, err := s.Env.StartInstance(startInstArgs)
- c.Assert(err, gc.ErrorMatches, "no mathicng images found for given constraints: .*")
+ c.Assert(err, gc.ErrorMatches, "no matching images found for given constraints: .*")
}
// if tools for multiple architectures are avaliable, provider should filter tools by arch of the selected image
@@ -52,7 +52,7 @@ func findImageMetadata(env *environ, args environs.StartInstanceParams) (*OvaFil
return nil, errors.Trace(err)
}
if len(matchingImages) == 0 {
- return nil, errors.Errorf("no mathicng images found for given constraints: %v", ic)
+ return nil, errors.Errorf("no matching images found for given constraints: %v", ic)
}
return matchingImages[0], nil

0 comments on commit 9757821

Please sign in to comment.