Skip to content

Commit

Permalink
tests/integration: Test exec failures
Browse files Browse the repository at this point in the history
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
  • Loading branch information
rata committed Jan 21, 2024
1 parent ad57a33 commit 3e417b4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/integration/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,21 @@ function teardown() {
grep -E '^monotonic\s+7881\s+2718281$' <<<"$output"
grep -E '^boottime\s+1337\s+3141519$' <<<"$output"
}

@test "runc run [exec error]" {
cat <<EOF >rootfs/run.sh
#!/mmnnttbb foo bar
sh
EOF
chmod +x rootfs/run.sh
update_config '.process.args = [ "/run.sh" ]'
runc run test_hello


# Ensure that the output contains the right error message. For runc-dmz, both
# nolibc and libc have the same formatting string (but libc will print the
# errno description rather than just the number), and for runc_nodmz the error
# message from Go starts with the same string.
[ "$status" -ne 0 ]
[[ "$output" = *"exec /run.sh: "* ]]
}

0 comments on commit 3e417b4

Please sign in to comment.