Esempio n. 1
0
func (m *localMantaServer) setupServer(c *gc.C) {
	// Set up the HTTP server.
	m.Server = httptest.NewServer(nil)
	c.Assert(m.Server, gc.NotNil)
	m.oldHandler = m.Server.Config.Handler
	m.Mux = http.NewServeMux()
	m.Server.Config.Handler = m.Mux

	m.manta = lm.New(m.Server.URL, testUser)
	m.manta.SetupHTTP(m.Mux)
	c.Logf("Started local Manta service at: %v", m.Server.URL)
}
Esempio n. 2
0
func (s *LocalTests) SetUpSuite(c *gc.C) {
	// Set up the HTTP server.
	s.Server = httptest.NewServer(nil)
	s.oldHandler = s.Server.Config.Handler
	s.Mux = http.NewServeMux()
	s.Server.Config.Handler = s.Mux

	// Set up a Joyent Manta service.
	authentication := auth.Auth{User: "******", KeyFile: localKeyFile, Algorithm: "rsa-sha256"}

	s.creds = &auth.Credentials{
		UserAuthentication: authentication,
		MantaKeyId:         "",
		MantaEndpoint:      auth.Endpoint{URL: s.Server.URL},
	}
	s.manta = localmanta.New(s.creds.MantaEndpoint.URL, s.creds.UserAuthentication.User)
	s.manta.SetupHTTP(s.Mux)
}
Esempio n. 3
0
func (s *LocalTests) SetUpSuite(c *gc.C) {
	// Set up the HTTP server.
	s.Server = httptest.NewServer(nil)
	s.oldHandler = s.Server.Config.Handler
	s.Mux = httprouter.New()
	s.Server.Config.Handler = s.Mux

	// Set up a Joyent Manta service.
	authentication, err := auth.NewAuth("localtest", string(privateKey), "rsa-sha256")
	c.Assert(err, gc.IsNil)

	s.creds = &auth.Credentials{
		UserAuthentication: authentication,
		MantaKeyId:         "",
		MantaEndpoint:      auth.Endpoint{URL: s.Server.URL},
	}
	s.manta = localmanta.New(s.creds.MantaEndpoint.URL, s.creds.UserAuthentication.User)
	s.manta.SetupHTTP(s.Mux)
}
Esempio n. 4
0
func (s *MantaHTTPSuite) SetUpSuite(c *gc.C) {
	s.HTTPSuite.SetUpSuite(c)
	c.Assert(s.Server.URL[:7], gc.Equals, "http://")
	s.service = lm.New(s.Server.URL, "fakeuser")
}
Esempio n. 5
0
func (s *MantaSuite) SetUpSuite(c *gc.C) {
	s.service = lm.New(testServiceURL, testUserAccount)
}