LEFT | RIGHT |
1 package main | 1 package main |
2 | 2 |
3 import ( | 3 import ( |
4 "errors" | 4 "errors" |
5 "flag" | 5 "flag" |
6 "fmt" | 6 "fmt" |
7 "io/ioutil" | 7 "io/ioutil" |
8 "launchpad.net/gnuflag" | 8 "launchpad.net/gnuflag" |
9 . "launchpad.net/gocheck" | 9 . "launchpad.net/gocheck" |
10 "launchpad.net/juju-core/cmd" | 10 "launchpad.net/juju-core/cmd" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 checkMessage(c, msgf, "--cheese", "cavitate") | 69 checkMessage(c, msgf, "--cheese", "cavitate") |
70 | 70 |
71 cmds := []string{"bootstrap-state", "unit", "machine"} | 71 cmds := []string{"bootstrap-state", "unit", "machine"} |
72 for _, cmd := range cmds { | 72 for _, cmd := range cmds { |
73 checkMessage(c, msgf, cmd, "--cheese") | 73 checkMessage(c, msgf, cmd, "--cheese") |
74 } | 74 } |
75 | 75 |
76 msga := `unrecognized args: ["toastie"]` | 76 msga := `unrecognized args: ["toastie"]` |
77 checkMessage(c, msga, | 77 checkMessage(c, msga, |
78 "bootstrap-state", | 78 "bootstrap-state", |
79 "--instance-id", "ii", | |
80 "--env-config", b64yaml{"blah": "blah"}.encode(), | 79 "--env-config", b64yaml{"blah": "blah"}.encode(), |
81 "toastie") | 80 "toastie") |
82 checkMessage(c, msga, "unit", | 81 checkMessage(c, msga, "unit", |
83 "--unit-name", "un/0", | 82 "--unit-name", "un/0", |
84 "toastie") | 83 "toastie") |
85 checkMessage(c, msga, "machine", | 84 checkMessage(c, msga, "machine", |
86 "--machine-id", "42", | 85 "--machine-id", "42", |
87 "toastie") | 86 "toastie") |
88 } | 87 } |
89 | 88 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 output := run(c, "", "bill", 1, "remote") | 216 output := run(c, "", "bill", 1, "remote") |
218 c.Assert(output, Equals, "error: JUJU_AGENT_SOCKET not set\n") | 217 c.Assert(output, Equals, "error: JUJU_AGENT_SOCKET not set\n") |
219 } | 218 } |
220 | 219 |
221 func (s *JujuCMainSuite) TestBadSockPath(c *C) { | 220 func (s *JujuCMainSuite) TestBadSockPath(c *C) { |
222 badSock := filepath.Join(c.MkDir(), "bad.sock") | 221 badSock := filepath.Join(c.MkDir(), "bad.sock") |
223 output := run(c, badSock, "bill", 1, "remote") | 222 output := run(c, badSock, "bill", 1, "remote") |
224 err := fmt.Sprintf("error: dial unix %s: .*\n", badSock) | 223 err := fmt.Sprintf("error: dial unix %s: .*\n", badSock) |
225 c.Assert(output, Matches, err) | 224 c.Assert(output, Matches, err) |
226 } | 225 } |
LEFT | RIGHT |