mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
test: print out logs if tests fail
If the tests in others/rpc are failing no information about that error can be seen in a CI run. This change displays the log files if the test fails. Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
committed by
Andrei Vagin
parent
26068cfee9
commit
6d8898c4e7
@@ -8,9 +8,17 @@ PYTHON ?= python3
|
||||
|
||||
run: all
|
||||
@make -C .. loop
|
||||
mkdir -p build
|
||||
mkdir -p build/{imgs_errno,imgs_ps,imgs_c,imgs_loop,imgs_py}
|
||||
chmod a+rwx build
|
||||
chmod a+rwx build/{imgs_errno,imgs_ps,imgs_c,imgs_loop,imgs_py}
|
||||
rm -f build/status
|
||||
@# Create all log files to be accessible for anybody
|
||||
@# so that they can be displayed by any user.
|
||||
for i in imgs_errno/criu.log imgs_ps/page-server.log imgs_ps/dump.log \
|
||||
imgs_c/restore-c.log imgs_loop/criu.log imgs_loop/dump-loop.log \
|
||||
imgs_py/criu.log imgs_py/restore-py.log imgs_c/criu.log service.log; do \
|
||||
touch build/$$i; chmod 666 build/$$i; \
|
||||
done
|
||||
sudo -g '#1000' -u '#1000' mkfifo build/status
|
||||
@# Need to start the criu daemon here to access the pidfile.
|
||||
@# The script read.py is used to wait until 'criu service'
|
||||
|
@@ -3,6 +3,7 @@
|
||||
set -e
|
||||
|
||||
CRIU=./criu
|
||||
FAIL=1
|
||||
|
||||
export PROTODIR=`readlink -f "${PWD}/../../protobuf"`
|
||||
|
||||
@@ -19,6 +20,13 @@ function stop_server {
|
||||
title_print "Shutdown service server"
|
||||
kill -SIGTERM $(cat build/pidfile)
|
||||
unlink build/pidfile
|
||||
if [ "${FAIL}" == "1" ]; then
|
||||
for i in build/output*; do
|
||||
echo "File: $i"
|
||||
cat $i
|
||||
done
|
||||
find . -name "*.log" -print -exec cat {} \; || true
|
||||
fi
|
||||
}
|
||||
|
||||
function test_c {
|
||||
@@ -80,6 +88,8 @@ test_restore_loop
|
||||
test_ps
|
||||
test_errno
|
||||
|
||||
FAIL=0
|
||||
|
||||
stop_server
|
||||
|
||||
trap 'echo "Success"' EXIT
|
||||
|
Reference in New Issue
Block a user