From 49099f4c70b316705739d9ccfbee33825680f0d5 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Wed, 10 Feb 2016 13:54:54 -0800 Subject: [PATCH] Fixed more tests --- client/driver/exec_test.go | 28 ++++++++++++++++++++++++++++ client/driver/java_test.go | 12 ++++++++++++ client/driver/qemu_test.go | 8 ++++++++ client/driver/raw_exec_test.go | 24 ++++++++++++++++++++++++ 4 files changed, 72 insertions(+) diff --git a/client/driver/exec_test.go b/client/driver/exec_test.go index 85da6bfa5..dcfe56604 100644 --- a/client/driver/exec_test.go +++ b/client/driver/exec_test.go @@ -50,6 +50,10 @@ func TestExecDriver_StartOpen_Wait(t *testing.T) { "command": "/bin/sleep", "args": []string{"5"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } @@ -87,6 +91,10 @@ func TestExecDriver_KillUserPid_OnPluginReconnectFailure(t *testing.T) { "command": "/bin/sleep", "args": []string{"1000000"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } @@ -144,6 +152,10 @@ func TestExecDriver_Start_Wait(t *testing.T) { "command": "/bin/sleep", "args": []string{"2"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } @@ -188,6 +200,10 @@ func TestExecDriver_Start_Artifact_basic(t *testing.T) { "artifact_source": fmt.Sprintf("https://dl.dropboxusercontent.com/u/47675/jar_thing/%s?checksum=%s", file, checksum), "command": file, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } @@ -232,6 +248,10 @@ func TestExecDriver_Start_Artifact_expanded(t *testing.T) { "command": "/bin/bash", "args": []string{"-c", fmt.Sprintf("/bin/sleep 1 && %s", file)}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } @@ -278,6 +298,10 @@ func TestExecDriver_Start_Wait_AllocDir(t *testing.T) { fmt.Sprintf(`sleep 1; echo -n %s > ${%s}/%s`, string(exp), env.AllocDir, file), }, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } @@ -324,6 +348,10 @@ func TestExecDriver_Start_Kill_Wait(t *testing.T) { "command": "/bin/sleep", "args": []string{"100"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, KillTimeout: 10 * time.Second, } diff --git a/client/driver/java_test.go b/client/driver/java_test.go index a546c611f..7b3fe5076 100644 --- a/client/driver/java_test.go +++ b/client/driver/java_test.go @@ -58,6 +58,10 @@ func TestJavaDriver_StartOpen_Wait(t *testing.T) { "jvm_options": []string{"-Xmx64m", "-Xms32m"}, "checksum": "sha256:58d6e8130308d32e197c5108edd4f56ddf1417408f743097c2e662df0f0b17c8", }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } @@ -103,6 +107,10 @@ func TestJavaDriver_Start_Wait(t *testing.T) { "artifact_source": "https://dl.dropboxusercontent.com/u/47675/jar_thing/demoapp.jar", "checksum": "sha256:58d6e8130308d32e197c5108edd4f56ddf1417408f743097c2e662df0f0b17c8", }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } @@ -148,6 +156,10 @@ func TestJavaDriver_Start_Kill_Wait(t *testing.T) { Config: map[string]interface{}{ "artifact_source": "https://dl.dropboxusercontent.com/u/47675/jar_thing/demoapp.jar", }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } diff --git a/client/driver/qemu_test.go b/client/driver/qemu_test.go index 151fcf7f9..ff163f975 100644 --- a/client/driver/qemu_test.go +++ b/client/driver/qemu_test.go @@ -49,6 +49,10 @@ func TestQemuDriver_StartOpen_Wait(t *testing.T) { "web": 8080, }}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: &structs.Resources{ CPU: 500, MemoryMB: 512, @@ -101,6 +105,10 @@ func TestQemuDriver_RequiresMemory(t *testing.T) { "checksum": "sha256:a5e836985934c3392cbbd9b26db55a7d35a8d7ae1deb7ca559dd9c0159572544", // ssh u/p would be here }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, } driverCtx, execCtx := testDriverContexts(task) diff --git a/client/driver/raw_exec_test.go b/client/driver/raw_exec_test.go index a09010d3e..942780ae6 100644 --- a/client/driver/raw_exec_test.go +++ b/client/driver/raw_exec_test.go @@ -61,6 +61,10 @@ func TestRawExecDriver_StartOpen_Wait(t *testing.T) { "command": testtask.Path(), "args": []string{"sleep", "1s"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } testtask.SetTaskEnv(task) @@ -109,6 +113,10 @@ func TestRawExecDriver_Start_Artifact_basic(t *testing.T) { "command": file, "args": []string{"sleep", "1s"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } testtask.SetTaskEnv(task) @@ -156,6 +164,10 @@ func TestRawExecDriver_Start_Artifact_expanded(t *testing.T) { "command": file, "args": []string{"sleep", "1s"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } testtask.SetTaskEnv(task) @@ -197,6 +209,10 @@ func TestRawExecDriver_Start_Wait(t *testing.T) { "command": testtask.Path(), "args": []string{"sleep", "1s"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } testtask.SetTaskEnv(task) @@ -243,6 +259,10 @@ func TestRawExecDriver_Start_Wait_AllocDir(t *testing.T) { "write", string(exp), outPath, }, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } testtask.SetTaskEnv(task) @@ -289,6 +309,10 @@ func TestRawExecDriver_Start_Kill_Wait(t *testing.T) { "command": testtask.Path(), "args": []string{"sleep", "45s"}, }, + LogConfig: &structs.LogConfig{ + MaxFiles: 10, + MaxFileSizeMB: 10, + }, Resources: basicResources, } testtask.SetTaskEnv(task)