func (pollingSuite) TestWaitDNSNamePropagatesFailure(c *gc.C) { failure := errors.New("deliberate failure") inst := dnsNameFakeInstance{err: failure} _, err := common.WaitDNSName(&inst) c.Assert(err, gc.NotNil) c.Check(err, gc.Equals, failure) }
// WaitDNSName is specified in the Instance interface. func (azInstance *azureInstance) WaitDNSName() (string, error) { return common.WaitDNSName(azInstance) }
func (inst *dummyInstance) WaitDNSName() (string, error) { return common.WaitDNSName(inst) }
func (pollingSuite) TestWaitDNSNamePollsOnErrNoDNSName(c *gc.C) { inst := dnsNameFakeInstance{err: instance.ErrNoDNSName} _, err := common.WaitDNSName(&inst) c.Assert(err, gc.NotNil) c.Check(err, gc.ErrorMatches, ".*timed out trying to get DNS address.*") }
func (pollingSuite) TestWaitDNSNameReturnsDNSNameIfAvailable(c *gc.C) { inst := dnsNameFakeInstance{name: "anansi"} name, err := common.WaitDNSName(&inst) c.Assert(err, gc.IsNil) c.Check(name, gc.Equals, "anansi") }
func (inst *dnsNameFakeInstance) WaitDNSName() (string, error) { return common.WaitDNSName(inst) }
func (mi *maasInstance) WaitDNSName() (string, error) { return common.WaitDNSName(mi) }