예제 #1
0
파일: local_test.go 프로젝트: jameinel/core
func (s *localServerSuite) SetUpTest(c *gc.C) {
	s.AddSuiteCleanup(CreateTestKey(c))

	s.cSrv = &localCloudAPIServer{}
	s.mSrv = &localMantaServer{}
	s.cSrv.setupServer(c)
	s.mSrv.setupServer(c)

	s.Tests.SetUpTest(c)
	s.TestConfig = GetFakeConfig(s.cSrv.Server.URL, s.mSrv.Server.URL)

	// Put some fake image metadata in place.
	creds := joyent.MakeCredentials(c, s.TestConfig)
	joyent.UseExternalTestImageMetadata(creds)
}
예제 #2
0
파일: local_test.go 프로젝트: jameinel/core
func (s *localLiveSuite) SetUpSuite(c *gc.C) {
	s.LoggingSuite.SetUpSuite(c)
	s.AddSuiteCleanup(CreateTestKey(c))
	s.cSrv = &localCloudAPIServer{}
	s.mSrv = &localMantaServer{}
	s.cSrv.setupServer(c)
	s.mSrv.setupServer(c)

	s.TestConfig = GetFakeConfig(s.cSrv.Server.URL, s.mSrv.Server.URL)
	s.TestConfig = s.TestConfig.Merge(coretesting.Attrs{
		"image-metadata-url": "test://host",
	})
	s.LiveTests.SetUpSuite(c)

	creds := joyent.MakeCredentials(c, s.TestConfig)
	joyent.UseExternalTestImageMetadata(creds)
	restoreFinishBootstrap := envtesting.DisableFinishBootstrap()
	s.AddSuiteCleanup(func(*gc.C) { restoreFinishBootstrap() })
}