diff --git a/tests/integration/exec.bats b/tests/integration/exec.bats index 069214cc956..9cfcaf1d886 100644 --- a/tests/integration/exec.bats +++ b/tests/integration/exec.bats @@ -322,3 +322,16 @@ function check_exec_debug() { runc exec --cgroup second test_busybox grep -w second /proc/self/cgroup [ "$status" -eq 0 ] } + +@test "RUNC_DMZ=legacy runc exec [execve error]" { + cat <rootfs/run.sh +#!/mmnnttbb foo bar +sh +EOF + chmod +x rootfs/run.sh + RUNC_DMZ=legacy runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox + RUNC_DMZ=legacy runc exec -t test_busybox /run.sh + [ "$status" -ne 0 ] + [ ${#lines[@]} -eq 1 ] + [[ ${lines[0]} = *"exec failed: unable to start container process: exec /run.sh: no such file or directory"* ]] +} diff --git a/tests/integration/run.bats b/tests/integration/run.bats index f6bd3c86500..2c885f7803a 100644 --- a/tests/integration/run.bats +++ b/tests/integration/run.bats @@ -230,3 +230,16 @@ function teardown() { grep -E '^monotonic\s+7881\s+2718281$' <<<"$output" grep -E '^boottime\s+1337\s+3141519$' <<<"$output" } + +@test "RUNC_DMZ=legacy runc run [execve error]" { + cat <rootfs/run.sh +#!/mmnnttbb foo bar +sh +EOF + chmod +x rootfs/run.sh + update_config '.process.args = [ "/run.sh" ]' + RUNC_DMZ=legacy runc run test_hello + [ "$status" -ne 0 ] + [ ${#lines[@]} -eq 1 ] + [[ ${lines[0]} = "exec /run.sh: no such file or directory" ]] +}