Reviewers: mp+201709_code.launchpad.net,
Message: Please take a look.
Description: cmd/jujud: fake $HOME for all machine agent tests
Also, set the "SSHUser" to "", so the authenticationworker does not attempt to read/write ~ubuntu/.ssh/authorized_keys.
https://code.launchpad.net/~axwalk/juju-core/cmd-jujud-machinetest-fakehome/+merge/201709
(do not edit description out of merge proposal)
Please review this at https://codereview.appspot.com/52260044/
Affected files (+6, -4 lines): A [revision details] M cmd/jujud/machine_test.go
Index: [revision details] === added file '[revision details]' --- [revision details] 2012-01-01 00:00:00 +0000 +++ [revision details] 2012-01-01 00:00:00 +0000 @@ -0,0 +1,2 @@ +Old revision: tarmac-20140115023645-jcncxp07j62jmxrb +New revision: <email address hidden>
Index: cmd/jujud/machine_test.go === modified file 'cmd/jujud/machine_test.go' --- cmd/jujud/machine_test.go 2014-01-14 05:33:34 +0000 +++ cmd/jujud/machine_test.go 2014-01-15 03:20:41 +0000 @@ -63,6 +63,10 @@ s.agentSuite.SetUpTest(c) s.TestSuite.SetUpTest(c) os.Remove(jujuRun) // ignore error; may not exist + // Fake $HOME, and ssh user to avoid touching ~ubuntu/.ssh/authorized_keys. + fakeHome := coretesting.MakeEmptyFakeHomeWithoutJuju(c) + s.AddCleanup(func(*gc.C) { fakeHome.Restore() }) + s.PatchValue(&authenticationworker.SSHUser, "") }
func (s *MachineSuite) TearDownTest(c *gc.C) { @@ -577,10 +581,6 @@ }
func (s *MachineSuite) TestMachineAgentRunsAuthorisedKeysWorker(c *gc.C) { - fakeHome := coretesting.MakeEmptyFakeHomeWithoutJuju(c) - s.AddCleanup(func(*gc.C) { fakeHome.Restore() }) - s.PatchValue(&authenticationworker.SSHUser, "") - // Start the machine agent. m, _, _ := s.primeAgent(c, state.JobHostUnits) a := s.newAgent(c, m)
« Back to merge proposal
Reviewers: mp+201709_ code.launchpad. net,
Message:
Please take a look.
Description:
cmd/jujud: fake $HOME for all machine agent tests
Also, set the "SSHUser" to "", so the authenticationw orker .ssh/authorized _keys.
does not attempt to read/write ~ubuntu/
https:/ /code.launchpad .net/~axwalk/ juju-core/ cmd-jujud- machinetest- fakehome/ +merge/ 201709
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/52260044/
Affected files (+6, -4 lines): machine_ test.go
A [revision details]
M cmd/jujud/
Index: [revision details] 20140115023645- jcncxp07j62jmxr b
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: cmd/jujud/ machine_ test.go machine_ test.go' machine_ test.go 2014-01-14 05:33:34 +0000 machine_ test.go 2014-01-15 03:20:41 +0000 .SetUpTest( c) SetUpTest( c) jujuRun) // ignore error; may not exist .ssh/authorized _keys. MakeEmptyFakeHo meWithoutJuju( c) func(*gc. C) { fakeHome.Restore() }) &authentication worker. SSHUser, "")
=== modified file 'cmd/jujud/
--- cmd/jujud/
+++ cmd/jujud/
@@ -63,6 +63,10 @@
s.agentSuite
s.TestSuite.
os.Remove(
+ // Fake $HOME, and ssh user to avoid touching
~ubuntu/
+ fakeHome := coretesting.
+ s.AddCleanup(
+ s.PatchValue(
}
func (s *MachineSuite) TearDownTest(c *gc.C) {
@@ -577,10 +581,6 @@
}
func (s *MachineSuite) TestMachineAgen tRunsAuthorised KeysWorker( c *gc.C) { MakeEmptyFakeHo meWithoutJuju( c) func(*gc. C) { fakeHome.Restore() }) &authentication worker. SSHUser, "")
- fakeHome := coretesting.
- s.AddCleanup(
- s.PatchValue(
-
// Start the machine agent.
m, _, _ := s.primeAgent(c, state.JobHostUnits)
a := s.newAgent(c, m)