1
0
mirror of https://github.com/containers/youki synced 2024-09-28 15:01:29 +02:00

Merge pull request #223 from chenyukang/fix-test-script

Show error log only when error happens
This commit is contained in:
utam0k 2021-08-24 21:15:32 +09:00 committed by GitHub
commit 3572f7ed46
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

@ -90,7 +90,11 @@ for case in "${test_cases[@]}"; do
fi
echo "Running $case"
if [ 0 -ne $(sudo RUST_BACKTRACE=1 YOUKI_LOG_LEVEL=debug RUNTIME=${RUNTIME} ${ROOT}/integration_test/src/github.com/opencontainers/runtime-tools/validation/$case | grep "not ok" | wc -l) ]; then
logfile="./log/$case.log"
mkdir -p "$(dirname $logfile)"
sudo RUST_BACKTRACE=1 RUNTIME=${RUNTIME} ${ROOT}/integration_test/src/github.com/opencontainers/runtime-tools/validation/$case >$logfile 2>&1
if [ 0 -ne $(grep "not ok" $logfile | wc -l ) ]; then
cat $logfile
exit 1
fi
sleep 1