Browse Source

Properly close and remove file in daemon test

Fixes a bug where a file would be created and not deleted in
DockerSuite.TestDaemonDiscoveryBackendConfigReload

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Christopher Jones 9 năm trước cách đây
mục cha
commit
66e558c16c
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      integration-cli/docker_cli_daemon_test.go

+ 2 - 0
integration-cli/docker_cli_daemon_test.go

@@ -2170,7 +2170,9 @@ func (s *DockerSuite) TestDaemonDiscoveryBackendConfigReload(c *check.C) {
 
 	configFile, err = os.Create(configFilePath)
 	c.Assert(err, checker.IsNil)
+	defer os.Remove(configFilePath)
 	fmt.Fprintf(configFile, "%s", daemonConfig)
+	configFile.Close()
 
 	syscall.Kill(d.cmd.Process.Pid, syscall.SIGHUP)