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.
pull/1329/head
Mike Grass 2017-04-04 23:25:23 -07:00
parent 6cd08d4756
commit 11c2dbc8d2
1 changed files with 9 additions and 8 deletions

View File

@ -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)
}
}
}