Skip to content

Commit fde8729

Browse files
Fix failing tests
1 parent 4f0ea60 commit fde8729

File tree

6 files changed

+64
-44
lines changed

6 files changed

+64
-44
lines changed

client/services_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (cs *clientSuite) TestStartStop(c *check.C) {
5555

5656
var body map[string]interface{}
5757
c.Assert(json.NewDecoder(cs.req.Body).Decode(&body), check.IsNil)
58-
c.Check(body, check.HasLen, 2)
58+
c.Check(body, check.HasLen, 3)
5959
c.Check(body["action"], check.Equals, action)
6060
c.Check(body["services"], check.DeepEquals, []interface{}{"one", "two"})
6161
}
@@ -80,7 +80,7 @@ func (cs *clientSuite) TestAutostart(c *check.C) {
8080

8181
var body map[string]interface{}
8282
c.Assert(json.NewDecoder(cs.req.Body).Decode(&body), check.IsNil)
83-
c.Check(body, check.HasLen, 2)
83+
c.Check(body, check.HasLen, 3)
8484
c.Check(body["action"], check.Equals, "autostart")
8585
}
8686

@@ -132,7 +132,7 @@ func (cs *clientSuite) TestRestart(c *check.C) {
132132

133133
var body map[string]interface{}
134134
c.Assert(json.NewDecoder(cs.req.Body).Decode(&body), check.IsNil)
135-
c.Check(body, check.HasLen, 2)
135+
c.Check(body, check.HasLen, 3)
136136
c.Check(body["action"], check.Equals, "restart")
137137
c.Check(body["services"], check.DeepEquals, []interface{}{"one", "two"})
138138
}
@@ -156,6 +156,6 @@ func (cs *clientSuite) TestReplan(c *check.C) {
156156

157157
var body map[string]interface{}
158158
c.Assert(json.NewDecoder(cs.req.Body).Decode(&body), check.IsNil)
159-
c.Check(body, check.HasLen, 2)
159+
c.Check(body, check.HasLen, 3)
160160
c.Check(body["action"], check.Equals, "replan")
161161
}

