From e88258ca2ef0047973168a29fd9ec27669582c0e Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Tue, 26 Jan 2016 08:31:50 -0500 Subject: [PATCH] Test utils: fix daemon start utils User call `Start` could with args, and the args could contains `--storage-driver`, but in `Start`, it will add `--storage-driver` even though user has specified `--storage-driver` in args. Signed-off-by: Lei Jitang --- integration-cli/docker_utils.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/integration-cli/docker_utils.go b/integration-cli/docker_utils.go index d23c6e3a19..647b2c8df5 100644 --- a/integration-cli/docker_utils.go +++ b/integration-cli/docker_utils.go @@ -224,17 +224,20 @@ func (d *Daemon) Start(arg ...string) error { // If we don't explicitly set the log-level or debug flag(-D) then // turn on debug mode - foundIt := false + foundLog := false + foundSd := false for _, a := range arg { if strings.Contains(a, "--log-level") || strings.Contains(a, "-D") || strings.Contains(a, "--debug") { - foundIt = true + foundLog = true + } + if strings.Contains(a, "--storage-driver") { + foundSd = true } } - if !foundIt { + if !foundLog { args = append(args, "--debug") } - - if d.storageDriver != "" { + if d.storageDriver != "" && !foundSd { args = append(args, "--storage-driver", d.storageDriver) }