/
niceSOFT
/
util-linux
Обзор
Документация
Войти
/
niceSOFT
/
util-linux
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/ts/libmount/lock
41 строка
982 B
Karel Zak
tests: fix remaining shellcheck warnings
05 май 2026, 14:21
05 май 2026, 14:21
462bd92
Код
Авторство
О чём код?
#!/usr/bin/env bash # Copyright (C) 2010 Karel Zak <kzak@redhat.com> TS_TOPDIR="${0%/*}/../.." TS_DESC="lock" TS_OPTIONAL="yes" . "$TS_TOPDIR"/functions.sh ts_init "$*" TESTPROG="$TS_HELPER_LIBMOUNT_LOCK" [ -x $TESTPROG ] || ts_skip "test not compiled" # # Be careful with number of processes. Don't forget that there is time limit # when the mount waits on the mtab lock. If you define too much processes some # of them will fail with timeout. # # Note: the original version (< 2.13) of util-linux is completely useless for # this test (maximum for this old version is NLOOPS=10 and NPROCESSES=5 (2-way # 2GHz machine)). It has terrible performance due a bad timeouts implementation # in lock_mtab(). # NLOOPS=1000 NPROCESSES=50 : > "$TS_OUTPUT".debug echo 0 > "$TS_OUTPUT" SYNCTIME=$(( $(date +%s) + 5 )) for id in $(seq 0 $(( NPROCESSES - 1 ))); do ts_run $TESTPROG --lock --synctime $SYNCTIME "$TS_OUTPUT" $NLOOPS >> "$TS_OUTPUT".debug 2>&1 & done wait ts_finalize