func (s *S) TestUnsetCNameNotExist(c *check.C) { s.cf.MkGlobal() vRouter, err := router.Get("route53") c.Assert(err, check.IsNil) err = vRouter.UnsetCName("myapp2.megambox66.com", "192.168.1.102") c.Assert(err, check.Equals, router.ErrDomainNotFound) }
func (s *S) TestUnsetCName(c *check.C) { s.cf.MkGlobal() vRouter, err := router.Get("route53") c.Assert(err, check.IsNil) err = vRouter.UnsetCName("myapp1.megambox.com", "192.168.1.100") c.Assert(err, check.IsNil) }
func (s *S) TestAddrNotExist(c *check.C) { s.cf.MkGlobal() vRouter, err := router.Get("route53") c.Assert(err, check.IsNil) addr, err := vRouter.Addr("myapp.megamboxy.com") c.Assert(addr, check.Equals, "") }
func getRouterForBox(box *provision.Box) (router.Router, error) { routerName, err := box.GetRouter() if err != nil { return nil, err } return router.Get(routerName) }
func (s *S) TestShouldBeRegistered(c *check.C) { s.cf.MkGlobal() router.Register("route53", createRouter) got, err := router.Get("route53") c.Assert(err, check.IsNil) _, ok := got.(route53Router) c.Assert(ok, check.Equals, true) }
func (s *S) TestStartupMessage(c *check.C) { got, err := router.Get("route53") c.Assert(err, check.IsNil) mRouter, ok := got.(route53Router) c.Assert(ok, check.Equals, true) message, err := mRouter.StartupMessage() c.Assert(err, check.IsNil) c.Assert(message, check.Equals, fmt.Sprintf("R53 router ok!")) }
func (s *S) TestSetCNameDuplicate(c *check.C) { s.cf.MkGlobal() vRouter, err := router.Get("route53") err = vRouter.SetCName("myapp1.megambox.com", "192.168.1.100") c.Assert(err, check.Equals, nil) }