LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2013 Canonical Ltd. | 1 // Copyright 2013 Canonical Ltd. |
2 // Licensed under the AGPLv3, see LICENCE file for details. | 2 // Licensed under the AGPLv3, see LICENCE file for details. |
3 | 3 |
4 package main | 4 package main |
5 | 5 |
6 import ( | 6 import ( |
7 "fmt" | 7 "fmt" |
8 "strings" | 8 "strings" |
9 | 9 |
10 gc "launchpad.net/gocheck" | 10 gc "launchpad.net/gocheck" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 c.Assert(output, gc.Equals, "raring") | 161 c.Assert(output, gc.Equals, "raring") |
162 } | 162 } |
163 | 163 |
164 var immutableConfigTests = map[string]string{ | 164 var immutableConfigTests = map[string]string{ |
165 "name": "foo", | 165 "name": "foo", |
166 "type": "foo", | 166 "type": "foo", |
167 "firewall-mode": "global", | 167 "firewall-mode": "global", |
168 "state-port": "1", | 168 "state-port": "1", |
169 "api-port": "666", | 169 "api-port": "666", |
170 "syslog-port": "42", | |
171 } | 170 } |
172 | 171 |
173 func (s *SetEnvironmentSuite) TestImmutableConfigValues(c *gc.C) { | 172 func (s *SetEnvironmentSuite) TestImmutableConfigValues(c *gc.C) { |
174 for name, value := range immutableConfigTests { | 173 for name, value := range immutableConfigTests { |
175 param := fmt.Sprintf("%s=%s", name, value) | 174 param := fmt.Sprintf("%s=%s", name, value) |
176 _, err := testing.RunCommand(c, &SetEnvironmentCommand{}, []stri
ng{param}) | 175 _, err := testing.RunCommand(c, &SetEnvironmentCommand{}, []stri
ng{param}) |
177 errorPattern := fmt.Sprintf("cannot change %s from .* to [\"]?%v
[\"]?", name, value) | 176 errorPattern := fmt.Sprintf("cannot change %s from .* to [\"]?%v
[\"]?", name, value) |
178 c.Assert(err, gc.ErrorMatches, errorPattern) | 177 c.Assert(err, gc.ErrorMatches, errorPattern) |
179 } | 178 } |
180 } | 179 } |
LEFT | RIGHT |