From 6571fa548d8286a2aff568685cdd53f0c858f614 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Thu, 25 May 2017 09:28:10 -0700 Subject: [PATCH] Switch tests to mock_driver --- client/alloc_runner_test.go | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/client/alloc_runner_test.go b/client/alloc_runner_test.go index 402d2f99a..8d15c5482 100644 --- a/client/alloc_runner_test.go +++ b/client/alloc_runner_test.go @@ -135,21 +135,12 @@ func TestAllocRunner_RetryArtifact(t *testing.T) { } func TestAllocRunner_TerminalUpdate_Destroy(t *testing.T) { - ctestutil.ExecCompatible(t) upd, ar := testAllocRunner(false) - // Shrink chroot - ar.config.ChrootEnv = map[string]string{ - "/bin": "/bin", - "/lib": "/lib", - "/lib32": "/lib32", - "/lib64": "/lib64", - } - // Ensure task takes some time task := ar.alloc.Job.TaskGroups[0].Tasks[0] - task.Config["command"] = "/bin/sleep" - task.Config["args"] = []string{"10"} + task.Driver = "mock_driver" + task.Config["run_for"] = "10s" go ar.Run() testutil.WaitForResult(func() (bool, error) { @@ -242,21 +233,12 @@ func TestAllocRunner_TerminalUpdate_Destroy(t *testing.T) { } func TestAllocRunner_Destroy(t *testing.T) { - ctestutil.ExecCompatible(t) upd, ar := testAllocRunner(false) - // Shrink chroot - ar.config.ChrootEnv = map[string]string{ - "/bin": "/bin", - "/lib": "/lib", - "/lib32": "/lib32", - "/lib64": "/lib64", - } - // Ensure task takes some time task := ar.alloc.Job.TaskGroups[0].Tasks[0] - task.Config["command"] = "/bin/sleep" - task.Config["args"] = []string{"10"} + task.Driver = "mock_driver" + task.Config["run_for"] = "10s" go ar.Run() start := time.Now() @@ -306,13 +288,12 @@ func TestAllocRunner_Destroy(t *testing.T) { } func TestAllocRunner_Update(t *testing.T) { - ctestutil.ExecCompatible(t) _, ar := testAllocRunner(false) // Ensure task takes some time task := ar.alloc.Job.TaskGroups[0].Tasks[0] - task.Config["command"] = "/bin/sleep" - task.Config["args"] = []string{"10"} + task.Driver = "mock_driver" + task.Config["run_for"] = "10s" go ar.Run() defer ar.Destroy()