From 512bc52af5e229a5fce2b73b1510aed0b9799cbc Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Fri, 3 May 2019 16:20:05 -0400 Subject: [PATCH] executor_linux_test test PATH lookup inside the container --- drivers/shared/executor/executor_linux_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/shared/executor/executor_linux_test.go b/drivers/shared/executor/executor_linux_test.go index 8c0129165..04799b2df 100644 --- a/drivers/shared/executor/executor_linux_test.go +++ b/drivers/shared/executor/executor_linux_test.go @@ -179,6 +179,22 @@ func TestExecutor_EscapeContainer(t *testing.T) { _, err := executor.Launch(execCmd) require.Error(err) require.Regexp("^file /bin/kill not found under path", err) + + // Bare files are looked up using the system path, inside the container + allocDir.Destroy() + testExecCmd = testExecutorCommandWithChroot(t) + execCmd, allocDir = testExecCmd.command, testExecCmd.allocDir + execCmd.Cmd = "kill" + _, err = executor.Launch(execCmd) + require.Error(err) + require.Regexp("^file kill not found under path", err) + + allocDir.Destroy() + testExecCmd = testExecutorCommandWithChroot(t) + execCmd, allocDir = testExecCmd.command, testExecCmd.allocDir + execCmd.Cmd = "echo" + _, err = executor.Launch(execCmd) + require.NoError(err) } func TestExecutor_ClientCleanup(t *testing.T) {