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

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/machine/add_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
import (
7
7
        "strconv"
8
 
        "strings"
9
8
 
10
9
        "github.com/juju/cmd"
11
10
        "github.com/juju/errors"
67
66
                        count:     1,
68
67
                        placement: "lxd:4",
69
68
                }, {
70
 
                        args:        []string{"--constraints", "mem=8G"},
71
 
                        count:       1,
72
 
                        constraints: "mem=8192M",
73
 
                }, {
74
 
                        args:        []string{"--constraints", "container=lxd"},
75
 
                        errorString: `container constraint "lxd" not allowed when adding a machine`,
76
 
                }, {
77
69
                        args:      []string{"ssh:user@10.10.0.3"},
78
70
                        count:     1,
79
71
                        placement: "ssh:user@10.10.0.3",
182
174
func (s *AddMachineSuite) TestBlockedError(c *gc.C) {
183
175
        s.fakeAddMachine.addError = common.OperationBlockedError("TestBlockedError")
184
176
        _, err := s.run(c)
185
 
        c.Assert(err, gc.Equals, cmd.ErrSilent)
186
 
        // msg is logged
187
 
        stripped := strings.Replace(c.GetTestLog(), "\n", "", -1)
188
 
        c.Check(stripped, gc.Matches, ".*TestBlockedError.*")
 
177
        testing.AssertOperationWasBlocked(c, err, ".*TestBlockedError.*")
189
178
}
190
179
 
191
180
func (s *AddMachineSuite) TestAddMachineWithDisks(c *gc.C) {