/
githubmirror
/
liburing
Обзор
Документация
Войти
/
githubmirror
/
liburing
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
liburing-0.2
test/runtests.sh
51 строка
920 B
Jens Axboe
test/runtests.sh: only log first test to have alive workers on exit
24 окт 2019, 22:53
24 окт 2019, 22:53
5a9ab8d
Код
Авторство
О чём код?
#!/bin/bash TESTS="$@" RET=0 TIMEOUT=30 FAILED="" MAYBE_FAILED="" do_kmsg="yes" if ! [ $(id -u) = 0 ]; then do_kmsg="no" fi for t in $TESTS; do if [ "$do_kmsg" = "yes" ]; then echo Running test $t | tee > /dev/kmsg else echo Running test $t fi timeout --preserve-status -s INT $TIMEOUT ./$t r=$? if [ "${r}" -eq 124 ]; then echo "Test $t timed out (may not be a failure)" elif [ "${r}" -ne 0 ]; then echo "Test $t failed with ret ${r}" FAILED="$FAILED $t" RET=1 else sleep .1 ps aux | grep "\[io_wq_manager\]" > /dev/null R="$?" if [ "$R" -eq 0 ]; then if [ -z "$MAYBE_FAILED" ]; then echo "Test $t has alive workers after exit?!" fi MAYBE_FAILED="$MAYBE_FAILED $t" fi fi done if [ "${RET}" -ne 0 ]; then echo "Tests $FAILED failed" exit $RET else if [ ! -z "$MAYBE_FAILED" ]; then echo "Tests _maybe_ failed: $MAYBE_FAILED" fi echo "All tests passed" exit 0 fi