Commit 947358a9 authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

test: add manual test for criu-coredump

Convert criu images to coredumps and check if they are
readable by readelf.
Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent e569e46b
*.img
*.log
*.txt
stats-*
*.json
core.*
run: clean
./test.sh
clean:
rm -f *.img stats-* core.*
#!/bin/bash
while :; do
sleep 1
done
source ../env.sh
function _exit {
if [ $? -ne 0 ]; then
echo "FAIL"
exit 1
fi
}
function gen_imgs {
setsid ./loop.sh < /dev/null &> /dev/null &
PID=$!
$CRIU dump -v4 -o dump.log -D ./ -t $PID
if [ $? -ne 0 ]; then
kill -9 $PID
_exit 1
fi
images_list=$(ls -1 *.img)
if [ -z "$images_list" ]; then
echo "Failed to generate images"
_exit 1
fi
}
function run_test {
echo "= Test core dump"
echo "=== img to core dump"
$CRIU_COREDUMP -i ./ -o ./ || _exit $?
echo "=== done"
cores=$(ls -1 core.*)
if [ -z "$cores" ]; then
echo "Failed to generate coredumps"
_exit 1
fi
for x in $cores
do
echo "=== try readelf $x"
readelf -a $x || _exit $?
echo "=== done"
done
echo "= done"
}
gen_imgs
run_test
...@@ -4,3 +4,5 @@ CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../criu/criu) ...@@ -4,3 +4,5 @@ CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../criu/criu)
criu=$CRIU criu=$CRIU
CRIT=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../crit/crit) CRIT=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../crit/crit)
crit=$CRIT crit=$CRIT
CRIU_COREDUMP=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../criu-coredump/criu-coredump)
criu_coredump=$CRIU_COREDUMP
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment