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 18, 2024
1 parent 0fe9f44 commit 12c7025
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/integration/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,20 @@ 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

# The output for sure must includes this.
# If we use nolibc, it just prints the errno number, but with libc, we expand it to a
# message.
# Let's just check what must be always present and that it returned an error.
[ "$status" -ne 0 ]
[[ "$output" = *"exec /run.sh: "* ]]
}

0 comments on commit 12c7025

Please sign in to comment.