1
// Copyright 2014 Canonical Ltd.
2
// Copyright 2014 Cloudbase Solutions SRL
3
// Licensed under the AGPLv3, see LICENCE file for details.
8
"github.com/juju/testing"
9
jc "github.com/juju/testing/checkers"
10
gc "gopkg.in/check.v1"
12
"github.com/juju/juju/apiserver/params"
13
"github.com/juju/juju/cmd/jujud/reboot"
17
rebootBin = "shutdown.exe"
21
func (s *RebootSuite) rebootCommandParams(c *gc.C) []string {
30
func (s *RebootSuite) shutdownCommandParams(c *gc.C) []string {
39
func (s *RebootSuite) TestRebootNoContainers(c *gc.C) {
40
w, err := reboot.NewRebootWaiter(s.st, s.acfg)
41
c.Assert(err, jc.ErrorIsNil)
42
expectedRebootParams := s.rebootCommandParams(c)
44
err = w.ExecuteReboot(params.ShouldReboot)
45
c.Assert(err, jc.ErrorIsNil)
46
testing.AssertEchoArgs(c, rebootBin, expectedRebootParams...)
49
func (s *RebootSuite) TestShutdownNoContainers(c *gc.C) {
50
w, err := reboot.NewRebootWaiter(s.st, s.acfg)
51
c.Assert(err, jc.ErrorIsNil)
52
expectedShutdownParams := s.shutdownCommandParams(c)
54
err = w.ExecuteReboot(params.ShouldShutdown)
55
c.Assert(err, jc.ErrorIsNil)
56
testing.AssertEchoArgs(c, rebootBin, expectedShutdownParams...)