mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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>
This commit is contained in:
parent
c08b674d56
commit
66e558c16c
1 changed files with 2 additions and 0 deletions
|
@ -2170,7 +2170,9 @@ func (s *DockerSuite) TestDaemonDiscoveryBackendConfigReload(c *check.C) {
|
||||||
|
|
||||||
configFile, err = os.Create(configFilePath)
|
configFile, err = os.Create(configFilePath)
|
||||||
c.Assert(err, checker.IsNil)
|
c.Assert(err, checker.IsNil)
|
||||||
|
defer os.Remove(configFilePath)
|
||||||
fmt.Fprintf(configFile, "%s", daemonConfig)
|
fmt.Fprintf(configFile, "%s", daemonConfig)
|
||||||
|
configFile.Close()
|
||||||
|
|
||||||
syscall.Kill(d.cmd.Process.Pid, syscall.SIGHUP)
|
syscall.Kill(d.cmd.Process.Pid, syscall.SIGHUP)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue