• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:timeout +full:- +full:retries

3 # Copyright (c) Linux Test Project, 2014-2017
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
87 if [ $# -ne 1 ]; then
96 if [ $ret -eq 127 ]; then
104 if [ "$(id -ru)" != 0 ]; then
111 if [ -n "${TST_CLEANUP:-}" -a -z "${TST_NO_CLEANUP:-}" ]; then
115 if [ -n "${LTP_IPC_PATH:-}" -a -f "${LTP_IPC_PATH:-}" ]; then
116 rm -f "$LTP_IPC_PATH"
120 if [ $((LTP_RET_VAL & 7)) -eq 0 -a $TST_PASS_COUNT -gt 0 ]; then
129 if [ -z "$TMPDIR" ]; then
133 TST_TMPDIR=$(mktemp -d "$TMPDIR/$TCID.XXXXXXXXXX")
144 if [ -n "$TST_TMPDIR" ]; then
146 rm -r "$TST_TMPDIR"
158 if ! command -v $cmd > /dev/null 2>&1; then
166 # Function returns 0 if succeed in RETRIES times or the last retcode the cmd
171 local RETRIES=${2:-"3"}
172 local i=$RETRIES
174 while [ $i -gt 0 ]; do
177 if [ $ret -eq 0 ]; then
180 i=$((i-1))
184 if [ $ret -ne 0 ]; then
185 tst_resm TINFO "Failed to execute '$cmd' after $RETRIES retries"
191 # tst_timeout "command arg1 arg2 ..." timeout
192 # Runs command for specified timeout (in seconds).
197 local timeout=$(echo $2 | grep -o "^[0-9]\+$")
199 # command must be non-empty string with command to run
200 if [ -z "$command" ]; then
201 echo "first argument must be non-empty string"
205 # accept only numbers as timeout
206 if [ -z "$timeout" ]; then
211 setsid sh -c "eval $command" 2>&1 &
213 while [ $timeout -gt 0 ]; do
214 kill -s 0 $pid 2>/dev/null
215 if [ $? -ne 0 ]; then
218 timeout=$((timeout - 1))
223 if [ $timeout -le 0 ]; then
225 kill -TERM -- -$pid
239 if [ $? -ne 0 ]; then
256 if [ -n "$file" ]; then
262 if [ -n "$flag" ]; then
270 if [ -n "$flag" ]; then
280 if [ $? -ne 0 ]; then
288 if [ $? -eq 0 ]; then
299 if [ $? -ne 0 ]; then
313 if [ -z "$fs_type" ]; then
317 if [ -z "$device" ]; then
326 # Detect whether running under hypervisor: Microsoft Hyper-V
327 # Return 0: running under Hyper-V
328 # Return 1: not running under Hyper-V (bare metal, other hypervisor or
334 v="$(systemd-detect-virt)"
336 [ $? -eq 0 ] || return 1
347 if ! grep -q "$device" /proc/mounts; then
352 while [ "$i" -lt 50 ]; do
360 tst_resm TINFO "Likely gvfsd-trash is probing newly mounted "\
366 tst_resm TWARN "Failed to umount($device) after 50 retries"
375 if [ -f "$mod_name" ]; then
381 if [ -f "$mod_path" ]; then
386 if [ -n "$TST_TMPDIR" ]; then
388 if [ -f "$mod_path" ]; then
419 if [ -z "$TCID" ]; then
423 if [ -z "$TST_TOTAL" ]; then
431 if [ -z "$LTPROOT" ]; then
442 if [ $? -ne 0 ]; then