~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/jujud/reboot/reboot_nix_test.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        testing.PatchExecutable(c, s, "lxc-info", lxcInfoScript)
92
92
        expectedRebootParams := s.rebootCommandParams(c)
93
93
 
94
 
        // Timeout after 5 seconds
95
94
        s.PatchValue(reboot.Timeout, time.Duration(5*time.Second))
96
95
        w, err := reboot.NewRebootWaiter(s.st, s.acfg)
97
96
        c.Assert(err, jc.ErrorIsNil)
105
104
func (s *RebootSuite) TestRebootWithMissbehavingContainers(c *gc.C) {
106
105
        testing.PatchExecutable(c, s, "lxc-ls", lxcLsScript)
107
106
        testing.PatchExecutable(c, s, "lxc-info", lxcInfoScriptMissbehave)
108
 
        expectedRebootParams := s.rebootCommandParams(c)
109
107
 
110
 
        // Timeout after 5 seconds
111
 
        s.PatchValue(reboot.Timeout, time.Duration(5*time.Second))
 
108
        s.PatchValue(reboot.Timeout, time.Duration(1*time.Second))
112
109
        w, err := reboot.NewRebootWaiter(s.st, s.acfg)
113
110
        c.Assert(err, jc.ErrorIsNil)
114
111
 
115
112
        err = w.ExecuteReboot(params.ShouldReboot)
116
 
        c.Assert(err, jc.ErrorIsNil)
117
 
        testing.AssertEchoArgs(c, rebootBin, expectedRebootParams...)
118
 
        ft.File{s.rebootScriptName, expectedRebootScript, 0755}.Check(c, s.tmpDir)
 
113
        c.Assert(err, gc.ErrorMatches, "Timeout reached waiting for containers to shutdown")
119
114
}
120
115
 
121
116
func (s *RebootSuite) TestRebootNoContainers(c *gc.C) {