Skip to content

Commit 11f417a

Browse files
committed
Use the fast certs in the JujuConnSuite.
1 parent f23340a commit 11f417a

File tree

5 files changed

+3
-29
lines changed

5 files changed

+3
-29
lines changed

apiserver/authhttp_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424

2525
apitesting "github.com/juju/juju/api/testing"
2626
"github.com/juju/juju/apiserver/params"
27-
"github.com/juju/juju/cert"
2827
"github.com/juju/juju/permission"
2928
"github.com/juju/juju/state"
3029
"github.com/juju/juju/testing"
@@ -56,17 +55,6 @@ type authHTTPSuite struct {
5655
extraHeaders map[string]string
5756
}
5857

59-
func (s *authHTTPSuite) SetUpSuite(c *gc.C) {
60-
if s.macaroonAuthEnabled {
61-
s.MacaroonSuite.SetUpSuite(c)
62-
} else {
63-
// No macaroons, so don't enable them.
64-
s.JujuConnSuite.SetUpSuite(c)
65-
}
66-
s.PatchValue(&cert.NewCA, testing.NewCA)
67-
s.PatchValue(&cert.NewLeafKeyBits, 512)
68-
}
69-
7058
func (s *authHTTPSuite) SetUpTest(c *gc.C) {
7159
if s.macaroonAuthEnabled {
7260
s.MacaroonSuite.SetUpTest(c)

apiserver/server_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
"github.com/juju/juju/apiserver/observer"
3333
"github.com/juju/juju/apiserver/observer/fakeobserver"
3434
"github.com/juju/juju/apiserver/params"
35-
corecert "github.com/juju/juju/cert"
3635
"github.com/juju/juju/controller"
3736
jujutesting "github.com/juju/juju/juju/testing"
3837
"github.com/juju/juju/mongo"
@@ -54,12 +53,6 @@ type serverSuite struct {
5453

5554
var _ = gc.Suite(&serverSuite{})
5655

57-
func (s *serverSuite) SetUpSuite(c *gc.C) {
58-
s.JujuConnSuite.SetUpSuite(c)
59-
s.PatchValue(&corecert.NewCA, coretesting.NewCA)
60-
s.PatchValue(&corecert.NewLeafKeyBits, 512)
61-
}
62-
6356
func (s *serverSuite) TestStop(c *gc.C) {
6457
// Start our own instance of the server so we have
6558
// a handle on it to stop it.

cmd/jujud/agent/util_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"github.com/juju/juju/agent"
2525
"github.com/juju/juju/api"
2626
apideployer "github.com/juju/juju/api/deployer"
27-
"github.com/juju/juju/cert"
2827
"github.com/juju/juju/cmd/jujud/agent/agenttest"
2928
cmdutil "github.com/juju/juju/cmd/jujud/util"
3029
"github.com/juju/juju/environs"
@@ -67,8 +66,6 @@ func (s *commonMachineSuite) SetUpSuite(c *gc.C) {
6766
s.AgentSuite.SetUpSuite(c)
6867
s.PatchValue(&jujuversion.Current, coretesting.FakeVersionNumber)
6968
s.PatchValue(&stateWorkerDialOpts, mongotest.DialOpts())
70-
s.PatchValue(&cert.NewCA, coretesting.NewCA)
71-
s.PatchValue(&cert.NewLeafKeyBits, 512)
7269
}
7370

7471
func (s *commonMachineSuite) TearDownSuite(c *gc.C) {

featuretests/upgrade_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"github.com/juju/juju/agent"
2323
"github.com/juju/juju/api"
2424
"github.com/juju/juju/apiserver/params"
25-
"github.com/juju/juju/cert"
2625
agentcmd "github.com/juju/juju/cmd/jujud/agent"
2726
"github.com/juju/juju/cmd/jujud/agent/agenttest"
2827
cmdutil "github.com/juju/juju/cmd/jujud/util"
@@ -59,12 +58,6 @@ type upgradeSuite struct {
5958
oldVersion version.Binary
6059
}
6160

62-
func (s *upgradeSuite) SetUpSuite(c *gc.C) {
63-
s.AgentSuite.SetUpSuite(c)
64-
s.PatchValue(&cert.NewCA, coretesting.NewCA)
65-
s.PatchValue(&cert.NewLeafKeyBits, 512)
66-
}
67-
6861
func (s *upgradeSuite) SetUpTest(c *gc.C) {
6962
s.AgentSuite.SetUpTest(c)
7063

juju/testing/conn.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727

2828
"github.com/juju/juju/agent"
2929
"github.com/juju/juju/api"
30+
"github.com/juju/juju/cert"
3031
"github.com/juju/juju/cloud"
3132
"github.com/juju/juju/cmd/modelcmd"
3233
"github.com/juju/juju/controller"
@@ -112,6 +113,8 @@ func (s *JujuConnSuite) SetUpSuite(c *gc.C) {
112113
s.MgoSuite.SetUpSuite(c)
113114
s.FakeJujuXDGDataHomeSuite.SetUpSuite(c)
114115
s.PatchValue(&utils.OutgoingAccessAllowed, false)
116+
s.PatchValue(&cert.NewCA, testing.NewCA)
117+
s.PatchValue(&cert.NewLeafKeyBits, 512)
115118
}
116119

117120
func (s *JujuConnSuite) TearDownSuite(c *gc.C) {

0 commit comments

Comments
 (0)