Example #1
0
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)
}
Example #2
0
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)
}
Example #3
0
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, "")
}
Example #4
0
func getRouterForBox(box *provision.Box) (router.Router, error) {
	routerName, err := box.GetRouter()
	if err != nil {
		return nil, err
	}
	return router.Get(routerName)
}
Example #5
0
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)
}
Example #6
0
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!"))
}
Example #7
0
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)
}