cmd/pebble/cmd_autostart_test.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ func (s *PebbleSuite) TestAutostart(c *check.C) {
5656

5757
body := DecodedRequestBody(c, r)
5858
c.Check(body, check.DeepEquals, map[string]interface{}{
59-
"action": "autostart",
60-
"services": nil,
59+
"action": "autostart",
60+
"services": nil,
61+
"service-args": nil,
6162
})
6263

6364
fmt.Fprintf(w, `{
@@ -80,8 +81,9 @@ func (s *PebbleSuite) TestAutostartFailsNoDefaultServices(c *check.C) {
8081
c.Check(r.URL.Path, check.Equals, "/v1/services")
8182
body := DecodedRequestBody(c, r)
8283
c.Check(body, check.DeepEquals, map[string]interface{}{
83-
"action": "autostart",
84-
"services": nil,
84+
"action": "autostart",
85+
"services": nil,
86+
"service-args": nil,
8587
})
8688

8789
fmt.Fprint(w, `{
@@ -106,8 +108,9 @@ func (s *PebbleSuite) TestAutostartNoWait(c *check.C) {
106108

107109
body := DecodedRequestBody(c, r)
108110
c.Check(body, check.DeepEquals, map[string]interface{}{
109-
"action": "autostart",
110-
"services": nil,
111+
"action": "autostart",
112+
"services": nil,
113+
"service-args": nil,
111114
})
112115

113116
fmt.Fprintf(w, `{
@@ -137,8 +140,9 @@ func (s *PebbleSuite) TestAutostartFailsGetChange(c *check.C) {
137140

138141
body := DecodedRequestBody(c, r)
139142
c.Check(body, check.DeepEquals, map[string]interface{}{
140-
"action": "autostart",
141-
"services": nil,
143+
"action": "autostart",
144+
"services": nil,
145+
"service-args": nil,
142146
})
143147

144148
fmt.Fprintf(w, `{

cmd/pebble/cmd_replan_test.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ func (s *PebbleSuite) TestReplan(c *check.C) {
5656

5757
body := DecodedRequestBody(c, r)
5858
c.Check(body, check.DeepEquals, map[string]interface{}{
59-
"action": "replan",
60-
"services": nil,
59+
"action": "replan",
60+
"services": nil,
61+
"service-args": nil,
6162
})
6263

6364
fmt.Fprintf(w, `{
@@ -80,8 +81,9 @@ func (s *PebbleSuite) TestReplanFailsNoDefaultServices(c *check.C) {
8081
c.Check(r.URL.Path, check.Equals, "/v1/services")
8182
body := DecodedRequestBody(c, r)
8283
c.Check(body, check.DeepEquals, map[string]interface{}{
83-
"action": "replan",
84-
"services": nil,
84+
"action": "replan",
85+
"services": nil,
86+
"service-args": nil,
8587
})
8688

8789
fmt.Fprint(w, `{
@@ -106,8 +108,9 @@ func (s *PebbleSuite) TestReplanNoWait(c *check.C) {
106108

107109
body := DecodedRequestBody(c, r)
108110
c.Check(body, check.DeepEquals, map[string]interface{}{
109-
"action": "replan",
110-
"services": nil,
111+
"action": "replan",
112+
"services": nil,
113+
"service-args": nil,
111114
})
112115

113116
fmt.Fprintf(w, `{
@@ -137,8 +140,9 @@ func (s *PebbleSuite) TestReplanFailsGetChange(c *check.C) {
137140

138141
body := DecodedRequestBody(c, r)
139142
c.Check(body, check.DeepEquals, map[string]interface{}{
140-
"action": "replan",
141-
"services": nil,
143+
"action": "replan",
144+
"services": nil,
145+
"service-args": nil,
142146
})
143147

144148
fmt.Fprintf(w, `{

cmd/pebble/cmd_restart_test.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ func (s *PebbleSuite) TestRestart(c *check.C) {
4848

4949
body := DecodedRequestBody(c, r)
5050
c.Check(body, check.DeepEquals, map[string]interface{}{
51-
"action": "restart",
52-
"services": []interface{}{"srv1", "srv2"},
51+
"action": "restart",
52+
"services": []interface{}{"srv1", "srv2"},
53+
"service-args": nil,
5354
})
5455

5556
fmt.Fprintf(w, `{
@@ -73,8 +74,9 @@ func (s *PebbleSuite) TestRestartFails(c *check.C) {
7374

7475
body := DecodedRequestBody(c, r)
7576
c.Check(body, check.DeepEquals, map[string]interface{}{
76-
"action": "restart",
77-
"services": []interface{}{"srv1", "srv3"},
77+
"action": "restart",
78+
"services": []interface{}{"srv1", "srv3"},
79+
"service-args": nil,
7880
})
7981

8082
fmt.Fprintf(w, `{"type": "error", "result": {"message": "could not foo"}}`)
@@ -95,8 +97,9 @@ func (s *PebbleSuite) TestRestartNoWait(c *check.C) {
9597

9698
body := DecodedRequestBody(c, r)
9799
c.Check(body, check.DeepEquals, map[string]interface{}{
98-
"action": "restart",
99-
"services": []interface{}{"srv1", "srv2"},
100+
"action": "restart",
101+
"services": []interface{}{"srv1", "srv2"},
102+
"service-args": nil,
100103
})
101104

102105
fmt.Fprintf(w, `{
@@ -126,8 +129,9 @@ func (s *PebbleSuite) TestRestartFailsGetChange(c *check.C) {
126129

127130
body := DecodedRequestBody(c, r)
128131
c.Check(body, check.DeepEquals, map[string]interface{}{
129-
"action": "restart",
130-
"services": []interface{}{"srv1", "srv2"},
132+
"action": "restart",
133+
"services": []interface{}{"srv1", "srv2"},
134+
"service-args": nil,
131135
})
132136

133137
fmt.Fprintf(w, `{

cmd/pebble/cmd_start_test.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ func (s *PebbleSuite) TestStart(c *check.C) {
4848

4949
body := DecodedRequestBody(c, r)
5050
c.Check(body, check.DeepEquals, map[string]interface{}{
51-
"action": "start",
52-
"services": []interface{}{"srv1", "srv2"},
51+
"action": "start",
52+
"services": []interface{}{"srv1", "srv2"},
53+
"service-args": nil,
5354
})
5455

5556
fmt.Fprintf(w, `{
@@ -73,8 +74,9 @@ func (s *PebbleSuite) TestStartFails(c *check.C) {
7374

7475
body := DecodedRequestBody(c, r)
7576
c.Check(body, check.DeepEquals, map[string]interface{}{
76-
"action": "start",
77-
"services": []interface{}{"srv1", "srv3"},
77+
"action": "start",
78+
"services": []interface{}{"srv1", "srv3"},
79+
"service-args": nil,
7880
})
7981

8082
fmt.Fprintf(w, `{"type": "error", "result": {"message": "could not foo"}}`)
@@ -95,8 +97,9 @@ func (s *PebbleSuite) TestStartNoWait(c *check.C) {
9597

9698
body := DecodedRequestBody(c, r)
9799
c.Check(body, check.DeepEquals, map[string]interface{}{
98-
"action": "start",
99-
"services": []interface{}{"srv1", "srv2"},
100+
"action": "start",
101+
"services": []interface{}{"srv1", "srv2"},
102+
"service-args": nil,
100103
})
101104

102105
fmt.Fprintf(w, `{
@@ -126,8 +129,9 @@ func (s *PebbleSuite) TestStartFailsGetChange(c *check.C) {
126129

127130
body := DecodedRequestBody(c, r)
128131
c.Check(body, check.DeepEquals, map[string]interface{}{
129-
"action": "start",
130-
"services": []interface{}{"srv1", "srv2"},
132+
"action": "start",
133+
"services": []interface{}{"srv1", "srv2"},
134+
"service-args": nil,
131135
})
132136

133137
fmt.Fprintf(w, `{

cmd/pebble/cmd_stop_test.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ func (s *PebbleSuite) TestStop(c *check.C) {
4848

4949
body := DecodedRequestBody(c, r)
5050
c.Check(body, check.DeepEquals, map[string]interface{}{
51-
"action": "stop",
52-
"services": []interface{}{"srv1", "srv2"},
51+
"action": "stop",
52+
"services": []interface{}{"srv1", "srv2"},
53+
"service-args": nil,
5354
})
5455

5556
fmt.Fprintf(w, `{
@@ -73,8 +74,9 @@ func (s *PebbleSuite) TestStopFails(c *check.C) {
7374

7475
body := DecodedRequestBody(c, r)
7576
c.Check(body, check.DeepEquals, map[string]interface{}{
76-
"action": "stop",
77-
"services": []interface{}{"srv1", "srv3"},
77+
"action": "stop",
78+
"services": []interface{}{"srv1", "srv3"},
79+
"service-args": nil,
7880
})
7981

8082
fmt.Fprintf(w, `{"type": "error", "result": {"message": "could not foo"}}`)
@@ -95,8 +97,9 @@ func (s *PebbleSuite) TestStopNoWait(c *check.C) {
9597

9698
body := DecodedRequestBody(c, r)
9799
c.Check(body, check.DeepEquals, map[string]interface{}{
98-
"action": "stop",
99-
"services": []interface{}{"srv1", "srv2"},
100+
"action": "stop",
101+
"services": []interface{}{"srv1", "srv2"},
102+
"service-args": nil,
100103
})
101104

102105
fmt.Fprintf(w, `{
@@ -126,8 +129,9 @@ func (s *PebbleSuite) TestStopFailsGetChange(c *check.C) {
126129

127130
body := DecodedRequestBody(c, r)
128131
c.Check(body, check.DeepEquals, map[string]interface{}{
129-
"action": "stop",
130-
"services": []interface{}{"srv1", "srv2"},
132+
"action": "stop",
133+
"services": []interface{}{"srv1", "srv2"},
134+
"service-args": nil,
131135
})
132136

133137
fmt.Fprintf(w, `{

0 commit comments

Comments
 (0)