summaryrefslogtreecommitdiff
path: root/tests/du/move-dir-while-traversing.sh
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-07-04 17:13:50 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-07-04 17:13:50 +0300
commit71cd8e3a743046573744123777061b64881bf372 (patch)
tree82522befe647f4fff186a5630cad0cad33f8ef53 /tests/du/move-dir-while-traversing.sh
parentc18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff)
downloadcoreutils-upstream.tar.gz
Imported Upstream version 8.24upstream/8.24upstream
Diffstat (limited to 'tests/du/move-dir-while-traversing.sh')
-rwxr-xr-xtests/du/move-dir-while-traversing.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/du/move-dir-while-traversing.sh b/tests/du/move-dir-while-traversing.sh
index 046dad90..67bb3458 100755
--- a/tests/du/move-dir-while-traversing.sh
+++ b/tests/du/move-dir-while-traversing.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Trigger a failed assertion in coreutils-8.9 and earlier.
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2011-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
@@ -71,14 +71,17 @@ for i in $(seq 50); do
mkdir -p $t/3/a/b/c/$i/$long || framework_failure_
done
+# Terminate any background cp process
+cleanup_() { kill $pid 2>/dev/null && wait $pid; }
+
# Prohibit suspension, which could otherwise cause a timeout-induced FP failure.
trap '' TSTP
-timeout 6 ./inotify-watch-for-dir-access.py $t/3/a/b > start-msg &
+timeout 6 ./inotify-watch-for-dir-access.py $t/3/a/b > start-msg & pid=$!
# Wait for the watcher to start...
nonempty() { test -s start-msg || { sleep $1; return 1; }; }
-retry_delay_ nonempty .1 5
+retry_delay_ nonempty .1 5 || fail=1
# The above watches for an IN_OPEN event on $t/3/a/b,
# and when it triggers, moves the parent, $t/3/a, up one level