From a3d3055d754d6279e20075a2ba1ec53e1d99381a Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 31 Aug 2018 12:30:03 -0400 Subject: [PATCH] Wait before start with runtime root test Signed-off-by: Michael Crosby --- daemon_config_linux_test.go | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/daemon_config_linux_test.go b/daemon_config_linux_test.go index 772ce3d2e..793baa0ad 100644 --- a/daemon_config_linux_test.go +++ b/daemon_config_linux_test.go @@ -109,10 +109,10 @@ func newDaemonWithConfig(t *testing.T, configTOML string) (*Client, *daemon, fun // cleaning config-specific resources is up to the caller } return client, &ctrd, cleanup - } -func testDaemonRuntimeRoot(t *testing.T, noShim bool) { +// TestDaemonRuntimeRoot ensures plugin.linux.runtime_root is not ignored +func TestDaemonRuntimeRoot(t *testing.T) { runtimeRoot, err := ioutil.TempDir("", "containerd-test-runtime-root") if err != nil { t.Fatal(err) @@ -154,6 +154,11 @@ func testDaemonRuntimeRoot(t *testing.T, noShim bool) { } defer task.Delete(ctx) + status, err := task.Wait(ctx) + if err != nil { + t.Fatal(err) + } + if err = task.Start(ctx); err != nil { t.Fatal(err) } @@ -163,23 +168,8 @@ func testDaemonRuntimeRoot(t *testing.T, noShim bool) { t.Errorf("error while getting stat for %s: %v", stateJSONPath, err) } - finishedC, err := task.Wait(ctx) - if err != nil { - t.Fatal(err) - } if err = task.Kill(ctx, syscall.SIGKILL); err != nil { t.Error(err) } - <-finishedC -} - -// TestDaemonRuntimeRoot ensures plugin.linux.runtime_root is not ignored -func TestDaemonRuntimeRoot(t *testing.T) { - testDaemonRuntimeRoot(t, false) -} - -// TestDaemonRuntimeRootNoShim ensures plugin.linux.runtime_root is not ignored when no_shim is true -func TestDaemonRuntimeRootNoShim(t *testing.T) { - t.Skip("no_shim is not functional now: https://github.com/containerd/containerd/issues/2181") - testDaemonRuntimeRoot(t, true) + <-status }