diff options
Diffstat (limited to 'tests/mv/i-3.sh')
-rwxr-xr-x | tests/mv/i-3.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/mv/i-3.sh b/tests/mv/i-3.sh index 8c58d5d3..5dba1fe4 100755 --- a/tests/mv/i-3.sh +++ b/tests/mv/i-3.sh @@ -2,7 +2,7 @@ # Make sure that 'mv file unwritable-file' prompts the user # and that 'mv -f file unwritable-file' doesn't. -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ require_controlling_input_terminal_ skip_if_root_ trap '' TTIN # Ignore SIGTTIN -test "$(uname -s)" = FreeBSD && skip_ "known spurious failure on FreeBSD" +uname -s | grep 'BSD$' && skip_ 'known spurious failure on *BSD' touch f g h i || framework_failure_ chmod 0 g i || framework_failure_ @@ -39,6 +39,9 @@ tty=$(readlink -f /dev/stdin) test -r "$tty" 2>&1 \ || skip_ '/dev/stdin is not readable' +# Terminate any background processes +cleanup_() { kill $pid 2>/dev/null && wait $pid; } + mv f g < $tty > out 2>&1 & pid=$! # Test for the expected prompt; sleep upon non-match. @@ -54,7 +57,7 @@ check_overwrite_prompt() # Wait for up to 12.7 seconds for the expected prompt. retry_delay_ check_overwrite_prompt .1 7 || { fail=1; cat out; } -kill $pid +cleanup_ mv -f h i > out 2>&1 || fail=1 test -f i || fail=1 |