It is wrong to pass an arbitrary string to a function expecting
%-style formatting. One solution would be to replace any % with %%,
but it's easier to just do what this patch does.
Generated with:
for f in $(git grep -l 'check.Commentf(out)'); do \
sed -i -e 's/check\.Commentf(out)/check.Commentf("%s", out)/g' $f; \
done
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
| ... | ... |
@@ -200,7 +200,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) SetUpTest(c *check.C) {
|
| 200 | 200 |
func (s *DockerRegistryAuthHtpasswdSuite) TearDownTest(c *check.C) {
|
| 201 | 201 |
if s.reg != nil {
|
| 202 | 202 |
out, err := s.d.Cmd("logout", privateRegistryURL)
|
| 203 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 203 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 204 | 204 |
s.reg.Close() |
| 205 | 205 |
} |
| 206 | 206 |
if s.d != nil {
|
| ... | ... |
@@ -233,7 +233,7 @@ func (s *DockerRegistryAuthTokenSuite) SetUpTest(c *check.C) {
|
| 233 | 233 |
func (s *DockerRegistryAuthTokenSuite) TearDownTest(c *check.C) {
|
| 234 | 234 |
if s.reg != nil {
|
| 235 | 235 |
out, err := s.d.Cmd("logout", privateRegistryURL)
|
| 236 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 236 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 237 | 237 |
s.reg.Close() |
| 238 | 238 |
} |
| 239 | 239 |
if s.d != nil {
|
| ... | ... |
@@ -156,7 +156,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdate(c *check.C) {
|
| 156 | 156 |
// create a different tag |
| 157 | 157 |
for _, d := range daemons {
|
| 158 | 158 |
out, err := d.Cmd("tag", image1, image2)
|
| 159 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 159 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 160 | 160 |
} |
| 161 | 161 |
|
| 162 | 162 |
// create service |
| ... | ... |
@@ -188,7 +188,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdate(c *check.C) {
|
| 188 | 188 |
// Roll back to the previous version. This uses the CLI because |
| 189 | 189 |
// rollback used to be a client-side operation. |
| 190 | 190 |
out, err := daemons[0].Cmd("service", "update", "--detach", "--rollback", id)
|
| 191 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 191 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 192 | 192 |
|
| 193 | 193 |
// first batch |
| 194 | 194 |
waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals, |
| ... | ... |
@@ -297,7 +297,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *check.C) {
|
| 297 | 297 |
// Roll back to the previous version. This uses the CLI because |
| 298 | 298 |
// rollback is a client-side operation. |
| 299 | 299 |
out, err := d.Cmd("service", "update", "--detach", "--rollback", id)
|
| 300 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 300 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 301 | 301 |
|
| 302 | 302 |
// first batch |
| 303 | 303 |
waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals, |
| ... | ... |
@@ -342,7 +342,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesFailedUpdate(c *check.C) {
|
| 342 | 342 |
// Roll back to the previous version. This uses the CLI because |
| 343 | 343 |
// rollback used to be a client-side operation. |
| 344 | 344 |
out, err := daemons[0].Cmd("service", "update", "--detach", "--rollback", id)
|
| 345 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 345 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 346 | 346 |
|
| 347 | 347 |
waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals, |
| 348 | 348 |
map[string]int{image1: instances})
|
| ... | ... |
@@ -923,7 +923,7 @@ func (s *DockerSwarmSuite) TestAPISwarmHealthcheckNone(c *check.C) {
|
| 923 | 923 |
d := s.AddDaemon(c, true, true) |
| 924 | 924 |
|
| 925 | 925 |
out, err := d.Cmd("network", "create", "-d", "overlay", "lb")
|
| 926 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 926 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 927 | 927 |
|
| 928 | 928 |
instances := 1 |
| 929 | 929 |
d.CreateService(c, simpleTestService, setInstances(instances), func(s *swarm.Service) {
|
| ... | ... |
@@ -941,7 +941,7 @@ func (s *DockerSwarmSuite) TestAPISwarmHealthcheckNone(c *check.C) {
|
| 941 | 941 |
containers := d.ActiveContainers(c) |
| 942 | 942 |
|
| 943 | 943 |
out, err = d.Cmd("exec", containers[0], "ping", "-c1", "-W3", "top")
|
| 944 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 944 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 945 | 945 |
} |
| 946 | 946 |
|
| 947 | 947 |
func (s *DockerSwarmSuite) TestSwarmRepeatedRootRotation(c *check.C) {
|
| ... | ... |
@@ -25,7 +25,7 @@ func (s *DockerSwarmSuite) TestConfigCreateWithFile(c *check.C) {
|
| 25 | 25 |
testName := "test_config" |
| 26 | 26 |
out, err := d.Cmd("config", "create", testName, testFile.Name())
|
| 27 | 27 |
c.Assert(err, checker.IsNil) |
| 28 |
- c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "", check.Commentf(out)) |
|
| 28 |
+ c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "", check.Commentf("%s", out))
|
|
| 29 | 29 |
|
| 30 | 30 |
id := strings.TrimSpace(out) |
| 31 | 31 |
config := d.GetConfig(c, id) |
| ... | ... |
@@ -243,7 +243,7 @@ func (s *DockerSuite) TestCpFromSymlinkToDirectory(c *check.C) {
|
| 243 | 243 |
if err == nil {
|
| 244 | 244 |
out = fmt.Sprintf("target name was copied: %q - %q", stat.Mode(), stat.Name())
|
| 245 | 245 |
} |
| 246 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 246 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 247 | 247 |
|
| 248 | 248 |
// It *should* have copied the directory using the asked name "dir_link". |
| 249 | 249 |
stat, err = os.Lstat(expectedPath) |
| ... | ... |
@@ -315,7 +315,7 @@ func (s *DockerSuite) TestCpToSymlinkToDirectory(c *check.C) {
|
| 315 | 315 |
if err == nil {
|
| 316 | 316 |
out = fmt.Sprintf("target name was copied: %q - %q", stat.Mode(), stat.Name())
|
| 317 | 317 |
} |
| 318 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 318 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 319 | 319 |
|
| 320 | 320 |
// It *should* have copied the directory using the asked name "dir_link". |
| 321 | 321 |
stat, err = os.Lstat(expectedPath) |
| ... | ... |
@@ -75,7 +75,7 @@ func (s *DockerSuite) TestCreateShrinkRootfs(c *check.C) {
|
| 75 | 75 |
|
| 76 | 76 |
// Ensure this fails because of the defaultBaseFsSize is 10G |
| 77 | 77 |
out, _, err := dockerCmdWithError("create", "--storage-opt", "size=5G", "busybox")
|
| 78 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 78 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 79 | 79 |
c.Assert(out, checker.Contains, "Container size cannot be smaller than") |
| 80 | 80 |
} |
| 81 | 81 |
|
| ... | ... |
@@ -225,10 +225,10 @@ func (s *DockerDaemonSuite) TestVolumePlugin(c *check.C) {
|
| 225 | 225 |
c.Assert(out, checker.Contains, pName) |
| 226 | 226 |
|
| 227 | 227 |
out, err = s.d.Cmd("run", "--rm", "-v", volName+":"+destDir, "busybox", "touch", destDir+destFile)
|
| 228 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 228 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 229 | 229 |
|
| 230 | 230 |
out, err = s.d.Cmd("run", "--rm", "-v", volName+":"+destDir, "busybox", "ls", destDir+destFile)
|
| 231 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 231 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 232 | 232 |
} |
| 233 | 233 |
|
| 234 | 234 |
func (s *DockerDaemonSuite) TestPluginVolumeRemoveOnRestart(c *check.C) {
|
| ... | ... |
@@ -237,26 +237,26 @@ func (s *DockerDaemonSuite) TestPluginVolumeRemoveOnRestart(c *check.C) {
|
| 237 | 237 |
s.d.Start(c, "--live-restore=true") |
| 238 | 238 |
|
| 239 | 239 |
out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pName)
|
| 240 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 240 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 241 | 241 |
c.Assert(strings.TrimSpace(out), checker.Contains, pName) |
| 242 | 242 |
|
| 243 | 243 |
out, err = s.d.Cmd("volume", "create", "--driver", pName, "test")
|
| 244 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 244 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 245 | 245 |
|
| 246 | 246 |
s.d.Restart(c, "--live-restore=true") |
| 247 | 247 |
|
| 248 | 248 |
out, err = s.d.Cmd("plugin", "disable", pName)
|
| 249 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 249 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 250 | 250 |
c.Assert(out, checker.Contains, "in use") |
| 251 | 251 |
|
| 252 | 252 |
out, err = s.d.Cmd("volume", "rm", "test")
|
| 253 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 253 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 254 | 254 |
|
| 255 | 255 |
out, err = s.d.Cmd("plugin", "disable", pName)
|
| 256 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 256 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 257 | 257 |
|
| 258 | 258 |
out, err = s.d.Cmd("plugin", "rm", pName)
|
| 259 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 259 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 260 | 260 |
} |
| 261 | 261 |
|
| 262 | 262 |
func existsMountpointWithPrefix(mountpointPrefix string) (bool, error) {
|
| ... | ... |
@@ -278,7 +278,7 @@ func (s *DockerDaemonSuite) TestPluginListFilterEnabled(c *check.C) {
|
| 278 | 278 |
s.d.Start(c) |
| 279 | 279 |
|
| 280 | 280 |
out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pNameWithTag, "--disable")
|
| 281 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 281 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 282 | 282 |
|
| 283 | 283 |
defer func() {
|
| 284 | 284 |
if out, err := s.d.Cmd("plugin", "remove", pNameWithTag); err != nil {
|
| ... | ... |
@@ -306,7 +306,7 @@ func (s *DockerDaemonSuite) TestPluginListFilterCapability(c *check.C) {
|
| 306 | 306 |
s.d.Start(c) |
| 307 | 307 |
|
| 308 | 308 |
out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pNameWithTag, "--disable")
|
| 309 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 309 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 310 | 310 |
|
| 311 | 311 |
defer func() {
|
| 312 | 312 |
if out, err := s.d.Cmd("plugin", "remove", pNameWithTag); err != nil {
|
| ... | ... |
@@ -142,10 +142,10 @@ func (s *DockerDaemonSuite) TestDaemonRestartUnlessStopped(c *check.C) {
|
| 142 | 142 |
testRun(map[string]bool{"top1": true, "top2": true}, "")
|
| 143 | 143 |
|
| 144 | 144 |
out, err = s.d.Cmd("stop", "top1")
|
| 145 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 145 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 146 | 146 |
|
| 147 | 147 |
out, err = s.d.Cmd("stop", "top2")
|
| 148 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 148 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 149 | 149 |
|
| 150 | 150 |
// both stopped |
| 151 | 151 |
testRun(map[string]bool{"top1": false, "top2": false}, "")
|
| ... | ... |
@@ -426,13 +426,13 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDR(c *check.C) {
|
| 426 | 426 |
out, err = s.d.Cmd("inspect", "--format", "{{.NetworkSettings.Networks.bridge.GlobalIPv6Address}}", "ipv6test")
|
| 427 | 427 |
out = strings.Trim(out, " \r\n'") |
| 428 | 428 |
|
| 429 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 429 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 430 | 430 |
|
| 431 | 431 |
ip := net.ParseIP(out) |
| 432 | 432 |
c.Assert(ip, checker.NotNil, check.Commentf("Container should have a global IPv6 address"))
|
| 433 | 433 |
|
| 434 | 434 |
out, err = s.d.Cmd("inspect", "--format", "{{.NetworkSettings.Networks.bridge.IPv6Gateway}}", "ipv6test")
|
| 435 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 435 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 436 | 436 |
|
| 437 | 437 |
c.Assert(strings.Trim(out, " \r\n'"), checker.Equals, "2001:db8:2::100", check.Commentf("Container should have a global IPv6 gateway"))
|
| 438 | 438 |
} |
| ... | ... |
@@ -738,7 +738,7 @@ func (s *DockerDaemonSuite) TestDaemonBridgeFixedCidr2(c *check.C) {
|
| 738 | 738 |
defer s.d.Restart(c) |
| 739 | 739 |
|
| 740 | 740 |
out, err := d.Cmd("run", "-d", "--name", "bb", "busybox", "top")
|
| 741 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 741 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 742 | 742 |
defer d.Cmd("stop", "bb")
|
| 743 | 743 |
|
| 744 | 744 |
out, err = d.Cmd("exec", "bb", "/bin/sh", "-c", "ifconfig eth0 | awk '/inet addr/{print substr($2,6)}'")
|
| ... | ... |
@@ -746,7 +746,7 @@ func (s *DockerDaemonSuite) TestDaemonBridgeFixedCidr2(c *check.C) {
|
| 746 | 746 |
c.Assert(out, checker.Equals, "10.2.2.0\n") |
| 747 | 747 |
|
| 748 | 748 |
out, err = d.Cmd("run", "--rm", "busybox", "/bin/sh", "-c", "ifconfig eth0 | awk '/inet addr/{print substr($2,6)}'")
|
| 749 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 749 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 750 | 750 |
c.Assert(out, checker.Equals, "10.2.2.2\n") |
| 751 | 751 |
} |
| 752 | 752 |
|
| ... | ... |
@@ -763,7 +763,7 @@ func (s *DockerDaemonSuite) TestDaemonBridgeFixedCIDREqualBridgeNetwork(c *check |
| 763 | 763 |
defer s.d.Restart(c) |
| 764 | 764 |
|
| 765 | 765 |
out, err := d.Cmd("run", "-d", "busybox", "top")
|
| 766 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 766 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 767 | 767 |
cid1 := strings.TrimSpace(out) |
| 768 | 768 |
defer d.Cmd("stop", cid1)
|
| 769 | 769 |
} |
| ... | ... |
@@ -924,10 +924,10 @@ func (s *DockerDaemonSuite) TestDaemonICCLinkExpose(c *check.C) {
|
| 924 | 924 |
check.Commentf("iptables output should have contained %q, but was %q", regex, result.Combined()))
|
| 925 | 925 |
|
| 926 | 926 |
out, err := d.Cmd("run", "-d", "--expose", "4567", "--name", "icc1", "busybox", "nc", "-l", "-p", "4567")
|
| 927 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 927 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 928 | 928 |
|
| 929 | 929 |
out, err = d.Cmd("run", "--link", "icc1:icc1", "busybox", "nc", "icc1", "4567")
|
| 930 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 930 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 931 | 931 |
} |
| 932 | 932 |
|
| 933 | 933 |
func (s *DockerDaemonSuite) TestDaemonLinksIpTablesRulesWhenLinkAndUnlink(c *check.C) {
|
| ... | ... |
@@ -1033,7 +1033,7 @@ func (s *DockerDaemonSuite) TestDaemonLoggingDriverDefault(c *check.C) {
|
| 1033 | 1033 |
s.d.StartWithBusybox(c) |
| 1034 | 1034 |
|
| 1035 | 1035 |
out, err := s.d.Cmd("run", "--name=test", "busybox", "echo", "testline")
|
| 1036 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1036 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1037 | 1037 |
id, err := s.d.GetIDByName("test")
|
| 1038 | 1038 |
c.Assert(err, check.IsNil) |
| 1039 | 1039 |
|
| ... | ... |
@@ -1145,7 +1145,7 @@ func (s *DockerDaemonSuite) TestDaemonLoggingDriverNoneLogsError(c *check.C) {
|
| 1145 | 1145 |
s.d.StartWithBusybox(c, "--log-driver=none") |
| 1146 | 1146 |
|
| 1147 | 1147 |
out, err := s.d.Cmd("run", "--name=test", "busybox", "echo", "testline")
|
| 1148 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1148 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1149 | 1149 |
|
| 1150 | 1150 |
out, err = s.d.Cmd("logs", "test")
|
| 1151 | 1151 |
c.Assert(err, check.NotNil, check.Commentf("Logs should fail with 'none' driver"))
|
| ... | ... |
@@ -1638,7 +1638,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartRmVolumeInUse(c *check.C) {
|
| 1638 | 1638 |
s.d.StartWithBusybox(c) |
| 1639 | 1639 |
|
| 1640 | 1640 |
out, err := s.d.Cmd("create", "-v", "test:/foo", "busybox")
|
| 1641 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1641 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1642 | 1642 |
|
| 1643 | 1643 |
s.d.Restart(c) |
| 1644 | 1644 |
|
| ... | ... |
@@ -1887,22 +1887,22 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithLinks(c *check.C) {
|
| 1887 | 1887 |
s.d.StartWithBusybox(c) |
| 1888 | 1888 |
|
| 1889 | 1889 |
out, err := s.d.Cmd("run", "-d", "--name=test", "busybox", "top")
|
| 1890 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1890 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1891 | 1891 |
|
| 1892 | 1892 |
out, err = s.d.Cmd("run", "--name=test2", "--link", "test:abc", "busybox", "sh", "-c", "ping -c 1 -w 1 abc")
|
| 1893 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1893 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1894 | 1894 |
|
| 1895 | 1895 |
s.d.Restart(c) |
| 1896 | 1896 |
|
| 1897 | 1897 |
// should fail since test is not running yet |
| 1898 | 1898 |
out, err = s.d.Cmd("start", "test2")
|
| 1899 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 1899 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 1900 | 1900 |
|
| 1901 | 1901 |
out, err = s.d.Cmd("start", "test")
|
| 1902 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1902 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1903 | 1903 |
out, err = s.d.Cmd("start", "-a", "test2")
|
| 1904 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1905 |
- c.Assert(strings.Contains(out, "1 packets transmitted, 1 packets received"), check.Equals, true, check.Commentf(out)) |
|
| 1904 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1905 |
+ c.Assert(strings.Contains(out, "1 packets transmitted, 1 packets received"), check.Equals, true, check.Commentf("%s", out))
|
|
| 1906 | 1906 |
} |
| 1907 | 1907 |
|
| 1908 | 1908 |
func (s *DockerDaemonSuite) TestDaemonRestartWithNames(c *check.C) {
|
| ... | ... |
@@ -1910,10 +1910,10 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithNames(c *check.C) {
|
| 1910 | 1910 |
s.d.StartWithBusybox(c) |
| 1911 | 1911 |
|
| 1912 | 1912 |
out, err := s.d.Cmd("create", "--name=test", "busybox")
|
| 1913 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1913 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1914 | 1914 |
|
| 1915 | 1915 |
out, err = s.d.Cmd("run", "-d", "--name=test2", "busybox", "top")
|
| 1916 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1916 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1917 | 1917 |
test2ID := strings.TrimSpace(out) |
| 1918 | 1918 |
|
| 1919 | 1919 |
out, err = s.d.Cmd("run", "-d", "--name=test3", "--link", "test2:abc", "busybox", "top")
|
| ... | ... |
@@ -1926,10 +1926,10 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithNames(c *check.C) {
|
| 1926 | 1926 |
c.Assert(err, check.NotNil, check.Commentf("expected error trying to create container with duplicate name"))
|
| 1927 | 1927 |
// this one is no longer needed, removing simplifies the remainder of the test |
| 1928 | 1928 |
out, err = s.d.Cmd("rm", "-f", "test")
|
| 1929 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1929 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1930 | 1930 |
|
| 1931 | 1931 |
out, err = s.d.Cmd("ps", "-a", "--no-trunc")
|
| 1932 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1932 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1933 | 1933 |
|
| 1934 | 1934 |
lines := strings.Split(strings.TrimSpace(out), "\n")[1:] |
| 1935 | 1935 |
|
| ... | ... |
@@ -2112,24 +2112,24 @@ func (s *DockerDaemonSuite) TestRunLinksChanged(c *check.C) {
|
| 2112 | 2112 |
s.d.StartWithBusybox(c) |
| 2113 | 2113 |
|
| 2114 | 2114 |
out, err := s.d.Cmd("run", "-d", "--name=test", "busybox", "top")
|
| 2115 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2115 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2116 | 2116 |
|
| 2117 | 2117 |
out, err = s.d.Cmd("run", "--name=test2", "--link=test:abc", "busybox", "sh", "-c", "ping -c 1 abc")
|
| 2118 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2118 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2119 | 2119 |
c.Assert(out, checker.Contains, "1 packets transmitted, 1 packets received") |
| 2120 | 2120 |
|
| 2121 | 2121 |
out, err = s.d.Cmd("rm", "-f", "test")
|
| 2122 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2122 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2123 | 2123 |
|
| 2124 | 2124 |
out, err = s.d.Cmd("run", "-d", "--name=test", "busybox", "top")
|
| 2125 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2125 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2126 | 2126 |
out, err = s.d.Cmd("start", "-a", "test2")
|
| 2127 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2127 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2128 | 2128 |
c.Assert(out, check.Not(checker.Contains), "1 packets transmitted, 1 packets received") |
| 2129 | 2129 |
|
| 2130 | 2130 |
s.d.Restart(c) |
| 2131 | 2131 |
out, err = s.d.Cmd("start", "-a", "test2")
|
| 2132 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2132 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2133 | 2133 |
c.Assert(out, check.Not(checker.Contains), "1 packets transmitted, 1 packets received") |
| 2134 | 2134 |
} |
| 2135 | 2135 |
|
| ... | ... |
@@ -2253,11 +2253,11 @@ func (s *DockerDaemonSuite) TestDaemonLogOptions(c *check.C) {
|
| 2253 | 2253 |
s.d.StartWithBusybox(c, "--log-driver=syslog", "--log-opt=syslog-address=udp://127.0.0.1:514") |
| 2254 | 2254 |
|
| 2255 | 2255 |
out, err := s.d.Cmd("run", "-d", "--log-driver=json-file", "busybox", "top")
|
| 2256 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2256 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2257 | 2257 |
id := strings.TrimSpace(out) |
| 2258 | 2258 |
|
| 2259 | 2259 |
out, err = s.d.Cmd("inspect", "--format='{{.HostConfig.LogConfig}}'", id)
|
| 2260 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2260 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2261 | 2261 |
c.Assert(out, checker.Contains, "{json-file map[]}")
|
| 2262 | 2262 |
} |
| 2263 | 2263 |
|
| ... | ... |
@@ -2428,19 +2428,19 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *check.C) {
|
| 2428 | 2428 |
|
| 2429 | 2429 |
// Run with default runtime |
| 2430 | 2430 |
out, err := s.d.Cmd("run", "--rm", "busybox", "ls")
|
| 2431 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2431 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2432 | 2432 |
|
| 2433 | 2433 |
// Run with default runtime explicitly |
| 2434 | 2434 |
out, err = s.d.Cmd("run", "--rm", "--runtime=runc", "busybox", "ls")
|
| 2435 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2435 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2436 | 2436 |
|
| 2437 | 2437 |
// Run with oci (same path as default) but keep it around |
| 2438 | 2438 |
out, err = s.d.Cmd("run", "--name", "oci-runtime-ls", "--runtime=oci", "busybox", "ls")
|
| 2439 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2439 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2440 | 2440 |
|
| 2441 | 2441 |
// Run with "vm" |
| 2442 | 2442 |
out, err = s.d.Cmd("run", "--rm", "--runtime=vm", "busybox", "ls")
|
| 2443 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2443 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2444 | 2444 |
c.Assert(out, checker.Contains, "/usr/local/bin/vm-manager: no such file or directory") |
| 2445 | 2445 |
|
| 2446 | 2446 |
// Reset config to only have the default |
| ... | ... |
@@ -2457,16 +2457,16 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *check.C) {
|
| 2457 | 2457 |
|
| 2458 | 2458 |
// Run with default runtime |
| 2459 | 2459 |
out, err = s.d.Cmd("run", "--rm", "--runtime=runc", "busybox", "ls")
|
| 2460 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2460 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2461 | 2461 |
|
| 2462 | 2462 |
// Run with "oci" |
| 2463 | 2463 |
out, err = s.d.Cmd("run", "--rm", "--runtime=oci", "busybox", "ls")
|
| 2464 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2464 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2465 | 2465 |
c.Assert(out, checker.Contains, "Unknown runtime specified oci") |
| 2466 | 2466 |
|
| 2467 | 2467 |
// Start previously created container with oci |
| 2468 | 2468 |
out, err = s.d.Cmd("start", "oci-runtime-ls")
|
| 2469 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2469 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2470 | 2470 |
c.Assert(out, checker.Contains, "Unknown runtime specified oci") |
| 2471 | 2471 |
|
| 2472 | 2472 |
// Check that we can't override the default runtime |
| ... | ... |
@@ -2511,12 +2511,12 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *check.C) {
|
| 2511 | 2511 |
<-time.After(1 * time.Second) |
| 2512 | 2512 |
|
| 2513 | 2513 |
out, err = s.d.Cmd("run", "--rm", "busybox", "ls")
|
| 2514 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2514 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2515 | 2515 |
c.Assert(out, checker.Contains, "/usr/local/bin/vm-manager: no such file or directory") |
| 2516 | 2516 |
|
| 2517 | 2517 |
// Run with default runtime explicitly |
| 2518 | 2518 |
out, err = s.d.Cmd("run", "--rm", "--runtime=runc", "busybox", "ls")
|
| 2519 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2519 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2520 | 2520 |
} |
| 2521 | 2521 |
|
| 2522 | 2522 |
func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *check.C) {
|
| ... | ... |
@@ -2524,19 +2524,19 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *check.C) {
|
| 2524 | 2524 |
|
| 2525 | 2525 |
// Run with default runtime |
| 2526 | 2526 |
out, err := s.d.Cmd("run", "--rm", "busybox", "ls")
|
| 2527 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2527 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2528 | 2528 |
|
| 2529 | 2529 |
// Run with default runtime explicitly |
| 2530 | 2530 |
out, err = s.d.Cmd("run", "--rm", "--runtime=runc", "busybox", "ls")
|
| 2531 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2531 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2532 | 2532 |
|
| 2533 | 2533 |
// Run with oci (same path as default) but keep it around |
| 2534 | 2534 |
out, err = s.d.Cmd("run", "--name", "oci-runtime-ls", "--runtime=oci", "busybox", "ls")
|
| 2535 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2535 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2536 | 2536 |
|
| 2537 | 2537 |
// Run with "vm" |
| 2538 | 2538 |
out, err = s.d.Cmd("run", "--rm", "--runtime=vm", "busybox", "ls")
|
| 2539 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2539 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2540 | 2540 |
c.Assert(out, checker.Contains, "/usr/local/bin/vm-manager: no such file or directory") |
| 2541 | 2541 |
|
| 2542 | 2542 |
// Start a daemon without any extra runtimes |
| ... | ... |
@@ -2545,16 +2545,16 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *check.C) {
|
| 2545 | 2545 |
|
| 2546 | 2546 |
// Run with default runtime |
| 2547 | 2547 |
out, err = s.d.Cmd("run", "--rm", "--runtime=runc", "busybox", "ls")
|
| 2548 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2548 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2549 | 2549 |
|
| 2550 | 2550 |
// Run with "oci" |
| 2551 | 2551 |
out, err = s.d.Cmd("run", "--rm", "--runtime=oci", "busybox", "ls")
|
| 2552 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2552 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2553 | 2553 |
c.Assert(out, checker.Contains, "Unknown runtime specified oci") |
| 2554 | 2554 |
|
| 2555 | 2555 |
// Start previously created container with oci |
| 2556 | 2556 |
out, err = s.d.Cmd("start", "oci-runtime-ls")
|
| 2557 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2557 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2558 | 2558 |
c.Assert(out, checker.Contains, "Unknown runtime specified oci") |
| 2559 | 2559 |
|
| 2560 | 2560 |
// Check that we can't override the default runtime |
| ... | ... |
@@ -2570,12 +2570,12 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *check.C) {
|
| 2570 | 2570 |
s.d.StartWithBusybox(c, "--default-runtime=vm", "--add-runtime", "oci=docker-runc", "--add-runtime", "vm=/usr/local/bin/vm-manager") |
| 2571 | 2571 |
|
| 2572 | 2572 |
out, err = s.d.Cmd("run", "--rm", "busybox", "ls")
|
| 2573 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 2573 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 2574 | 2574 |
c.Assert(out, checker.Contains, "/usr/local/bin/vm-manager: no such file or directory") |
| 2575 | 2575 |
|
| 2576 | 2576 |
// Run with default runtime explicitly |
| 2577 | 2577 |
out, err = s.d.Cmd("run", "--rm", "--runtime=runc", "busybox", "ls")
|
| 2578 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 2578 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 2579 | 2579 |
} |
| 2580 | 2580 |
|
| 2581 | 2581 |
func (s *DockerDaemonSuite) TestDaemonRestartWithAutoRemoveContainer(c *check.C) {
|
| ... | ... |
@@ -2658,17 +2658,17 @@ func (s *DockerDaemonSuite) TestDaemonWithUserlandProxyPath(c *check.C) {
|
| 2658 | 2658 |
// custom one |
| 2659 | 2659 |
s.d.StartWithBusybox(c, "--userland-proxy-path", newProxyPath) |
| 2660 | 2660 |
out, err := s.d.Cmd("run", "-p", "5000:5000", "busybox:latest", "true")
|
| 2661 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 2661 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 2662 | 2662 |
|
| 2663 | 2663 |
// try with the original one |
| 2664 | 2664 |
s.d.Restart(c, "--userland-proxy-path", dockerProxyPath) |
| 2665 | 2665 |
out, err = s.d.Cmd("run", "-p", "5000:5000", "busybox:latest", "true")
|
| 2666 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 2666 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 2667 | 2667 |
|
| 2668 | 2668 |
// not exist |
| 2669 | 2669 |
s.d.Restart(c, "--userland-proxy-path", "/does/not/exist") |
| 2670 | 2670 |
out, err = s.d.Cmd("run", "-p", "5000:5000", "busybox:latest", "true")
|
| 2671 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 2671 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 2672 | 2672 |
c.Assert(out, checker.Contains, "driver failed programming external connectivity on endpoint") |
| 2673 | 2673 |
c.Assert(out, checker.Contains, "/does/not/exist: no such file or directory") |
| 2674 | 2674 |
} |
| ... | ... |
@@ -50,11 +50,11 @@ func (s *DockerSuite) TestEventsTimestampFormats(c *check.C) {
|
| 50 | 50 |
containerEvents := eventActionsByIDAndType(c, events, name, "container") |
| 51 | 51 |
c.Assert(containerEvents, checker.HasLen, 5, check.Commentf("events: %v", events))
|
| 52 | 52 |
|
| 53 |
- c.Assert(containerEvents[0], checker.Equals, "create", check.Commentf(out)) |
|
| 54 |
- c.Assert(containerEvents[1], checker.Equals, "attach", check.Commentf(out)) |
|
| 55 |
- c.Assert(containerEvents[2], checker.Equals, "start", check.Commentf(out)) |
|
| 56 |
- c.Assert(containerEvents[3], checker.Equals, "die", check.Commentf(out)) |
|
| 57 |
- c.Assert(containerEvents[4], checker.Equals, "destroy", check.Commentf(out)) |
|
| 53 |
+ c.Assert(containerEvents[0], checker.Equals, "create", check.Commentf("%s", out))
|
|
| 54 |
+ c.Assert(containerEvents[1], checker.Equals, "attach", check.Commentf("%s", out))
|
|
| 55 |
+ c.Assert(containerEvents[2], checker.Equals, "start", check.Commentf("%s", out))
|
|
| 56 |
+ c.Assert(containerEvents[3], checker.Equals, "die", check.Commentf("%s", out))
|
|
| 57 |
+ c.Assert(containerEvents[4], checker.Equals, "destroy", check.Commentf("%s", out))
|
|
| 58 | 58 |
} |
| 59 | 59 |
} |
| 60 | 60 |
|
| ... | ... |
@@ -93,11 +93,11 @@ func (s *DockerSuite) TestEventsContainerEvents(c *check.C) {
|
| 93 | 93 |
containerEvents := eventActionsByIDAndType(c, events, "container-events-test", "container") |
| 94 | 94 |
c.Assert(containerEvents, checker.HasLen, 5, check.Commentf("events: %v", events))
|
| 95 | 95 |
|
| 96 |
- c.Assert(containerEvents[0], checker.Equals, "create", check.Commentf(out)) |
|
| 97 |
- c.Assert(containerEvents[1], checker.Equals, "attach", check.Commentf(out)) |
|
| 98 |
- c.Assert(containerEvents[2], checker.Equals, "start", check.Commentf(out)) |
|
| 99 |
- c.Assert(containerEvents[3], checker.Equals, "die", check.Commentf(out)) |
|
| 100 |
- c.Assert(containerEvents[4], checker.Equals, "destroy", check.Commentf(out)) |
|
| 96 |
+ c.Assert(containerEvents[0], checker.Equals, "create", check.Commentf("%s", out))
|
|
| 97 |
+ c.Assert(containerEvents[1], checker.Equals, "attach", check.Commentf("%s", out))
|
|
| 98 |
+ c.Assert(containerEvents[2], checker.Equals, "start", check.Commentf("%s", out))
|
|
| 99 |
+ c.Assert(containerEvents[3], checker.Equals, "die", check.Commentf("%s", out))
|
|
| 100 |
+ c.Assert(containerEvents[4], checker.Equals, "destroy", check.Commentf("%s", out))
|
|
| 101 | 101 |
} |
| 102 | 102 |
|
| 103 | 103 |
func (s *DockerSuite) TestEventsContainerEventsAttrSort(c *check.C) {
|
| ... | ... |
@@ -136,11 +136,11 @@ func (s *DockerSuite) TestEventsContainerEventsSinceUnixEpoch(c *check.C) {
|
| 136 | 136 |
containerEvents := eventActionsByIDAndType(c, events, "since-epoch-test", "container") |
| 137 | 137 |
c.Assert(containerEvents, checker.HasLen, 5, check.Commentf("events: %v", events))
|
| 138 | 138 |
|
| 139 |
- c.Assert(containerEvents[0], checker.Equals, "create", check.Commentf(out)) |
|
| 140 |
- c.Assert(containerEvents[1], checker.Equals, "attach", check.Commentf(out)) |
|
| 141 |
- c.Assert(containerEvents[2], checker.Equals, "start", check.Commentf(out)) |
|
| 142 |
- c.Assert(containerEvents[3], checker.Equals, "die", check.Commentf(out)) |
|
| 143 |
- c.Assert(containerEvents[4], checker.Equals, "destroy", check.Commentf(out)) |
|
| 139 |
+ c.Assert(containerEvents[0], checker.Equals, "create", check.Commentf("%s", out))
|
|
| 140 |
+ c.Assert(containerEvents[1], checker.Equals, "attach", check.Commentf("%s", out))
|
|
| 141 |
+ c.Assert(containerEvents[2], checker.Equals, "start", check.Commentf("%s", out))
|
|
| 142 |
+ c.Assert(containerEvents[3], checker.Equals, "die", check.Commentf("%s", out))
|
|
| 143 |
+ c.Assert(containerEvents[4], checker.Equals, "destroy", check.Commentf("%s", out))
|
|
| 144 | 144 |
} |
| 145 | 145 |
|
| 146 | 146 |
func (s *DockerSuite) TestEventsImageTag(c *check.C) {
|
| ... | ... |
@@ -262,10 +262,10 @@ func (s *DockerSuite) TestEventsPluginOps(c *check.C) {
|
| 262 | 262 |
pluginEvents := eventActionsByIDAndType(c, events, pNameWithTag, "plugin") |
| 263 | 263 |
c.Assert(pluginEvents, checker.HasLen, 4, check.Commentf("events: %v", events))
|
| 264 | 264 |
|
| 265 |
- c.Assert(pluginEvents[0], checker.Equals, "pull", check.Commentf(out)) |
|
| 266 |
- c.Assert(pluginEvents[1], checker.Equals, "enable", check.Commentf(out)) |
|
| 267 |
- c.Assert(pluginEvents[2], checker.Equals, "disable", check.Commentf(out)) |
|
| 268 |
- c.Assert(pluginEvents[3], checker.Equals, "remove", check.Commentf(out)) |
|
| 265 |
+ c.Assert(pluginEvents[0], checker.Equals, "pull", check.Commentf("%s", out))
|
|
| 266 |
+ c.Assert(pluginEvents[1], checker.Equals, "enable", check.Commentf("%s", out))
|
|
| 267 |
+ c.Assert(pluginEvents[2], checker.Equals, "disable", check.Commentf("%s", out))
|
|
| 268 |
+ c.Assert(pluginEvents[3], checker.Equals, "remove", check.Commentf("%s", out))
|
|
| 269 | 269 |
} |
| 270 | 270 |
|
| 271 | 271 |
func (s *DockerSuite) TestEventsFilters(c *check.C) {
|
| ... | ... |
@@ -633,7 +633,7 @@ func (s *DockerSuite) TestEventsSpecialFiltersWithExecCreate(c *check.C) {
|
| 633 | 633 |
) |
| 634 | 634 |
|
| 635 | 635 |
events := strings.Split(strings.TrimSpace(out), "\n") |
| 636 |
- c.Assert(len(events), checker.Equals, 1, check.Commentf(out)) |
|
| 636 |
+ c.Assert(len(events), checker.Equals, 1, check.Commentf("%s", out))
|
|
| 637 | 637 |
|
| 638 | 638 |
out, _ = dockerCmd( |
| 639 | 639 |
c, |
| ... | ... |
@@ -643,7 +643,7 @@ func (s *DockerSuite) TestEventsSpecialFiltersWithExecCreate(c *check.C) {
|
| 643 | 643 |
"--filter", |
| 644 | 644 |
"event=exec_create", |
| 645 | 645 |
) |
| 646 |
- c.Assert(len(events), checker.Equals, 1, check.Commentf(out)) |
|
| 646 |
+ c.Assert(len(events), checker.Equals, 1, check.Commentf("%s", out))
|
|
| 647 | 647 |
} |
| 648 | 648 |
|
| 649 | 649 |
func (s *DockerSuite) TestEventsFilterImageInContainerAction(c *check.C) {
|
| ... | ... |
@@ -653,7 +653,7 @@ func (s *DockerSuite) TestEventsFilterImageInContainerAction(c *check.C) {
|
| 653 | 653 |
|
| 654 | 654 |
out, _ := dockerCmd(c, "events", "--filter", "image=busybox", "--since", since, "--until", daemonUnixTime(c)) |
| 655 | 655 |
events := strings.Split(strings.TrimSpace(out), "\n") |
| 656 |
- c.Assert(len(events), checker.GreaterThan, 1, check.Commentf(out)) |
|
| 656 |
+ c.Assert(len(events), checker.GreaterThan, 1, check.Commentf("%s", out))
|
|
| 657 | 657 |
} |
| 658 | 658 |
|
| 659 | 659 |
func (s *DockerSuite) TestEventsContainerRestart(c *check.C) {
|
| ... | ... |
@@ -135,8 +135,8 @@ func (s *DockerSuite) TestEventsContainerFilterByName(c *check.C) {
|
| 135 | 135 |
c2 := strings.TrimSpace(cOut) |
| 136 | 136 |
waitRun("bar")
|
| 137 | 137 |
out, _ := dockerCmd(c, "events", "-f", "container=foo", "--since=0", "--until", daemonUnixTime(c)) |
| 138 |
- c.Assert(out, checker.Contains, c1, check.Commentf(out)) |
|
| 139 |
- c.Assert(out, checker.Not(checker.Contains), c2, check.Commentf(out)) |
|
| 138 |
+ c.Assert(out, checker.Contains, c1, check.Commentf("%s", out))
|
|
| 139 |
+ c.Assert(out, checker.Not(checker.Contains), c2, check.Commentf("%s", out))
|
|
| 140 | 140 |
} |
| 141 | 141 |
|
| 142 | 142 |
// #18453 |
| ... | ... |
@@ -351,7 +351,7 @@ func (s *DockerSuite) TestEventsFilterVolumeAndNetworkType(c *check.C) {
|
| 351 | 351 |
|
| 352 | 352 |
out, _ := dockerCmd(c, "events", "--filter", "type=volume", "--filter", "type=network", "--since", since, "--until", daemonUnixTime(c)) |
| 353 | 353 |
events := strings.Split(strings.TrimSpace(out), "\n") |
| 354 |
- c.Assert(len(events), checker.GreaterOrEqualThan, 2, check.Commentf(out)) |
|
| 354 |
+ c.Assert(len(events), checker.GreaterOrEqualThan, 2, check.Commentf("%s", out))
|
|
| 355 | 355 |
|
| 356 | 356 |
networkActions := eventActionsByIDAndType(c, events, "test-event-network-type", "network") |
| 357 | 357 |
volumeActions := eventActionsByIDAndType(c, events, "test-event-volume-type", "volume") |
| ... | ... |
@@ -164,7 +164,7 @@ func (s *DockerSuite) TestExecTTYCloseStdin(c *check.C) {
|
| 164 | 164 |
stdinRw.Close() |
| 165 | 165 |
|
| 166 | 166 |
out, _, err := runCommandWithOutput(cmd) |
| 167 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 167 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 168 | 168 |
|
| 169 | 169 |
out, _ = dockerCmd(c, "top", "exec_tty_stdin") |
| 170 | 170 |
outArr := strings.Split(out, "\n") |
| ... | ... |
@@ -517,7 +517,7 @@ func (s *DockerSuite) TestExecStartFails(c *check.C) {
|
| 517 | 517 |
c.Assert(waitRun(name), checker.IsNil) |
| 518 | 518 |
|
| 519 | 519 |
out, _, err := dockerCmdWithError("exec", name, "no-such-cmd")
|
| 520 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 520 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 521 | 521 |
c.Assert(out, checker.Contains, "executable file not found") |
| 522 | 522 |
} |
| 523 | 523 |
|
| ... | ... |
@@ -298,7 +298,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverNamed(c *check.C) {
|
| 298 | 298 |
s.d.StartWithBusybox(c) |
| 299 | 299 |
|
| 300 | 300 |
out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
|
| 301 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 301 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 302 | 302 |
c.Assert(out, checker.Contains, s.Server.URL) |
| 303 | 303 |
|
| 304 | 304 |
_, err = s.d.Cmd("volume", "rm", "external-volume-test")
|
| ... | ... |
@@ -320,7 +320,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnnamed(c *check.C) |
| 320 | 320 |
s.d.StartWithBusybox(c) |
| 321 | 321 |
|
| 322 | 322 |
out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
|
| 323 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 323 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 324 | 324 |
c.Assert(out, checker.Contains, s.Server.URL) |
| 325 | 325 |
|
| 326 | 326 |
c.Assert(s.ec.activations, checker.Equals, 1) |
| ... | ... |
@@ -334,13 +334,13 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverVolumesFrom(c *check |
| 334 | 334 |
s.d.StartWithBusybox(c) |
| 335 | 335 |
|
| 336 | 336 |
out, err := s.d.Cmd("run", "--name", "vol-test1", "-v", "/foo", "--volume-driver", volumePluginName, "busybox:latest")
|
| 337 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 337 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 338 | 338 |
|
| 339 | 339 |
out, err = s.d.Cmd("run", "--rm", "--volumes-from", "vol-test1", "--name", "vol-test2", "busybox", "ls", "/tmp")
|
| 340 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 340 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 341 | 341 |
|
| 342 | 342 |
out, err = s.d.Cmd("rm", "-fv", "vol-test1")
|
| 343 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 343 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 344 | 344 |
|
| 345 | 345 |
c.Assert(s.ec.activations, checker.Equals, 1) |
| 346 | 346 |
c.Assert(s.ec.creations, checker.Equals, 1) |
| ... | ... |
@@ -353,10 +353,10 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverDeleteContainer(c *c |
| 353 | 353 |
s.d.StartWithBusybox(c) |
| 354 | 354 |
|
| 355 | 355 |
out, err := s.d.Cmd("run", "--name", "vol-test1", "-v", "/foo", "--volume-driver", volumePluginName, "busybox:latest")
|
| 356 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 356 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 357 | 357 |
|
| 358 | 358 |
out, err = s.d.Cmd("rm", "-fv", "vol-test1")
|
| 359 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 359 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 360 | 360 |
|
| 361 | 361 |
c.Assert(s.ec.activations, checker.Equals, 1) |
| 362 | 362 |
c.Assert(s.ec.creations, checker.Equals, 1) |
| ... | ... |
@@ -453,7 +453,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverBindExternalVolume(c |
| 453 | 453 |
} |
| 454 | 454 |
out := inspectFieldJSON(c, "testing", "Mounts") |
| 455 | 455 |
c.Assert(json.NewDecoder(strings.NewReader(out)).Decode(&mounts), checker.IsNil) |
| 456 |
- c.Assert(len(mounts), checker.Equals, 1, check.Commentf(out)) |
|
| 456 |
+ c.Assert(len(mounts), checker.Equals, 1, check.Commentf("%s", out))
|
|
| 457 | 457 |
c.Assert(mounts[0].Name, checker.Equals, "foo") |
| 458 | 458 |
c.Assert(mounts[0].Driver, checker.Equals, volumePluginName) |
| 459 | 459 |
} |
| ... | ... |
@@ -474,7 +474,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverList(c *check.C) {
|
| 474 | 474 |
|
| 475 | 475 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGet(c *check.C) {
|
| 476 | 476 |
out, _, err := dockerCmdWithError("volume", "inspect", "dummy")
|
| 477 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 477 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 478 | 478 |
c.Assert(out, checker.Contains, "No such volume") |
| 479 | 479 |
c.Assert(s.ec.gets, check.Equals, 1) |
| 480 | 480 |
|
| ... | ... |
@@ -509,10 +509,10 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGetEmptyResponse(c * |
| 509 | 509 |
s.d.Start(c) |
| 510 | 510 |
|
| 511 | 511 |
out, err := s.d.Cmd("volume", "create", "-d", volumePluginName, "abc2", "--opt", "ninja=1")
|
| 512 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 512 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 513 | 513 |
|
| 514 | 514 |
out, err = s.d.Cmd("volume", "inspect", "abc2")
|
| 515 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 515 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 516 | 516 |
c.Assert(out, checker.Contains, "No such volume") |
| 517 | 517 |
} |
| 518 | 518 |
|
| ... | ... |
@@ -525,11 +525,11 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverPathCalls(c *check.C |
| 525 | 525 |
c.Assert(s.ec.paths, checker.Equals, 0) |
| 526 | 526 |
|
| 527 | 527 |
out, err := s.d.Cmd("volume", "create", "test", "--driver=test-external-volume-driver")
|
| 528 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 528 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 529 | 529 |
c.Assert(s.ec.paths, checker.Equals, 0) |
| 530 | 530 |
|
| 531 | 531 |
out, err = s.d.Cmd("volume", "ls")
|
| 532 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 532 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 533 | 533 |
c.Assert(s.ec.paths, checker.Equals, 0) |
| 534 | 534 |
} |
| 535 | 535 |
|
| ... | ... |
@@ -537,7 +537,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverMountID(c *check.C) |
| 537 | 537 |
s.d.StartWithBusybox(c) |
| 538 | 538 |
|
| 539 | 539 |
out, err := s.d.Cmd("run", "--rm", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
|
| 540 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 540 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 541 | 541 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 542 | 542 |
} |
| 543 | 543 |
|
| ... | ... |
@@ -548,7 +548,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverCapabilities(c *chec |
| 548 | 548 |
|
| 549 | 549 |
for i := 0; i < 3; i++ {
|
| 550 | 550 |
out, err := s.d.Cmd("volume", "create", "-d", volumePluginName, fmt.Sprintf("test%d", i))
|
| 551 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 551 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 552 | 552 |
c.Assert(s.ec.caps, checker.Equals, 1) |
| 553 | 553 |
out, err = s.d.Cmd("volume", "inspect", "--format={{.Scope}}", fmt.Sprintf("test%d", i))
|
| 554 | 554 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -564,10 +564,10 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *c |
| 564 | 564 |
s.d.StartWithBusybox(c) |
| 565 | 565 |
|
| 566 | 566 |
out, err := s.d.Cmd("volume", "create", "-d", driverName, "--name", "test")
|
| 567 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 567 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 568 | 568 |
|
| 569 | 569 |
out, err = s.d.Cmd("volume", "create", "-d", "local", "--name", "test")
|
| 570 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 570 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 571 | 571 |
c.Assert(out, checker.Contains, "must be unique") |
| 572 | 572 |
|
| 573 | 573 |
// simulate out of band volume deletion on plugin level |
| ... | ... |
@@ -575,9 +575,9 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *c |
| 575 | 575 |
|
| 576 | 576 |
// test re-create with same driver |
| 577 | 577 |
out, err = s.d.Cmd("volume", "create", "-d", driverName, "--opt", "foo=bar", "--name", "test")
|
| 578 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 578 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 579 | 579 |
out, err = s.d.Cmd("volume", "inspect", "test")
|
| 580 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 580 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 581 | 581 |
|
| 582 | 582 |
var vs []types.Volume |
| 583 | 583 |
err = json.Unmarshal([]byte(out), &vs) |
| ... | ... |
@@ -593,10 +593,10 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *c |
| 593 | 593 |
|
| 594 | 594 |
// test create with different driver |
| 595 | 595 |
out, err = s.d.Cmd("volume", "create", "-d", "local", "--name", "test")
|
| 596 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 596 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 597 | 597 |
|
| 598 | 598 |
out, err = s.d.Cmd("volume", "inspect", "test")
|
| 599 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 599 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 600 | 600 |
vs = nil |
| 601 | 601 |
err = json.Unmarshal([]byte(out), &vs) |
| 602 | 602 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -610,9 +610,9 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnMountFail(c |
| 610 | 610 |
s.d.Cmd("volume", "create", "-d", "test-external-volume-driver", "--opt=invalidOption=1", "--name=testumount")
|
| 611 | 611 |
|
| 612 | 612 |
out, _ := s.d.Cmd("run", "-v", "testumount:/foo", "busybox", "true")
|
| 613 |
- c.Assert(s.ec.unmounts, checker.Equals, 0, check.Commentf(out)) |
|
| 613 |
+ c.Assert(s.ec.unmounts, checker.Equals, 0, check.Commentf("%s", out))
|
|
| 614 | 614 |
out, _ = s.d.Cmd("run", "-w", "/foo", "-v", "testumount:/foo", "busybox", "true")
|
| 615 |
- c.Assert(s.ec.unmounts, checker.Equals, 0, check.Commentf(out)) |
|
| 615 |
+ c.Assert(s.ec.unmounts, checker.Equals, 0, check.Commentf("%s", out))
|
|
| 616 | 616 |
} |
| 617 | 617 |
|
| 618 | 618 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnCp(c *check.C) {
|
| ... | ... |
@@ -620,12 +620,12 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnCp(c *check |
| 620 | 620 |
s.d.Cmd("volume", "create", "-d", "test-external-volume-driver", "--name=test")
|
| 621 | 621 |
|
| 622 | 622 |
out, _ := s.d.Cmd("run", "-d", "--name=test", "-v", "test:/foo", "busybox", "/bin/sh", "-c", "touch /test && top")
|
| 623 |
- c.Assert(s.ec.mounts, checker.Equals, 1, check.Commentf(out)) |
|
| 623 |
+ c.Assert(s.ec.mounts, checker.Equals, 1, check.Commentf("%s", out))
|
|
| 624 | 624 |
|
| 625 | 625 |
out, _ = s.d.Cmd("cp", "test:/test", "/tmp/test")
|
| 626 |
- c.Assert(s.ec.mounts, checker.Equals, 2, check.Commentf(out)) |
|
| 627 |
- c.Assert(s.ec.unmounts, checker.Equals, 1, check.Commentf(out)) |
|
| 626 |
+ c.Assert(s.ec.mounts, checker.Equals, 2, check.Commentf("%s", out))
|
|
| 627 |
+ c.Assert(s.ec.unmounts, checker.Equals, 1, check.Commentf("%s", out))
|
|
| 628 | 628 |
|
| 629 | 629 |
out, _ = s.d.Cmd("kill", "test")
|
| 630 |
- c.Assert(s.ec.unmounts, checker.Equals, 2, check.Commentf(out)) |
|
| 630 |
+ c.Assert(s.ec.unmounts, checker.Equals, 2, check.Commentf("%s", out))
|
|
| 631 | 631 |
} |
| ... | ... |
@@ -22,7 +22,7 @@ func (s *DockerSuite) TestLoginWithoutTTY(c *check.C) {
|
| 22 | 22 |
func (s *DockerRegistryAuthHtpasswdSuite) TestLoginToPrivateRegistry(c *check.C) {
|
| 23 | 23 |
// wrong credentials |
| 24 | 24 |
out, _, err := dockerCmdWithError("login", "-u", s.reg.Username(), "-p", "WRONGPASSWORD", privateRegistryURL)
|
| 25 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 25 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 26 | 26 |
c.Assert(out, checker.Contains, "401 Unauthorized") |
| 27 | 27 |
|
| 28 | 28 |
// now it's fine |
| ... | ... |
@@ -59,7 +59,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestLogoutWithExternalAuth(c *check.C) |
| 59 | 59 |
|
| 60 | 60 |
// check I cannot pull anymore |
| 61 | 61 |
out, err := s.d.Cmd("--config", tmp, "pull", repoName)
|
| 62 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 62 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 63 | 63 |
c.Assert(out, checker.Contains, "no basic auth credentials") |
| 64 | 64 |
} |
| 65 | 65 |
|
| ... | ... |
@@ -327,7 +327,7 @@ func (s *DockerSuite) TestLogsWithDetails(c *check.C) {
|
| 327 | 327 |
out, _ := dockerCmd(c, "logs", "--details", "--timestamps", "test") |
| 328 | 328 |
|
| 329 | 329 |
logFields := strings.Fields(strings.TrimSpace(out)) |
| 330 |
- c.Assert(len(logFields), checker.Equals, 3, check.Commentf(out)) |
|
| 330 |
+ c.Assert(len(logFields), checker.Equals, 3, check.Commentf("%s", out))
|
|
| 331 | 331 |
|
| 332 | 332 |
details := strings.Split(logFields[1], ",") |
| 333 | 333 |
c.Assert(details, checker.HasLen, 2) |
| ... | ... |
@@ -847,11 +847,11 @@ func (s *DockerDaemonSuite) TestDockerNetworkNoDiscoveryDefaultBridgeNetwork(c * |
| 847 | 847 |
// but discovery is on when connecting to non default bridge network |
| 848 | 848 |
network := "anotherbridge" |
| 849 | 849 |
out, err = s.d.Cmd("network", "create", network)
|
| 850 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 850 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 851 | 851 |
defer s.d.Cmd("network", "rm", network)
|
| 852 | 852 |
|
| 853 | 853 |
out, err = s.d.Cmd("network", "connect", network, cid1)
|
| 854 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 854 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 855 | 855 |
|
| 856 | 856 |
hosts, err = s.d.Cmd("exec", cid1, "cat", hostsFile)
|
| 857 | 857 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -1063,14 +1063,14 @@ func (s *DockerSuite) TestInspectAPIMultipleNetworks(c *check.C) {
|
| 1063 | 1063 |
func connectContainerToNetworks(c *check.C, d *daemon.Daemon, cName string, nws []string) {
|
| 1064 | 1064 |
// Run a container on the default network |
| 1065 | 1065 |
out, err := d.Cmd("run", "-d", "--name", cName, "busybox", "top")
|
| 1066 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1066 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1067 | 1067 |
|
| 1068 | 1068 |
// Attach the container to other networks |
| 1069 | 1069 |
for _, nw := range nws {
|
| 1070 | 1070 |
out, err = d.Cmd("network", "create", nw)
|
| 1071 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1071 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1072 | 1072 |
out, err = d.Cmd("network", "connect", nw, cName)
|
| 1073 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1073 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1074 | 1074 |
} |
| 1075 | 1075 |
} |
| 1076 | 1076 |
|
| ... | ... |
@@ -1078,7 +1078,7 @@ func verifyContainerIsConnectedToNetworks(c *check.C, d *daemon.Daemon, cName st |
| 1078 | 1078 |
// Verify container is connected to all the networks |
| 1079 | 1079 |
for _, nw := range nws {
|
| 1080 | 1080 |
out, err := d.Cmd("inspect", "-f", fmt.Sprintf("{{.NetworkSettings.Networks.%s}}", nw), cName)
|
| 1081 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1081 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1082 | 1082 |
c.Assert(out, checker.Not(checker.Equals), "<no value>\n") |
| 1083 | 1083 |
} |
| 1084 | 1084 |
} |
| ... | ... |
@@ -1137,7 +1137,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkHostModeUngracefulDaemonRestart(c |
| 1137 | 1137 |
for i := 0; i < 10; i++ {
|
| 1138 | 1138 |
cName := fmt.Sprintf("hostc-%d", i)
|
| 1139 | 1139 |
out, err := s.d.Cmd("run", "-d", "--name", cName, "--net=host", "--restart=always", "busybox", "top")
|
| 1140 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1140 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1141 | 1141 |
|
| 1142 | 1142 |
// verify container has finished starting before killing daemon |
| 1143 | 1143 |
err = s.d.WaitRun(cName) |
| ... | ... |
@@ -1160,7 +1160,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectToHostFromOtherNetwork(c *c |
| 1160 | 1160 |
c.Assert(waitRun("container1"), check.IsNil)
|
| 1161 | 1161 |
dockerCmd(c, "network", "disconnect", "bridge", "container1") |
| 1162 | 1162 |
out, _, err := dockerCmdWithError("network", "connect", "host", "container1")
|
| 1163 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 1163 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 1164 | 1164 |
c.Assert(out, checker.Contains, runconfig.ErrConflictHostNetwork.Error()) |
| 1165 | 1165 |
} |
| 1166 | 1166 |
|
| ... | ... |
@@ -449,7 +449,7 @@ func (s *DockerSuite) TestPluginUpgrade(c *check.C) {
|
| 449 | 449 |
dockerCmd(c, "run", "--rm", "-v", "bananas:/apple", "busybox", "sh", "-c", "touch /apple/core") |
| 450 | 450 |
|
| 451 | 451 |
out, _, err := dockerCmdWithError("plugin", "upgrade", "--grant-all-permissions", plugin, pluginV2)
|
| 452 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 452 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 453 | 453 |
c.Assert(out, checker.Contains, "disabled before upgrading") |
| 454 | 454 |
|
| 455 | 455 |
out, _ = dockerCmd(c, "plugin", "inspect", "--format={{.ID}}", plugin)
|
| ... | ... |
@@ -457,7 +457,7 @@ func (s *DockerSuite) TestPluginUpgrade(c *check.C) {
|
| 457 | 457 |
|
| 458 | 458 |
// make sure "v2" does not exists |
| 459 | 459 |
_, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id, "rootfs", "v2")) |
| 460 |
- c.Assert(os.IsNotExist(err), checker.True, check.Commentf(out)) |
|
| 460 |
+ c.Assert(os.IsNotExist(err), checker.True, check.Commentf("%s", out))
|
|
| 461 | 461 |
|
| 462 | 462 |
dockerCmd(c, "plugin", "disable", "-f", plugin) |
| 463 | 463 |
dockerCmd(c, "plugin", "upgrade", "--grant-all-permissions", "--skip-remote-check", plugin, pluginV2) |
| ... | ... |
@@ -282,7 +282,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPushNoCredentialsNoRetry(c *check. |
| 282 | 282 |
repoName := fmt.Sprintf("%s/busybox", privateRegistryURL)
|
| 283 | 283 |
dockerCmd(c, "tag", "busybox", repoName) |
| 284 | 284 |
out, _, err := dockerCmdWithError("push", repoName)
|
| 285 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 285 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 286 | 286 |
c.Assert(out, check.Not(checker.Contains), "Retrying") |
| 287 | 287 |
c.Assert(out, checker.Contains, "no basic auth credentials") |
| 288 | 288 |
} |
| ... | ... |
@@ -293,7 +293,7 @@ func (s *DockerSuite) TestPushToCentralRegistryUnauthorized(c *check.C) {
|
| 293 | 293 |
repoName := "test/busybox" |
| 294 | 294 |
dockerCmd(c, "tag", "busybox", repoName) |
| 295 | 295 |
out, _, err := dockerCmdWithError("push", repoName)
|
| 296 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 296 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 297 | 297 |
c.Assert(out, check.Not(checker.Contains), "Retrying") |
| 298 | 298 |
} |
| 299 | 299 |
|
| ... | ... |
@@ -322,7 +322,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushTokenServiceUnauthResponse(c *che |
| 322 | 322 |
repoName := fmt.Sprintf("%s/busybox", privateRegistryURL)
|
| 323 | 323 |
dockerCmd(c, "tag", "busybox", repoName) |
| 324 | 324 |
out, _, err := dockerCmdWithError("push", repoName)
|
| 325 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 325 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 326 | 326 |
c.Assert(out, checker.Not(checker.Contains), "Retrying") |
| 327 | 327 |
c.Assert(out, checker.Contains, "unauthorized: a message") |
| 328 | 328 |
} |
| ... | ... |
@@ -334,7 +334,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponse |
| 334 | 334 |
repoName := fmt.Sprintf("%s/busybox", privateRegistryURL)
|
| 335 | 335 |
dockerCmd(c, "tag", "busybox", repoName) |
| 336 | 336 |
out, _, err := dockerCmdWithError("push", repoName)
|
| 337 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 337 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 338 | 338 |
c.Assert(out, checker.Not(checker.Contains), "Retrying") |
| 339 | 339 |
split := strings.Split(out, "\n") |
| 340 | 340 |
c.Assert(split[len(split)-2], check.Equals, "unauthorized: authentication required") |
| ... | ... |
@@ -347,7 +347,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponse |
| 347 | 347 |
repoName := fmt.Sprintf("%s/busybox", privateRegistryURL)
|
| 348 | 348 |
dockerCmd(c, "tag", "busybox", repoName) |
| 349 | 349 |
out, _, err := dockerCmdWithError("push", repoName)
|
| 350 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 350 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 351 | 351 |
// TODO: isolate test so that it can be guaranteed that the 503 will trigger xfer retries |
| 352 | 352 |
//c.Assert(out, checker.Contains, "Retrying") |
| 353 | 353 |
//c.Assert(out, checker.Not(checker.Contains), "Retrying in 15") |
| ... | ... |
@@ -362,7 +362,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponse |
| 362 | 362 |
repoName := fmt.Sprintf("%s/busybox", privateRegistryURL)
|
| 363 | 363 |
dockerCmd(c, "tag", "busybox", repoName) |
| 364 | 364 |
out, _, err := dockerCmdWithError("push", repoName)
|
| 365 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 365 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 366 | 366 |
c.Assert(out, checker.Not(checker.Contains), "Retrying") |
| 367 | 367 |
split := strings.Split(out, "\n") |
| 368 | 368 |
c.Assert(split[len(split)-2], checker.Contains, "error parsing HTTP 403 response body: ") |
| ... | ... |
@@ -375,7 +375,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponse |
| 375 | 375 |
repoName := fmt.Sprintf("%s/busybox", privateRegistryURL)
|
| 376 | 376 |
dockerCmd(c, "tag", "busybox", repoName) |
| 377 | 377 |
out, _, err := dockerCmdWithError("push", repoName)
|
| 378 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 378 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 379 | 379 |
c.Assert(out, checker.Not(checker.Contains), "Retrying") |
| 380 | 380 |
split := strings.Split(out, "\n") |
| 381 | 381 |
c.Assert(split[len(split)-2], check.Equals, "authorization server did not include a token in the response") |
| ... | ... |
@@ -85,11 +85,11 @@ func (s *DockerSuite) TestRestartDisconnectedContainer(c *check.C) {
|
| 85 | 85 |
|
| 86 | 86 |
// Disconnect the container from the network |
| 87 | 87 |
out, err := dockerCmd(c, "network", "disconnect", "bridge", "c0") |
| 88 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 88 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 89 | 89 |
|
| 90 | 90 |
// Restart the container |
| 91 | 91 |
dockerCmd(c, "restart", "c0") |
| 92 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 92 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 93 | 93 |
} |
| 94 | 94 |
|
| 95 | 95 |
func (s *DockerSuite) TestRestartPolicyNO(c *check.C) {
|
| ... | ... |
@@ -115,7 +115,7 @@ func (s *DockerSuite) TestRestartPolicyAlways(c *check.C) {
|
| 115 | 115 |
|
| 116 | 116 |
func (s *DockerSuite) TestRestartPolicyOnFailure(c *check.C) {
|
| 117 | 117 |
out, _, err := dockerCmdWithError("create", "--restart=on-failure:-1", "busybox")
|
| 118 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 118 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 119 | 119 |
c.Assert(out, checker.Contains, "maximum retry count cannot be negative") |
| 120 | 120 |
|
| 121 | 121 |
out, _ = dockerCmd(c, "create", "--restart=on-failure:1", "busybox") |
| ... | ... |
@@ -3975,13 +3975,13 @@ func (s *DockerSuite) TestRunVolumeCopyFlag(c *check.C) {
|
| 3975 | 3975 |
|
| 3976 | 3976 |
// test with the nocopy flag |
| 3977 | 3977 |
out, _, err := dockerCmdWithError("run", "-v", "test:/foo:nocopy", "volumecopy")
|
| 3978 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 3978 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 3979 | 3979 |
// test default behavior which is to copy for non-binds |
| 3980 | 3980 |
out, _ = dockerCmd(c, "run", "-v", "test:/foo", "volumecopy") |
| 3981 | 3981 |
c.Assert(strings.TrimSpace(out), checker.Equals, "hello") |
| 3982 | 3982 |
// error out when the volume is already populated |
| 3983 | 3983 |
out, _, err = dockerCmdWithError("run", "-v", "test:/foo:copy", "volumecopy")
|
| 3984 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 3984 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 3985 | 3985 |
// do not error out when copy isn't explicitly set even though it's already populated |
| 3986 | 3986 |
out, _ = dockerCmd(c, "run", "-v", "test:/foo", "volumecopy") |
| 3987 | 3987 |
c.Assert(strings.TrimSpace(out), checker.Equals, "hello") |
| ... | ... |
@@ -3989,15 +3989,15 @@ func (s *DockerSuite) TestRunVolumeCopyFlag(c *check.C) {
|
| 3989 | 3989 |
// do not allow copy modes on volumes-from |
| 3990 | 3990 |
dockerCmd(c, "run", "--name=test", "-v", "/foo", "busybox", "true") |
| 3991 | 3991 |
out, _, err = dockerCmdWithError("run", "--volumes-from=test:copy", "busybox", "true")
|
| 3992 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 3992 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 3993 | 3993 |
out, _, err = dockerCmdWithError("run", "--volumes-from=test:nocopy", "busybox", "true")
|
| 3994 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 3994 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 3995 | 3995 |
|
| 3996 | 3996 |
// do not allow copy modes on binds |
| 3997 | 3997 |
out, _, err = dockerCmdWithError("run", "-v", "/foo:/bar:copy", "busybox", "true")
|
| 3998 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 3998 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 3999 | 3999 |
out, _, err = dockerCmdWithError("run", "-v", "/foo:/bar:nocopy", "busybox", "true")
|
| 4000 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 4000 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 4001 | 4001 |
} |
| 4002 | 4002 |
|
| 4003 | 4003 |
// Test case for #21976 |
| ... | ... |
@@ -4314,7 +4314,7 @@ func (s *DockerSuite) TestRunMountReadOnlyDevShm(c *check.C) {
|
| 4314 | 4314 |
out, _, err := dockerCmdWithError("run", "--rm", "--read-only",
|
| 4315 | 4315 |
"-v", fmt.Sprintf("%s:/dev/shm:ro", emptyDir),
|
| 4316 | 4316 |
"busybox", "touch", "/dev/shm/foo") |
| 4317 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 4317 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 4318 | 4318 |
c.Assert(out, checker.Contains, "Read-only file system") |
| 4319 | 4319 |
} |
| 4320 | 4320 |
|
| ... | ... |
@@ -579,7 +579,7 @@ func (s *DockerSuite) TestRunWithBlkioWeight(c *check.C) {
|
| 579 | 579 |
func (s *DockerSuite) TestRunWithInvalidBlkioWeight(c *check.C) {
|
| 580 | 580 |
testRequires(c, blkioWeight) |
| 581 | 581 |
out, _, err := dockerCmdWithError("run", "--blkio-weight", "5", "busybox", "true")
|
| 582 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 582 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 583 | 583 |
expected := "Range of blkio weight is from 10 to 1000" |
| 584 | 584 |
c.Assert(out, checker.Contains, expected) |
| 585 | 585 |
} |
| ... | ... |
@@ -587,31 +587,31 @@ func (s *DockerSuite) TestRunWithInvalidBlkioWeight(c *check.C) {
|
| 587 | 587 |
func (s *DockerSuite) TestRunWithInvalidPathforBlkioWeightDevice(c *check.C) {
|
| 588 | 588 |
testRequires(c, blkioWeight) |
| 589 | 589 |
out, _, err := dockerCmdWithError("run", "--blkio-weight-device", "/dev/sdX:100", "busybox", "true")
|
| 590 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 590 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 591 | 591 |
} |
| 592 | 592 |
|
| 593 | 593 |
func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceReadBps(c *check.C) {
|
| 594 | 594 |
testRequires(c, blkioWeight) |
| 595 | 595 |
out, _, err := dockerCmdWithError("run", "--device-read-bps", "/dev/sdX:500", "busybox", "true")
|
| 596 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 596 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 597 | 597 |
} |
| 598 | 598 |
|
| 599 | 599 |
func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceWriteBps(c *check.C) {
|
| 600 | 600 |
testRequires(c, blkioWeight) |
| 601 | 601 |
out, _, err := dockerCmdWithError("run", "--device-write-bps", "/dev/sdX:500", "busybox", "true")
|
| 602 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 602 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 603 | 603 |
} |
| 604 | 604 |
|
| 605 | 605 |
func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceReadIOps(c *check.C) {
|
| 606 | 606 |
testRequires(c, blkioWeight) |
| 607 | 607 |
out, _, err := dockerCmdWithError("run", "--device-read-iops", "/dev/sdX:500", "busybox", "true")
|
| 608 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 608 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 609 | 609 |
} |
| 610 | 610 |
|
| 611 | 611 |
func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceWriteIOps(c *check.C) {
|
| 612 | 612 |
testRequires(c, blkioWeight) |
| 613 | 613 |
out, _, err := dockerCmdWithError("run", "--device-write-iops", "/dev/sdX:500", "busybox", "true")
|
| 614 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 614 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 615 | 615 |
} |
| 616 | 616 |
|
| 617 | 617 |
func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {
|
| ... | ... |
@@ -767,17 +767,17 @@ func (s *DockerSuite) TestRunInvalidCpusetMemsFlagValue(c *check.C) {
|
| 767 | 767 |
func (s *DockerSuite) TestRunInvalidCPUShares(c *check.C) {
|
| 768 | 768 |
testRequires(c, cpuShare, DaemonIsLinux) |
| 769 | 769 |
out, _, err := dockerCmdWithError("run", "--cpu-shares", "1", "busybox", "echo", "test")
|
| 770 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 770 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 771 | 771 |
expected := "The minimum allowed cpu-shares is 2" |
| 772 | 772 |
c.Assert(out, checker.Contains, expected) |
| 773 | 773 |
|
| 774 | 774 |
out, _, err = dockerCmdWithError("run", "--cpu-shares", "-1", "busybox", "echo", "test")
|
| 775 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 775 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 776 | 776 |
expected = "shares: invalid argument" |
| 777 | 777 |
c.Assert(out, checker.Contains, expected) |
| 778 | 778 |
|
| 779 | 779 |
out, _, err = dockerCmdWithError("run", "--cpu-shares", "99999999", "busybox", "echo", "test")
|
| 780 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 780 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 781 | 781 |
expected = "The maximum allowed cpu-shares is" |
| 782 | 782 |
c.Assert(out, checker.Contains, expected) |
| 783 | 783 |
} |
| ... | ... |
@@ -1349,7 +1349,7 @@ func (s *DockerSuite) TestRunSeccompWithDefaultProfile(c *check.C) {
|
| 1349 | 1349 |
testRequires(c, SameHostDaemon, seccompEnabled) |
| 1350 | 1350 |
|
| 1351 | 1351 |
out, _, err := dockerCmdWithError("run", "--security-opt", "seccomp=../profiles/seccomp/default.json", "debian:jessie", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami")
|
| 1352 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 1352 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 1353 | 1353 |
c.Assert(strings.TrimSpace(out), checker.Equals, "unshare: unshare failed: Operation not permitted") |
| 1354 | 1354 |
} |
| 1355 | 1355 |
|
| ... | ... |
@@ -18,29 +18,29 @@ func (s *DockerSuite) TestSearchOnCentralRegistry(c *check.C) {
|
| 18 | 18 |
|
| 19 | 19 |
func (s *DockerSuite) TestSearchStarsOptionWithWrongParameter(c *check.C) {
|
| 20 | 20 |
out, _, err := dockerCmdWithError("search", "--filter", "stars=a", "busybox")
|
| 21 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 21 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 22 | 22 |
c.Assert(out, checker.Contains, "Invalid filter", check.Commentf("couldn't find the invalid filter warning"))
|
| 23 | 23 |
|
| 24 | 24 |
out, _, err = dockerCmdWithError("search", "-f", "stars=a", "busybox")
|
| 25 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 25 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 26 | 26 |
c.Assert(out, checker.Contains, "Invalid filter", check.Commentf("couldn't find the invalid filter warning"))
|
| 27 | 27 |
|
| 28 | 28 |
out, _, err = dockerCmdWithError("search", "-f", "is-automated=a", "busybox")
|
| 29 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 29 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 30 | 30 |
c.Assert(out, checker.Contains, "Invalid filter", check.Commentf("couldn't find the invalid filter warning"))
|
| 31 | 31 |
|
| 32 | 32 |
out, _, err = dockerCmdWithError("search", "-f", "is-official=a", "busybox")
|
| 33 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 33 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 34 | 34 |
c.Assert(out, checker.Contains, "Invalid filter", check.Commentf("couldn't find the invalid filter warning"))
|
| 35 | 35 |
|
| 36 | 36 |
// -s --stars deprecated since Docker 1.13 |
| 37 | 37 |
out, _, err = dockerCmdWithError("search", "--stars=a", "busybox")
|
| 38 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 38 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 39 | 39 |
c.Assert(out, checker.Contains, "invalid syntax", check.Commentf("couldn't find the invalid value warning"))
|
| 40 | 40 |
|
| 41 | 41 |
// -s --stars deprecated since Docker 1.13 |
| 42 | 42 |
out, _, err = dockerCmdWithError("search", "-s=-1", "busybox")
|
| 43 |
- c.Assert(err, check.NotNil, check.Commentf(out)) |
|
| 43 |
+ c.Assert(err, check.NotNil, check.Commentf("%s", out))
|
|
| 44 | 44 |
c.Assert(out, checker.Contains, "invalid syntax", check.Commentf("couldn't find the invalid value warning"))
|
| 45 | 45 |
} |
| 46 | 46 |
|
| ... | ... |
@@ -87,7 +87,7 @@ func (s *DockerSwarmSuite) TestSecretCreateWithFile(c *check.C) {
|
| 87 | 87 |
testName := "test_secret" |
| 88 | 88 |
out, err := d.Cmd("secret", "create", testName, testFile.Name())
|
| 89 | 89 |
c.Assert(err, checker.IsNil) |
| 90 |
- c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "", check.Commentf(out)) |
|
| 90 |
+ c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "", check.Commentf("%s", out))
|
|
| 91 | 91 |
|
| 92 | 92 |
id := strings.TrimSpace(out) |
| 93 | 93 |
secret := d.GetSecret(c, id) |
| ... | ... |
@@ -18,7 +18,7 @@ import ( |
| 18 | 18 |
func (s *DockerSwarmSuite) TestServiceCreateMountVolume(c *check.C) {
|
| 19 | 19 |
d := s.AddDaemon(c, true, true) |
| 20 | 20 |
out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--mount", "type=volume,source=foo,target=/foo,volume-nocopy", "busybox", "top")
|
| 21 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 21 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 22 | 22 |
id := strings.TrimSpace(out) |
| 23 | 23 |
|
| 24 | 24 |
var tasks []swarm.Task |
| ... | ... |
@@ -37,7 +37,7 @@ func (s *DockerSwarmSuite) TestServiceCreateMountVolume(c *check.C) {
|
| 37 | 37 |
|
| 38 | 38 |
// check container mount config |
| 39 | 39 |
out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .HostConfig.Mounts}}", task.Status.ContainerStatus.ContainerID)
|
| 40 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 40 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 41 | 41 |
|
| 42 | 42 |
var mountConfig []mount.Mount |
| 43 | 43 |
c.Assert(json.Unmarshal([]byte(out), &mountConfig), checker.IsNil) |
| ... | ... |
@@ -51,7 +51,7 @@ func (s *DockerSwarmSuite) TestServiceCreateMountVolume(c *check.C) {
|
| 51 | 51 |
|
| 52 | 52 |
// check container mounts actual |
| 53 | 53 |
out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .Mounts}}", task.Status.ContainerStatus.ContainerID)
|
| 54 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 54 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 55 | 55 |
|
| 56 | 56 |
var mounts []types.MountPoint |
| 57 | 57 |
c.Assert(json.Unmarshal([]byte(out), &mounts), checker.IsNil) |
| ... | ... |
@@ -77,7 +77,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *check.C) {
|
| 77 | 77 |
c.Assert(id, checker.Not(checker.Equals), "", check.Commentf("secrets: %s", id))
|
| 78 | 78 |
|
| 79 | 79 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--secret", testName, "busybox", "top")
|
| 80 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 80 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 81 | 81 |
|
| 82 | 82 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Secrets }}", serviceName)
|
| 83 | 83 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -93,7 +93,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *check.C) {
|
| 93 | 93 |
c.Assert(refs[0].File.GID, checker.Equals, "0") |
| 94 | 94 |
|
| 95 | 95 |
out, err = d.Cmd("service", "rm", serviceName)
|
| 96 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 96 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 97 | 97 |
d.DeleteSecret(c, testName) |
| 98 | 98 |
} |
| 99 | 99 |
|
| ... | ... |
@@ -126,7 +126,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSourceTargetPaths(c *check |
| 126 | 126 |
serviceCmd = append(serviceCmd, secretFlags...) |
| 127 | 127 |
serviceCmd = append(serviceCmd, "busybox", "top") |
| 128 | 128 |
out, err := d.Cmd(serviceCmd...) |
| 129 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 129 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 130 | 130 |
|
| 131 | 131 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Secrets }}", serviceName)
|
| 132 | 132 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -160,7 +160,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSourceTargetPaths(c *check |
| 160 | 160 |
} |
| 161 | 161 |
|
| 162 | 162 |
out, err = d.Cmd("service", "rm", serviceName)
|
| 163 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 163 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 164 | 164 |
} |
| 165 | 165 |
|
| 166 | 166 |
func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *check.C) {
|
| ... | ... |
@@ -176,7 +176,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *check.C |
| 176 | 176 |
|
| 177 | 177 |
serviceName := "svc" |
| 178 | 178 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--secret", "source=mysecret,target=target1", "--secret", "source=mysecret,target=target2", "busybox", "top")
|
| 179 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 179 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 180 | 180 |
|
| 181 | 181 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Secrets }}", serviceName)
|
| 182 | 182 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -200,7 +200,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *check.C |
| 200 | 200 |
}, checker.Equals, true) |
| 201 | 201 |
|
| 202 | 202 |
for _, target := range []string{"target1", "target2"} {
|
| 203 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 203 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 204 | 204 |
path := filepath.Join("/run/secrets", target)
|
| 205 | 205 |
out, err := d.Cmd("exec", task.Status.ContainerStatus.ContainerID, "cat", path)
|
| 206 | 206 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -208,7 +208,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *check.C |
| 208 | 208 |
} |
| 209 | 209 |
|
| 210 | 210 |
out, err = d.Cmd("service", "rm", serviceName)
|
| 211 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 211 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 212 | 212 |
} |
| 213 | 213 |
|
| 214 | 214 |
func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *check.C) {
|
| ... | ... |
@@ -225,7 +225,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *check.C) {
|
| 225 | 225 |
c.Assert(id, checker.Not(checker.Equals), "", check.Commentf("configs: %s", id))
|
| 226 | 226 |
|
| 227 | 227 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--config", testName, "busybox", "top")
|
| 228 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 228 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 229 | 229 |
|
| 230 | 230 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Configs }}", serviceName)
|
| 231 | 231 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -241,7 +241,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *check.C) {
|
| 241 | 241 |
c.Assert(refs[0].File.GID, checker.Equals, "0") |
| 242 | 242 |
|
| 243 | 243 |
out, err = d.Cmd("service", "rm", serviceName)
|
| 244 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 244 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 245 | 245 |
d.DeleteConfig(c, testName) |
| 246 | 246 |
} |
| 247 | 247 |
|
| ... | ... |
@@ -273,7 +273,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSourceTargetPaths(c *check |
| 273 | 273 |
serviceCmd = append(serviceCmd, configFlags...) |
| 274 | 274 |
serviceCmd = append(serviceCmd, "busybox", "top") |
| 275 | 275 |
out, err := d.Cmd(serviceCmd...) |
| 276 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 276 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 277 | 277 |
|
| 278 | 278 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Configs }}", serviceName)
|
| 279 | 279 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -307,7 +307,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSourceTargetPaths(c *check |
| 307 | 307 |
} |
| 308 | 308 |
|
| 309 | 309 |
out, err = d.Cmd("service", "rm", serviceName)
|
| 310 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 310 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 311 | 311 |
} |
| 312 | 312 |
|
| 313 | 313 |
func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *check.C) {
|
| ... | ... |
@@ -323,7 +323,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *check.C |
| 323 | 323 |
|
| 324 | 324 |
serviceName := "svc" |
| 325 | 325 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--config", "source=myconfig,target=target1", "--config", "source=myconfig,target=target2", "busybox", "top")
|
| 326 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 326 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 327 | 327 |
|
| 328 | 328 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Configs }}", serviceName)
|
| 329 | 329 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -347,7 +347,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *check.C |
| 347 | 347 |
}, checker.Equals, true) |
| 348 | 348 |
|
| 349 | 349 |
for _, target := range []string{"target1", "target2"} {
|
| 350 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 350 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 351 | 351 |
path := filepath.Join("/", target)
|
| 352 | 352 |
out, err := d.Cmd("exec", task.Status.ContainerStatus.ContainerID, "cat", path)
|
| 353 | 353 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -355,13 +355,13 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *check.C |
| 355 | 355 |
} |
| 356 | 356 |
|
| 357 | 357 |
out, err = d.Cmd("service", "rm", serviceName)
|
| 358 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 358 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 359 | 359 |
} |
| 360 | 360 |
|
| 361 | 361 |
func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
|
| 362 | 362 |
d := s.AddDaemon(c, true, true) |
| 363 | 363 |
out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--mount", "type=tmpfs,target=/foo,tmpfs-size=1MB", "busybox", "sh", "-c", "mount | grep foo; tail -f /dev/null")
|
| 364 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 364 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 365 | 365 |
id := strings.TrimSpace(out) |
| 366 | 366 |
|
| 367 | 367 |
var tasks []swarm.Task |
| ... | ... |
@@ -380,7 +380,7 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
|
| 380 | 380 |
|
| 381 | 381 |
// check container mount config |
| 382 | 382 |
out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .HostConfig.Mounts}}", task.Status.ContainerStatus.ContainerID)
|
| 383 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 383 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 384 | 384 |
|
| 385 | 385 |
var mountConfig []mount.Mount |
| 386 | 386 |
c.Assert(json.Unmarshal([]byte(out), &mountConfig), checker.IsNil) |
| ... | ... |
@@ -394,7 +394,7 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
|
| 394 | 394 |
|
| 395 | 395 |
// check container mounts actual |
| 396 | 396 |
out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .Mounts}}", task.Status.ContainerStatus.ContainerID)
|
| 397 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 397 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 398 | 398 |
|
| 399 | 399 |
var mounts []types.MountPoint |
| 400 | 400 |
c.Assert(json.Unmarshal([]byte(out), &mounts), checker.IsNil) |
| ... | ... |
@@ -406,7 +406,7 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
|
| 406 | 406 |
c.Assert(mounts[0].RW, checker.Equals, true) |
| 407 | 407 |
|
| 408 | 408 |
out, err = s.nodeCmd(c, task.NodeID, "logs", task.Status.ContainerStatus.ContainerID) |
| 409 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 409 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 410 | 410 |
c.Assert(strings.TrimSpace(out), checker.HasPrefix, "tmpfs on /foo type tmpfs") |
| 411 | 411 |
c.Assert(strings.TrimSpace(out), checker.Contains, "size=1024k") |
| 412 | 412 |
} |
| ... | ... |
@@ -414,10 +414,10 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
|
| 414 | 414 |
func (s *DockerSwarmSuite) TestServiceCreateWithNetworkAlias(c *check.C) {
|
| 415 | 415 |
d := s.AddDaemon(c, true, true) |
| 416 | 416 |
out, err := d.Cmd("network", "create", "--scope=swarm", "test_swarm_br")
|
| 417 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 417 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 418 | 418 |
|
| 419 | 419 |
out, err = d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--network=name=test_swarm_br,alias=srv_alias", "--name=alias_tst_container", "busybox", "top")
|
| 420 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 420 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 421 | 421 |
id := strings.TrimSpace(out) |
| 422 | 422 |
|
| 423 | 423 |
var tasks []swarm.Task |
| ... | ... |
@@ -436,7 +436,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithNetworkAlias(c *check.C) {
|
| 436 | 436 |
|
| 437 | 437 |
// check container alias config |
| 438 | 438 |
out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .NetworkSettings.Networks.test_swarm_br.Aliases}}", task.Status.ContainerStatus.ContainerID)
|
| 439 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 439 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 440 | 440 |
|
| 441 | 441 |
// Make sure the only alias seen is the container-id |
| 442 | 442 |
var aliases []string |
| ... | ... |
@@ -34,7 +34,7 @@ func (s *DockerSwarmSuite) TestServiceHealthRun(c *check.C) {
|
| 34 | 34 |
|
| 35 | 35 |
serviceName := "healthServiceRun" |
| 36 | 36 |
out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--name", serviceName, imageName, "top")
|
| 37 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 37 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 38 | 38 |
id := strings.TrimSpace(out) |
| 39 | 39 |
|
| 40 | 40 |
var tasks []swarm.Task |
| ... | ... |
@@ -95,7 +95,7 @@ func (s *DockerSwarmSuite) TestServiceHealthStart(c *check.C) {
|
| 95 | 95 |
|
| 96 | 96 |
serviceName := "healthServiceStart" |
| 97 | 97 |
out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--name", serviceName, imageName, "top")
|
| 98 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 98 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 99 | 99 |
id := strings.TrimSpace(out) |
| 100 | 100 |
|
| 101 | 101 |
var tasks []swarm.Task |
| ... | ... |
@@ -14,39 +14,39 @@ import ( |
| 14 | 14 |
func (s *DockerSwarmSuite) TestServiceUpdateLabel(c *check.C) {
|
| 15 | 15 |
d := s.AddDaemon(c, true, true) |
| 16 | 16 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name=test", "busybox", "top")
|
| 17 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 17 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 18 | 18 |
service := d.GetService(c, "test") |
| 19 | 19 |
c.Assert(service.Spec.Labels, checker.HasLen, 0) |
| 20 | 20 |
|
| 21 | 21 |
// add label to empty set |
| 22 | 22 |
out, err = d.Cmd("service", "update", "--detach", "test", "--label-add", "foo=bar")
|
| 23 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 23 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 24 | 24 |
service = d.GetService(c, "test") |
| 25 | 25 |
c.Assert(service.Spec.Labels, checker.HasLen, 1) |
| 26 | 26 |
c.Assert(service.Spec.Labels["foo"], checker.Equals, "bar") |
| 27 | 27 |
|
| 28 | 28 |
// add label to non-empty set |
| 29 | 29 |
out, err = d.Cmd("service", "update", "--detach", "test", "--label-add", "foo2=bar")
|
| 30 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 30 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 31 | 31 |
service = d.GetService(c, "test") |
| 32 | 32 |
c.Assert(service.Spec.Labels, checker.HasLen, 2) |
| 33 | 33 |
c.Assert(service.Spec.Labels["foo2"], checker.Equals, "bar") |
| 34 | 34 |
|
| 35 | 35 |
out, err = d.Cmd("service", "update", "--detach", "test", "--label-rm", "foo2")
|
| 36 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 36 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 37 | 37 |
service = d.GetService(c, "test") |
| 38 | 38 |
c.Assert(service.Spec.Labels, checker.HasLen, 1) |
| 39 | 39 |
c.Assert(service.Spec.Labels["foo2"], checker.Equals, "") |
| 40 | 40 |
|
| 41 | 41 |
out, err = d.Cmd("service", "update", "--detach", "test", "--label-rm", "foo")
|
| 42 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 42 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 43 | 43 |
service = d.GetService(c, "test") |
| 44 | 44 |
c.Assert(service.Spec.Labels, checker.HasLen, 0) |
| 45 | 45 |
c.Assert(service.Spec.Labels["foo"], checker.Equals, "") |
| 46 | 46 |
|
| 47 | 47 |
// now make sure we can add again |
| 48 | 48 |
out, err = d.Cmd("service", "update", "--detach", "test", "--label-add", "foo=bar")
|
| 49 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 49 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 50 | 50 |
service = d.GetService(c, "test") |
| 51 | 51 |
c.Assert(service.Spec.Labels, checker.HasLen, 1) |
| 52 | 52 |
c.Assert(service.Spec.Labels["foo"], checker.Equals, "bar") |
| ... | ... |
@@ -66,11 +66,11 @@ func (s *DockerSwarmSuite) TestServiceUpdateSecrets(c *check.C) {
|
| 66 | 66 |
serviceName := "test" |
| 67 | 67 |
|
| 68 | 68 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "busybox", "top")
|
| 69 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 69 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 70 | 70 |
|
| 71 | 71 |
// add secret |
| 72 | 72 |
out, err = d.Cmd("service", "update", "--detach", "test", "--secret-add", fmt.Sprintf("source=%s,target=%s", testName, testTarget))
|
| 73 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 73 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 74 | 74 |
|
| 75 | 75 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Secrets }}", serviceName)
|
| 76 | 76 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -85,7 +85,7 @@ func (s *DockerSwarmSuite) TestServiceUpdateSecrets(c *check.C) {
|
| 85 | 85 |
|
| 86 | 86 |
// remove |
| 87 | 87 |
out, err = d.Cmd("service", "update", "--detach", "test", "--secret-rm", testName)
|
| 88 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 88 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 89 | 89 |
|
| 90 | 90 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Secrets }}", serviceName)
|
| 91 | 91 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -108,11 +108,11 @@ func (s *DockerSwarmSuite) TestServiceUpdateConfigs(c *check.C) {
|
| 108 | 108 |
serviceName := "test" |
| 109 | 109 |
|
| 110 | 110 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "busybox", "top")
|
| 111 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 111 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 112 | 112 |
|
| 113 | 113 |
// add config |
| 114 | 114 |
out, err = d.Cmd("service", "update", "--detach", "test", "--config-add", fmt.Sprintf("source=%s,target=%s", testName, testTarget))
|
| 115 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 115 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 116 | 116 |
|
| 117 | 117 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Configs }}", serviceName)
|
| 118 | 118 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -127,7 +127,7 @@ func (s *DockerSwarmSuite) TestServiceUpdateConfigs(c *check.C) {
|
| 127 | 127 |
|
| 128 | 128 |
// remove |
| 129 | 129 |
out, err = d.Cmd("service", "update", "--detach", "test", "--config-rm", testName)
|
| 130 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 130 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 131 | 131 |
|
| 132 | 132 |
out, err = d.Cmd("service", "inspect", "--format", "{{ json .Spec.TaskTemplate.ContainerSpec.Configs }}", serviceName)
|
| 133 | 133 |
c.Assert(err, checker.IsNil) |
| ... | ... |
@@ -172,14 +172,14 @@ func (s *DockerSwarmSuite) TestSwarmServiceTemplatingHostname(c *check.C) {
|
| 172 | 172 |
c.Assert(err, checker.IsNil, check.Commentf(hostname)) |
| 173 | 173 |
|
| 174 | 174 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", "test", "--hostname", "{{.Service.Name}}-{{.Task.Slot}}-{{.Node.Hostname}}", "busybox", "top")
|
| 175 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 175 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 176 | 176 |
|
| 177 | 177 |
// make sure task has been deployed. |
| 178 | 178 |
waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1) |
| 179 | 179 |
|
| 180 | 180 |
containers := d.ActiveContainers(c) |
| 181 | 181 |
out, err = d.Cmd("inspect", "--type", "container", "--format", "{{.Config.Hostname}}", containers[0])
|
| 182 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 182 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 183 | 183 |
c.Assert(strings.Split(out, "\n")[0], checker.Equals, "test-1-"+strings.Split(hostname, "\n")[0], check.Commentf("hostname with templating invalid"))
|
| 184 | 184 |
} |
| 185 | 185 |
|
| ... | ... |
@@ -323,17 +323,17 @@ func (s *DockerSwarmSuite) TestSwarmContainerAutoStart(c *check.C) {
|
| 323 | 323 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 324 | 324 |
|
| 325 | 325 |
out, err = d.Cmd("run", "-id", "--restart=always", "--net=foo", "--name=test", "busybox", "top")
|
| 326 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 326 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 327 | 327 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 328 | 328 |
|
| 329 | 329 |
out, err = d.Cmd("ps", "-q")
|
| 330 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 330 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 331 | 331 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 332 | 332 |
|
| 333 | 333 |
d.Restart(c) |
| 334 | 334 |
|
| 335 | 335 |
out, err = d.Cmd("ps", "-q")
|
| 336 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 336 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 337 | 337 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 338 | 338 |
} |
| 339 | 339 |
|
| ... | ... |
@@ -341,25 +341,25 @@ func (s *DockerSwarmSuite) TestSwarmContainerEndpointOptions(c *check.C) {
|
| 341 | 341 |
d := s.AddDaemon(c, true, true) |
| 342 | 342 |
|
| 343 | 343 |
out, err := d.Cmd("network", "create", "--attachable", "-d", "overlay", "foo")
|
| 344 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 344 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 345 | 345 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 346 | 346 |
|
| 347 | 347 |
_, err = d.Cmd("run", "-d", "--net=foo", "--name=first", "--net-alias=first-alias", "busybox:glibc", "top")
|
| 348 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 348 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 349 | 349 |
|
| 350 | 350 |
_, err = d.Cmd("run", "-d", "--net=foo", "--name=second", "busybox:glibc", "top")
|
| 351 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 351 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 352 | 352 |
|
| 353 | 353 |
_, err = d.Cmd("run", "-d", "--net=foo", "--net-alias=third-alias", "busybox:glibc", "top")
|
| 354 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 354 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 355 | 355 |
|
| 356 | 356 |
// ping first container and its alias, also ping third and anonymous container by its alias |
| 357 | 357 |
_, err = d.Cmd("exec", "second", "ping", "-c", "1", "first")
|
| 358 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 358 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 359 | 359 |
_, err = d.Cmd("exec", "second", "ping", "-c", "1", "first-alias")
|
| 360 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 360 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 361 | 361 |
_, err = d.Cmd("exec", "second", "ping", "-c", "1", "third-alias")
|
| 362 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 362 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 363 | 363 |
} |
| 364 | 364 |
|
| 365 | 365 |
func (s *DockerSwarmSuite) TestSwarmContainerAttachByNetworkId(c *check.C) {
|
| ... | ... |
@@ -394,21 +394,21 @@ func (s *DockerSwarmSuite) TestOverlayAttachable(c *check.C) {
|
| 394 | 394 |
d := s.AddDaemon(c, true, true) |
| 395 | 395 |
|
| 396 | 396 |
out, err := d.Cmd("network", "create", "-d", "overlay", "--attachable", "ovnet")
|
| 397 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 397 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 398 | 398 |
|
| 399 | 399 |
// validate attachable |
| 400 | 400 |
out, err = d.Cmd("network", "inspect", "--format", "{{json .Attachable}}", "ovnet")
|
| 401 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 401 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 402 | 402 |
c.Assert(strings.TrimSpace(out), checker.Equals, "true") |
| 403 | 403 |
|
| 404 | 404 |
// validate containers can attache to this overlay network |
| 405 | 405 |
out, err = d.Cmd("run", "-d", "--network", "ovnet", "--name", "c1", "busybox", "top")
|
| 406 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 406 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 407 | 407 |
|
| 408 | 408 |
// redo validation, there was a bug that the value of attachable changes after |
| 409 | 409 |
// containers attach to the network |
| 410 | 410 |
out, err = d.Cmd("network", "inspect", "--format", "{{json .Attachable}}", "ovnet")
|
| 411 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 411 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 412 | 412 |
c.Assert(strings.TrimSpace(out), checker.Equals, "true") |
| 413 | 413 |
} |
| 414 | 414 |
|
| ... | ... |
@@ -418,11 +418,11 @@ func (s *DockerSwarmSuite) TestOverlayAttachableOnSwarmLeave(c *check.C) {
|
| 418 | 418 |
// Create an attachable swarm network |
| 419 | 419 |
nwName := "attovl" |
| 420 | 420 |
out, err := d.Cmd("network", "create", "-d", "overlay", "--attachable", nwName)
|
| 421 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 421 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 422 | 422 |
|
| 423 | 423 |
// Connect a container to the network |
| 424 | 424 |
out, err = d.Cmd("run", "-d", "--network", nwName, "--name", "c1", "busybox", "top")
|
| 425 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 425 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 426 | 426 |
|
| 427 | 427 |
// Leave the swarm |
| 428 | 428 |
err = d.SwarmLeave(true) |
| ... | ... |
@@ -444,11 +444,11 @@ func (s *DockerSwarmSuite) TestOverlayAttachableReleaseResourcesOnFailure(c *che |
| 444 | 444 |
|
| 445 | 445 |
// Create attachable network |
| 446 | 446 |
out, err := d.Cmd("network", "create", "-d", "overlay", "--attachable", "--subnet", "10.10.9.0/24", "ovnet")
|
| 447 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 447 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 448 | 448 |
|
| 449 | 449 |
// Attach a container with specific IP |
| 450 | 450 |
out, err = d.Cmd("run", "-d", "--network", "ovnet", "--name", "c1", "--ip", "10.10.9.33", "busybox", "top")
|
| 451 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 451 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 452 | 452 |
|
| 453 | 453 |
// Attempt to attach another container with same IP, must fail |
| 454 | 454 |
_, err = d.Cmd("run", "-d", "--network", "ovnet", "--name", "c2", "--ip", "10.10.9.33", "busybox", "top")
|
| ... | ... |
@@ -456,11 +456,11 @@ func (s *DockerSwarmSuite) TestOverlayAttachableReleaseResourcesOnFailure(c *che |
| 456 | 456 |
|
| 457 | 457 |
// Remove first container |
| 458 | 458 |
out, err = d.Cmd("rm", "-f", "c1")
|
| 459 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 459 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 460 | 460 |
|
| 461 | 461 |
// Verify the network can be removed, no phantom network attachment task left over |
| 462 | 462 |
out, err = d.Cmd("network", "rm", "ovnet")
|
| 463 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 463 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 464 | 464 |
} |
| 465 | 465 |
|
| 466 | 466 |
func (s *DockerSwarmSuite) TestSwarmIngressNetwork(c *check.C) {
|
| ... | ... |
@@ -478,7 +478,7 @@ func (s *DockerSwarmSuite) TestSwarmIngressNetwork(c *check.C) {
|
| 478 | 478 |
|
| 479 | 479 |
// And recreated |
| 480 | 480 |
out, err := d.Cmd("network", "create", "-d", "overlay", "--ingress", "new-ingress")
|
| 481 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 481 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 482 | 482 |
|
| 483 | 483 |
// But only one is allowed |
| 484 | 484 |
out, err = d.Cmd("network", "create", "-d", "overlay", "--ingress", "another-ingress")
|
| ... | ... |
@@ -487,7 +487,7 @@ func (s *DockerSwarmSuite) TestSwarmIngressNetwork(c *check.C) {
|
| 487 | 487 |
|
| 488 | 488 |
// It cannot be removed if it is being used |
| 489 | 489 |
out, err = d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", "srv1", "-p", "9000:8000", "busybox", "top")
|
| 490 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 490 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 491 | 491 |
|
| 492 | 492 |
result = removeNetwork("new-ingress")
|
| 493 | 493 |
result.Assert(c, icmd.Expected{
|
| ... | ... |
@@ -497,7 +497,7 @@ func (s *DockerSwarmSuite) TestSwarmIngressNetwork(c *check.C) {
|
| 497 | 497 |
|
| 498 | 498 |
// But it can be removed once no more services depend on it |
| 499 | 499 |
out, err = d.Cmd("service", "update", "--detach", "--publish-rm", "9000:8000", "srv1")
|
| 500 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 500 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 501 | 501 |
|
| 502 | 502 |
result = removeNetwork("new-ingress")
|
| 503 | 503 |
result.Assert(c, icmd.Success) |
| ... | ... |
@@ -514,7 +514,7 @@ func (s *DockerSwarmSuite) TestSwarmIngressNetwork(c *check.C) {
|
| 514 | 514 |
|
| 515 | 515 |
// But services which do not need routing mesh can be created regardless |
| 516 | 516 |
out, err = d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", "srv3", "--endpoint-mode", "dnsrr", "busybox", "top")
|
| 517 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 517 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 518 | 518 |
} |
| 519 | 519 |
|
| 520 | 520 |
func (s *DockerSwarmSuite) TestSwarmCreateServiceWithNoIngressNetwork(c *check.C) {
|
| ... | ... |
@@ -529,9 +529,9 @@ func (s *DockerSwarmSuite) TestSwarmCreateServiceWithNoIngressNetwork(c *check.C |
| 529 | 529 |
// Create a overlay network and launch a service on it |
| 530 | 530 |
// Make sure nothing panics because ingress network is missing |
| 531 | 531 |
out, err := d.Cmd("network", "create", "-d", "overlay", "another-network")
|
| 532 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 532 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 533 | 533 |
out, err = d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", "srv4", "--network", "another-network", "busybox", "top")
|
| 534 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 534 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 535 | 535 |
} |
| 536 | 536 |
|
| 537 | 537 |
// Test case for #24108, also the case from: |
| ... | ... |
@@ -1540,22 +1540,22 @@ func (s *DockerSwarmSuite) TestSwarmNetworkIPAMOptions(c *check.C) {
|
| 1540 | 1540 |
d := s.AddDaemon(c, true, true) |
| 1541 | 1541 |
|
| 1542 | 1542 |
out, err := d.Cmd("network", "create", "-d", "overlay", "--ipam-opt", "foo=bar", "foo")
|
| 1543 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1543 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1544 | 1544 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 1545 | 1545 |
|
| 1546 | 1546 |
out, err = d.Cmd("network", "inspect", "--format", "{{.IPAM.Options}}", "foo")
|
| 1547 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1547 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1548 | 1548 |
c.Assert(strings.TrimSpace(out), checker.Contains, "foo:bar") |
| 1549 | 1549 |
c.Assert(strings.TrimSpace(out), checker.Contains, "com.docker.network.ipam.serial:true") |
| 1550 | 1550 |
|
| 1551 | 1551 |
out, err = d.Cmd("service", "create", "--detach", "--no-resolve-image", "--network=foo", "--name", "top", "busybox", "top")
|
| 1552 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1552 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1553 | 1553 |
|
| 1554 | 1554 |
// make sure task has been deployed. |
| 1555 | 1555 |
waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1) |
| 1556 | 1556 |
|
| 1557 | 1557 |
out, err = d.Cmd("network", "inspect", "--format", "{{.IPAM.Options}}", "foo")
|
| 1558 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1558 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1559 | 1559 |
c.Assert(strings.TrimSpace(out), checker.Contains, "foo:bar") |
| 1560 | 1560 |
c.Assert(strings.TrimSpace(out), checker.Contains, "com.docker.network.ipam.serial:true") |
| 1561 | 1561 |
} |
| ... | ... |
@@ -1611,7 +1611,7 @@ func (s *DockerSwarmSuite) TestSwarmPublishDuplicatePorts(c *check.C) {
|
| 1611 | 1611 |
d := s.AddDaemon(c, true, true) |
| 1612 | 1612 |
|
| 1613 | 1613 |
out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--publish", "5005:80", "--publish", "5006:80", "--publish", "80", "--publish", "80", "busybox", "top")
|
| 1614 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1614 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1615 | 1615 |
id := strings.TrimSpace(out) |
| 1616 | 1616 |
|
| 1617 | 1617 |
// make sure task has been deployed. |
| ... | ... |
@@ -1620,7 +1620,7 @@ func (s *DockerSwarmSuite) TestSwarmPublishDuplicatePorts(c *check.C) {
|
| 1620 | 1620 |
// Total len = 4, with 2 dynamic ports and 2 non-dynamic ports |
| 1621 | 1621 |
// Dynamic ports are likely to be 30000 and 30001 but doesn't matter |
| 1622 | 1622 |
out, err = d.Cmd("service", "inspect", "--format", "{{.Endpoint.Ports}} len={{len .Endpoint.Ports}}", id)
|
| 1623 |
- c.Assert(err, check.IsNil, check.Commentf(out)) |
|
| 1623 |
+ c.Assert(err, check.IsNil, check.Commentf("%s", out))
|
|
| 1624 | 1624 |
c.Assert(out, checker.Contains, "len=4") |
| 1625 | 1625 |
c.Assert(out, checker.Contains, "{ tcp 80 5005 ingress}")
|
| 1626 | 1626 |
c.Assert(out, checker.Contains, "{ tcp 80 5006 ingress}")
|
| ... | ... |
@@ -1671,18 +1671,18 @@ func (s *DockerSwarmSuite) TestSwarmReadonlyRootfs(c *check.C) {
|
| 1671 | 1671 |
d := s.AddDaemon(c, true, true) |
| 1672 | 1672 |
|
| 1673 | 1673 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", "top", "--read-only", "busybox", "top")
|
| 1674 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1674 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1675 | 1675 |
|
| 1676 | 1676 |
// make sure task has been deployed. |
| 1677 | 1677 |
waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1) |
| 1678 | 1678 |
|
| 1679 | 1679 |
out, err = d.Cmd("service", "inspect", "--format", "{{ .Spec.TaskTemplate.ContainerSpec.ReadOnly }}", "top")
|
| 1680 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1680 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1681 | 1681 |
c.Assert(strings.TrimSpace(out), checker.Equals, "true") |
| 1682 | 1682 |
|
| 1683 | 1683 |
containers := d.ActiveContainers(c) |
| 1684 | 1684 |
out, err = d.Cmd("inspect", "--type", "container", "--format", "{{.HostConfig.ReadonlyRootfs}}", containers[0])
|
| 1685 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1685 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1686 | 1686 |
c.Assert(strings.TrimSpace(out), checker.Equals, "true") |
| 1687 | 1687 |
} |
| 1688 | 1688 |
|
| ... | ... |
@@ -1704,32 +1704,32 @@ func (s *DockerSwarmSuite) TestNetworkInspectWithDuplicateNames(c *check.C) {
|
| 1704 | 1704 |
|
| 1705 | 1705 |
// Full ID always works |
| 1706 | 1706 |
out, err := d.Cmd("network", "inspect", "--format", "{{.ID}}", n1.ID)
|
| 1707 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1707 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1708 | 1708 |
c.Assert(strings.TrimSpace(out), checker.Equals, n1.ID) |
| 1709 | 1709 |
|
| 1710 | 1710 |
// Name works if it is unique |
| 1711 | 1711 |
out, err = d.Cmd("network", "inspect", "--format", "{{.ID}}", name)
|
| 1712 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1712 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1713 | 1713 |
c.Assert(strings.TrimSpace(out), checker.Equals, n1.ID) |
| 1714 | 1714 |
|
| 1715 | 1715 |
n2, err := cli.NetworkCreate(context.Background(), name, options) |
| 1716 | 1716 |
c.Assert(err, checker.IsNil) |
| 1717 | 1717 |
// Full ID always works |
| 1718 | 1718 |
out, err = d.Cmd("network", "inspect", "--format", "{{.ID}}", n1.ID)
|
| 1719 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1719 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1720 | 1720 |
c.Assert(strings.TrimSpace(out), checker.Equals, n1.ID) |
| 1721 | 1721 |
|
| 1722 | 1722 |
out, err = d.Cmd("network", "inspect", "--format", "{{.ID}}", n2.ID)
|
| 1723 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1723 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1724 | 1724 |
c.Assert(strings.TrimSpace(out), checker.Equals, n2.ID) |
| 1725 | 1725 |
|
| 1726 | 1726 |
// Name with duplicates |
| 1727 | 1727 |
out, err = d.Cmd("network", "inspect", "--format", "{{.ID}}", name)
|
| 1728 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 1728 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 1729 | 1729 |
c.Assert(out, checker.Contains, "2 matches found based on name") |
| 1730 | 1730 |
|
| 1731 | 1731 |
out, err = d.Cmd("network", "rm", n2.ID)
|
| 1732 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1732 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1733 | 1733 |
|
| 1734 | 1734 |
// Dupliates with name but with different driver |
| 1735 | 1735 |
options.Driver = "overlay" |
| ... | ... |
@@ -1739,16 +1739,16 @@ func (s *DockerSwarmSuite) TestNetworkInspectWithDuplicateNames(c *check.C) {
|
| 1739 | 1739 |
|
| 1740 | 1740 |
// Full ID always works |
| 1741 | 1741 |
out, err = d.Cmd("network", "inspect", "--format", "{{.ID}}", n1.ID)
|
| 1742 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1742 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1743 | 1743 |
c.Assert(strings.TrimSpace(out), checker.Equals, n1.ID) |
| 1744 | 1744 |
|
| 1745 | 1745 |
out, err = d.Cmd("network", "inspect", "--format", "{{.ID}}", n2.ID)
|
| 1746 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1746 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1747 | 1747 |
c.Assert(strings.TrimSpace(out), checker.Equals, n2.ID) |
| 1748 | 1748 |
|
| 1749 | 1749 |
// Name with duplicates |
| 1750 | 1750 |
out, err = d.Cmd("network", "inspect", "--format", "{{.ID}}", name)
|
| 1751 |
- c.Assert(err, checker.NotNil, check.Commentf(out)) |
|
| 1751 |
+ c.Assert(err, checker.NotNil, check.Commentf("%s", out))
|
|
| 1752 | 1752 |
c.Assert(out, checker.Contains, "2 matches found based on name") |
| 1753 | 1753 |
} |
| 1754 | 1754 |
|
| ... | ... |
@@ -1758,25 +1758,25 @@ func (s *DockerSwarmSuite) TestSwarmStopSignal(c *check.C) {
|
| 1758 | 1758 |
d := s.AddDaemon(c, true, true) |
| 1759 | 1759 |
|
| 1760 | 1760 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", "top", "--stop-signal=SIGHUP", "busybox", "top")
|
| 1761 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1761 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1762 | 1762 |
|
| 1763 | 1763 |
// make sure task has been deployed. |
| 1764 | 1764 |
waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1) |
| 1765 | 1765 |
|
| 1766 | 1766 |
out, err = d.Cmd("service", "inspect", "--format", "{{ .Spec.TaskTemplate.ContainerSpec.StopSignal }}", "top")
|
| 1767 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1767 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1768 | 1768 |
c.Assert(strings.TrimSpace(out), checker.Equals, "SIGHUP") |
| 1769 | 1769 |
|
| 1770 | 1770 |
containers := d.ActiveContainers(c) |
| 1771 | 1771 |
out, err = d.Cmd("inspect", "--type", "container", "--format", "{{.Config.StopSignal}}", containers[0])
|
| 1772 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1772 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1773 | 1773 |
c.Assert(strings.TrimSpace(out), checker.Equals, "SIGHUP") |
| 1774 | 1774 |
|
| 1775 | 1775 |
out, err = d.Cmd("service", "update", "--detach", "--stop-signal=SIGUSR1", "top")
|
| 1776 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1776 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1777 | 1777 |
|
| 1778 | 1778 |
out, err = d.Cmd("service", "inspect", "--format", "{{ .Spec.TaskTemplate.ContainerSpec.StopSignal }}", "top")
|
| 1779 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1779 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1780 | 1780 |
c.Assert(strings.TrimSpace(out), checker.Equals, "SIGUSR1") |
| 1781 | 1781 |
} |
| 1782 | 1782 |
|
| ... | ... |
@@ -1784,18 +1784,18 @@ func (s *DockerSwarmSuite) TestSwarmServiceLsFilterMode(c *check.C) {
|
| 1784 | 1784 |
d := s.AddDaemon(c, true, true) |
| 1785 | 1785 |
|
| 1786 | 1786 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", "top1", "busybox", "top")
|
| 1787 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1787 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1788 | 1788 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 1789 | 1789 |
|
| 1790 | 1790 |
out, err = d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", "top2", "--mode=global", "busybox", "top")
|
| 1791 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1791 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1792 | 1792 |
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
| 1793 | 1793 |
|
| 1794 | 1794 |
// make sure task has been deployed. |
| 1795 | 1795 |
waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 2) |
| 1796 | 1796 |
|
| 1797 | 1797 |
out, err = d.Cmd("service", "ls")
|
| 1798 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1798 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1799 | 1799 |
c.Assert(out, checker.Contains, "top1") |
| 1800 | 1800 |
c.Assert(out, checker.Contains, "top2") |
| 1801 | 1801 |
c.Assert(out, checker.Not(checker.Contains), "localnet") |
| ... | ... |
@@ -1803,10 +1803,10 @@ func (s *DockerSwarmSuite) TestSwarmServiceLsFilterMode(c *check.C) {
|
| 1803 | 1803 |
out, err = d.Cmd("service", "ls", "--filter", "mode=global")
|
| 1804 | 1804 |
c.Assert(out, checker.Not(checker.Contains), "top1") |
| 1805 | 1805 |
c.Assert(out, checker.Contains, "top2") |
| 1806 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1806 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1807 | 1807 |
|
| 1808 | 1808 |
out, err = d.Cmd("service", "ls", "--filter", "mode=replicated")
|
| 1809 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1809 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1810 | 1810 |
c.Assert(out, checker.Contains, "top1") |
| 1811 | 1811 |
c.Assert(out, checker.Not(checker.Contains), "top2") |
| 1812 | 1812 |
} |
| ... | ... |
@@ -1860,7 +1860,7 @@ func waitForEvent(c *check.C, d *daemon.Daemon, since string, filter string, eve |
| 1860 | 1860 |
} else {
|
| 1861 | 1861 |
out, err = d.Cmd("events", "--since", since, "--until", until)
|
| 1862 | 1862 |
} |
| 1863 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1863 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1864 | 1864 |
if strings.Contains(out, event) {
|
| 1865 | 1865 |
return strings.TrimSpace(out) |
| 1866 | 1866 |
} |
| ... | ... |
@@ -1880,7 +1880,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsSource(c *check.C) {
|
| 1880 | 1880 |
|
| 1881 | 1881 |
// create a network |
| 1882 | 1882 |
out, err := d1.Cmd("network", "create", "--attachable", "-d", "overlay", "foo")
|
| 1883 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1883 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1884 | 1884 |
networkID := strings.TrimSpace(out) |
| 1885 | 1885 |
c.Assert(networkID, checker.Not(checker.Equals), "") |
| 1886 | 1886 |
|
| ... | ... |
@@ -1898,7 +1898,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsScope(c *check.C) {
|
| 1898 | 1898 |
|
| 1899 | 1899 |
// create a service |
| 1900 | 1900 |
out, err := d.Cmd("service", "create", "--no-resolve-image", "--name", "test", "--detach=false", "busybox", "top")
|
| 1901 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1901 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1902 | 1902 |
serviceID := strings.Split(out, "\n")[0] |
| 1903 | 1903 |
|
| 1904 | 1904 |
// scope swarm filters cluster events |
| ... | ... |
@@ -1919,12 +1919,12 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsType(c *check.C) {
|
| 1919 | 1919 |
|
| 1920 | 1920 |
// create a service |
| 1921 | 1921 |
out, err := d.Cmd("service", "create", "--no-resolve-image", "--name", "test", "--detach=false", "busybox", "top")
|
| 1922 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1922 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1923 | 1923 |
serviceID := strings.Split(out, "\n")[0] |
| 1924 | 1924 |
|
| 1925 | 1925 |
// create a network |
| 1926 | 1926 |
out, err = d.Cmd("network", "create", "--attachable", "-d", "overlay", "foo")
|
| 1927 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1927 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1928 | 1928 |
networkID := strings.TrimSpace(out) |
| 1929 | 1929 |
c.Assert(networkID, checker.Not(checker.Equals), "") |
| 1930 | 1930 |
|
| ... | ... |
@@ -1942,7 +1942,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsService(c *check.C) {
|
| 1942 | 1942 |
|
| 1943 | 1943 |
// create a service |
| 1944 | 1944 |
out, err := d.Cmd("service", "create", "--no-resolve-image", "--name", "test", "--detach=false", "busybox", "top")
|
| 1945 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1945 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1946 | 1946 |
serviceID := strings.Split(out, "\n")[0] |
| 1947 | 1947 |
|
| 1948 | 1948 |
// validate service create event |
| ... | ... |
@@ -1950,7 +1950,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsService(c *check.C) {
|
| 1950 | 1950 |
|
| 1951 | 1951 |
t1 := daemonUnixTime(c) |
| 1952 | 1952 |
out, err = d.Cmd("service", "update", "--force", "--detach=false", "test")
|
| 1953 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1953 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1954 | 1954 |
|
| 1955 | 1955 |
// wait for service update start |
| 1956 | 1956 |
out = waitForEvent(c, d, t1, "-f scope=swarm", "service update "+serviceID, defaultRetryCount) |
| ... | ... |
@@ -1964,7 +1964,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsService(c *check.C) {
|
| 1964 | 1964 |
// scale service |
| 1965 | 1965 |
t2 := daemonUnixTime(c) |
| 1966 | 1966 |
out, err = d.Cmd("service", "scale", "test=3")
|
| 1967 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1967 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1968 | 1968 |
|
| 1969 | 1969 |
out = waitForEvent(c, d, t2, "-f scope=swarm", "service update "+serviceID, defaultRetryCount) |
| 1970 | 1970 |
c.Assert(out, checker.Contains, "replicas.new=3, replicas.old=1") |
| ... | ... |
@@ -1972,7 +1972,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsService(c *check.C) {
|
| 1972 | 1972 |
// remove service |
| 1973 | 1973 |
t3 := daemonUnixTime(c) |
| 1974 | 1974 |
out, err = d.Cmd("service", "rm", "test")
|
| 1975 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1975 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1976 | 1976 |
|
| 1977 | 1977 |
waitForEvent(c, d, t3, "-f scope=swarm", "service remove "+serviceID, defaultRetryCount) |
| 1978 | 1978 |
} |
| ... | ... |
@@ -1987,7 +1987,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsNode(c *check.C) {
|
| 1987 | 1987 |
|
| 1988 | 1988 |
t1 := daemonUnixTime(c) |
| 1989 | 1989 |
out, err := d1.Cmd("node", "update", "--availability=pause", d3ID)
|
| 1990 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1990 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1991 | 1991 |
|
| 1992 | 1992 |
// filter by type |
| 1993 | 1993 |
out = waitForEvent(c, d1, t1, "-f type=node", "node update "+d3ID, defaultRetryCount) |
| ... | ... |
@@ -1995,13 +1995,13 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsNode(c *check.C) {
|
| 1995 | 1995 |
|
| 1996 | 1996 |
t2 := daemonUnixTime(c) |
| 1997 | 1997 |
out, err = d1.Cmd("node", "demote", d3ID)
|
| 1998 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 1998 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 1999 | 1999 |
|
| 2000 | 2000 |
waitForEvent(c, d1, t2, "-f type=node", "node update "+d3ID, defaultRetryCount) |
| 2001 | 2001 |
|
| 2002 | 2002 |
t3 := daemonUnixTime(c) |
| 2003 | 2003 |
out, err = d1.Cmd("node", "rm", "-f", d3ID)
|
| 2004 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 2004 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 2005 | 2005 |
|
| 2006 | 2006 |
// filter by scope |
| 2007 | 2007 |
waitForEvent(c, d1, t3, "-f scope=swarm", "node remove "+d3ID, defaultRetryCount) |
| ... | ... |
@@ -2012,7 +2012,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsNetwork(c *check.C) {
|
| 2012 | 2012 |
|
| 2013 | 2013 |
// create a network |
| 2014 | 2014 |
out, err := d.Cmd("network", "create", "--attachable", "-d", "overlay", "foo")
|
| 2015 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 2015 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 2016 | 2016 |
networkID := strings.TrimSpace(out) |
| 2017 | 2017 |
|
| 2018 | 2018 |
waitForEvent(c, d, "0", "-f scope=swarm", "network create "+networkID, defaultRetryCount) |
| ... | ... |
@@ -2020,7 +2020,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsNetwork(c *check.C) {
|
| 2020 | 2020 |
// remove network |
| 2021 | 2021 |
t1 := daemonUnixTime(c) |
| 2022 | 2022 |
out, err = d.Cmd("network", "rm", "foo")
|
| 2023 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 2023 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 2024 | 2024 |
|
| 2025 | 2025 |
// filtered by network |
| 2026 | 2026 |
waitForEvent(c, d, t1, "-f type=network", "network remove "+networkID, defaultRetryCount) |
| ... | ... |
@@ -16,7 +16,7 @@ func (s *DockerSwarmSuite) TestSwarmVolumePlugin(c *check.C) {
|
| 16 | 16 |
d := s.AddDaemon(c, true, true) |
| 17 | 17 |
|
| 18 | 18 |
out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--mount", "type=volume,source=my-volume,destination=/foo,volume-driver=customvolumedriver", "--name", "top", "busybox", "top")
|
| 19 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 19 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 20 | 20 |
|
| 21 | 21 |
// Make sure task stays pending before plugin is available |
| 22 | 22 |
waitAndAssert(c, defaultReconciliationTimeout, d.CheckServiceTasksInStateWithError("top", swarm.TaskStatePending, "missing plugin on 1 node"), checker.Equals, 1)
|
| ... | ... |
@@ -26,7 +26,7 @@ func (s *DockerSwarmSuite) TestSwarmVolumePlugin(c *check.C) {
|
| 26 | 26 |
|
| 27 | 27 |
// create a dummy volume to trigger lazy loading of the plugin |
| 28 | 28 |
out, err = d.Cmd("volume", "create", "-d", "customvolumedriver", "hello")
|
| 29 |
- c.Assert(err, checker.IsNil, check.Commentf(out)) |
|
| 29 |
+ c.Assert(err, checker.IsNil, check.Commentf("%s", out))
|
|
| 30 | 30 |
|
| 31 | 31 |
// TODO(aaronl): It will take about 15 seconds for swarm to realize the |
| 32 | 32 |
// plugin was loaded. Switching the test over to plugin v2 would avoid |
| ... | ... |
@@ -48,7 +48,7 @@ func (s *DockerSwarmSuite) TestSwarmVolumePlugin(c *check.C) {
|
| 48 | 48 |
} |
| 49 | 49 |
|
| 50 | 50 |
c.Assert(json.NewDecoder(strings.NewReader(out)).Decode(&mounts), checker.IsNil) |
| 51 |
- c.Assert(len(mounts), checker.Equals, 1, check.Commentf(out)) |
|
| 51 |
+ c.Assert(len(mounts), checker.Equals, 1, check.Commentf("%s", out))
|
|
| 52 | 52 |
c.Assert(mounts[0].Name, checker.Equals, "my-volume") |
| 53 | 53 |
c.Assert(mounts[0].Driver, checker.Equals, "customvolumedriver") |
| 54 | 54 |
} |