From 11c2dbc8d21e03f84a6cf88e2d1dd15b4b1da10e Mon Sep 17 00:00:00 2001 From: Mike Grass Date: Tue, 4 Apr 2017 23:25:23 -0700 Subject: [PATCH] Dump docker systemd config using systemctl The TestDocker integration test shouldn't hard code the path to the systemd config for docker.service -- instead, it can use `systemctl show` to dump the configuration for the docker service. --- test/integration/docker_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/integration/docker_test.go b/test/integration/docker_test.go index fb9f970a9d..96deed2491 100644 --- a/test/integration/docker_test.go +++ b/test/integration/docker_test.go @@ -38,18 +38,19 @@ func TestDocker(t *testing.T) { minikubeRunner.RunCommand(startCmd, true) minikubeRunner.EnsureRunning() - filename := "/etc/systemd/system/docker.service" - - profileContents := minikubeRunner.RunCommand(fmt.Sprintf("ssh sudo cat %s", filename), true) - fmt.Println(profileContents) + dockerdEnvironment := minikubeRunner.RunCommand("ssh -- systemctl show docker --property=Environment", true) + fmt.Println(dockerdEnvironment) for _, envVar := range []string{"FOO=BAR", "BAZ=BAT"} { - if !strings.Contains(profileContents, envVar) { - t.Fatalf("Env var %s missing from file: %s.", envVar, profileContents) + if !strings.Contains(dockerdEnvironment, envVar) { + t.Fatalf("Env var %s missing from Environment: %s.", envVar, dockerdEnvironment) } } + + dockerdExecStart := minikubeRunner.RunCommand("ssh -- systemctl show docker --property=ExecStart", true) + fmt.Println(dockerdExecStart) for _, opt := range []string{"--debug", "--icc=true"} { - if !strings.Contains(profileContents, opt) { - t.Fatalf("Option %s missing from file: %s.", opt, profileContents) + if !strings.Contains(dockerdExecStart, opt) { + t.Fatalf("Option %s missing from ExecStart: %s.", opt, dockerdExecStart) } } }