Skip to content

Commit fe95a2a

Browse files
committed
tests/integration: Test exec failures
Signed-off-by: Rodrigo Campos <[email protected]>
1 parent 8afeccc commit fe95a2a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/integration/run.bats

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,20 @@ function teardown() {
230230
grep -E '^monotonic\s+7881\s+2718281$' <<<"$output"
231231
grep -E '^boottime\s+1337\s+3141519$' <<<"$output"
232232
}
233+
234+
@test "runc run [exec error]" {
235+
cat <<EOF >rootfs/run.sh
236+
#!/mmnnttbb foo bar
237+
sh
238+
EOF
239+
chmod +x rootfs/run.sh
240+
update_config '.process.args = [ "/run.sh" ]'
241+
runc run test_hello
242+
243+
# Ensure that the output contains the right error message. For runc-dmz, both
244+
# nolibc and libc have the same formatting string (but libc will print the
245+
# errno description rather than just the number), and for runc_nodmz the error
246+
# message from Go starts with the same string.
247+
[ "$status" -ne 0 ]
248+
[[ "$output" = *"exec /run.sh: "* ]]
249+
}

0 commit comments

Comments
 (0)