Example #1
0
func (s *S) SetUpSuite(c *check.C) {
	config.Set("auth:token-expire-days", 2)
	config.Set("auth:hash-cost", bcrypt.MinCost)
	config.Set("database:url", "127.0.0.1:27017")
	config.Set("database:name", "tsuru_auth_native_test")
	var err error
	s.server, err = authtest.NewSMTPServer()
	c.Assert(err, check.IsNil)
	config.Set("smtp:server", s.server.Addr())
	config.Set("smtp:user", "root")
	config.Set("smtp:password", "123456")
}
Example #2
0
func (s *S) SetUpTest(c *check.C) {
	err := dbtest.ClearAllCollections(s.conn.Apps().Database)
	c.Assert(err, check.IsNil)
	s.user = &User{Email: "*****@*****.**", Password: "******"}
	s.user.Create()
	s.hashed = s.user.Password
	team := &Team{Name: "cobrateam"}
	err = s.conn.Teams().Insert(team)
	c.Assert(err, check.IsNil)
	s.team = team
	s.server, err = authtest.NewSMTPServer()
	c.Assert(err, check.IsNil)
	config.Set("smtp:server", s.server.Addr())
	repositorytest.Reset()
}
Example #3
0
func (s *S) SetUpSuite(c *check.C) {
	config.Set("auth:token-expire-days", 2)
	config.Set("auth:hash-cost", bcrypt.MinCost)
	config.Set("admin-team", "admin")
	config.Set("database:url", "127.0.0.1:27017")
	config.Set("database:name", "tsuru_auth_test")
	s.conn, _ = db.Conn()
	s.user = &User{Email: "*****@*****.**", Password: "******"}
	s.user.Create()
	s.hashed = s.user.Password
	team := &Team{Name: "cobrateam", Users: []string{s.user.Email}}
	err := s.conn.Teams().Insert(team)
	c.Assert(err, check.IsNil)
	s.team = team
	s.gitHost, _ = config.GetString("git:host")
	s.gitPort, _ = config.GetString("git:port")
	s.gitProt, _ = config.GetString("git:protocol")
	s.server, err = authtest.NewSMTPServer()
	c.Assert(err, check.IsNil)
	config.Set("smtp:server", s.server.Addr())
	config.Set("smtp:user", "root")
	config.Set("smtp:password", "123456")
	config.Set("repo-manager", "fake")
}