File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -322,3 +322,21 @@ function check_exec_debug() {
322322 runc exec --cgroup second test_busybox grep -w second /proc/self/cgroup
323323 [ " $status " -eq 0 ]
324324}
325+
326+ @test " RUNC_DMZ=legacy runc exec [execve error]" {
327+ cat << EOF >rootfs/run.sh
328+ #!/mmnnttbb foo bar
329+ sh
330+ EOF
331+ chmod +x rootfs/run.sh
332+ RUNC_DMZ=legacy runc run -d --console-socket " $CONSOLE_SOCKET " test_busybox
333+ RUNC_DMZ=legacy runc exec -t test_busybox /run.sh
334+ [ " $status " -ne 0 ]
335+
336+ # After the sync socket closed, we should not send error to parent
337+ # process, or else we will get a unnecessary error log(#4171).
338+ # Although we never close the sync socket when doing exec,
339+ # but we need to keep this test to ensure this behavior is always right.
340+ [ ${# lines[@]} -eq 1 ]
341+ [[ ${lines[0]} = * " exec failed: unable to start container process: exec /run.sh: no such file or directory" * ]]
342+ }
Original file line number Diff line number Diff line change 247247 [ " $status " -ne 0 ]
248248 [[ " $output " = * " exec /run.sh: " * ]]
249249}
250+
251+ @test " RUNC_DMZ=legacy runc run [execve error]" {
252+ cat << EOF >rootfs/run.sh
253+ #!/mmnnttbb foo bar
254+ sh
255+ EOF
256+ chmod +x rootfs/run.sh
257+ update_config ' .process.args = [ "/run.sh" ]'
258+ RUNC_DMZ=legacy runc run test_hello
259+ [ " $status " -ne 0 ]
260+
261+ # After the sync socket closed, we should not send error to parent
262+ # process, or else we will get a unnecessary error log(#4171).
263+ [ ${# lines[@]} -eq 1 ]
264+ [[ ${lines[0]} = " exec /run.sh: no such file or directory" ]]
265+ }
You can’t perform that action at this time.
0 commit comments