Merge pull request #8697 from microsoft/danmihai1/runk

tests: additional run-runk logging
This commit is contained in:
Dan Mihai 2023-12-19 11:27:29 -08:00 committed by GitHub
commit 6cea8a5f2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,8 +40,12 @@ test_runk() {
echo "test ps command"
sudo ctr t exec --detach --exec-id id1 ${CONTAINER_ID} sh
# one line is the titles, and the other 2 lines are porcess info
[ "3" == "$(sudo ctr t ps ${CONTAINER_ID} | wc -l)" ] || die "ps command failed"
ps_out="$(sudo ctr t ps ${CONTAINER_ID})" || die "ps command failed"
printf "ps output:\n%s\n" "${ps_out}"
lines_no="$(printf "%s\n" "${ps_out}" | wc -l)"
echo "ps output lines: ${lines_no}"
# one line is the titles, and the other 2 lines are process info
[ "3" == "${lines_no}" ] || die "unexpected ps command output"
echo "test pause and resume"
# The process outputs lines into /tmp/{CONTAINER_ID}, which can be read in host when it's frozon.