~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/commands/resolved_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:
37
37
}
38
38
 
39
39
func runDeploy(c *gc.C, args ...string) error {
40
 
        _, err := testing.RunCommand(c, application.NewDeployCommand(), args...)
 
40
        _, err := testing.RunCommand(c, application.NewDefaultDeployCommand(), args...)
41
41
        return err
42
42
}
43
43
 
61
61
                unit: "dummy/0",
62
62
                mode: state.ResolvedNone,
63
63
        }, {
64
 
                args: []string{"dummy/1", "--retry"},
 
64
                args: []string{"dummy/1", "--no-retry"},
65
65
                err:  `unit "dummy/1" is not in an error state`,
66
66
                unit: "dummy/1",
67
67
                mode: state.ResolvedNone,
68
68
        }, {
69
 
                args: []string{"dummy/2"},
 
69
                args: []string{"dummy/2", "--no-retry"},
70
70
                unit: "dummy/2",
71
71
                mode: state.ResolvedNoHooks,
72
72
        }, {
73
 
                args: []string{"dummy/2", "--retry"},
 
73
                args: []string{"dummy/2", "--no-retry"},
74
74
                err:  `cannot set resolved mode for unit "dummy/2": already resolved`,
75
75
                unit: "dummy/2",
76
76
                mode: state.ResolvedNoHooks,
77
77
        }, {
78
 
                args: []string{"dummy/3", "--retry"},
 
78
                args: []string{"dummy/3"},
79
79
                unit: "dummy/3",
80
80
                mode: state.ResolvedRetryHooks,
81
81
        }, {
100
100
                u, err := s.State.Unit(name)
101
101
                c.Assert(err, jc.ErrorIsNil)
102
102
                sInfo := status.StatusInfo{
103
 
                        Status:  status.StatusError,
 
103
                        Status:  status.Error,
104
104
                        Message: "lol borken",
105
105
                        Since:   &now,
106
106
                }
135
135
                u, err := s.State.Unit(name)
136
136
                c.Assert(err, jc.ErrorIsNil)
137
137
                sInfo := status.StatusInfo{
138
 
                        Status:  status.StatusError,
 
138
                        Status:  status.Error,
139
139
                        Message: "lol borken",
140
140
                        Since:   &now,
141
141
                }
146
146
        // Block operation
147
147
        s.BlockAllChanges(c, "TestBlockResolved")
148
148
        err = runResolved(c, []string{"dummy/2"})
149
 
        s.AssertBlocked(c, err, ".*TestBlockResolved.*")
 
149
        testing.AssertOperationWasBlocked(c, err, ".*TestBlockResolved.*")
150
150
}