1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #43458 from thaJeztah/fix_daemon_config_test

daemon/config: fix TestReloadDefaultConfigNotExist if file exists
This commit is contained in:
Sebastiaan van Stijn 2022-04-08 12:34:30 +02:00 committed by GitHub
commit 7ea283fd91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -446,10 +446,10 @@ func TestReloadSetConfigFileNotExist(t *testing.T) {
func TestReloadDefaultConfigNotExist(t *testing.T) { func TestReloadDefaultConfigNotExist(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root") skip.If(t, os.Getuid() != 0, "skipping test that requires root")
reloaded := false reloaded := false
configFile := "/etc/docker/daemon.json" defaultConfigFile := "/tmp/blabla/not/exists/daemon.json"
flags := pflag.NewFlagSet("test", pflag.ContinueOnError) flags := pflag.NewFlagSet("test", pflag.ContinueOnError)
flags.String("config-file", configFile, "") flags.String("config-file", defaultConfigFile, "")
err := Reload(configFile, flags, func(c *Config) { err := Reload(defaultConfigFile, flags, func(c *Config) {
reloaded = true reloaded = true
}) })
assert.Check(t, err) assert.Check(t, err)