svn commit: r281584 - in head/contrib/pjdfstest/tests: open truncate
Garrett Cooper
ngie at FreeBSD.org
Thu Apr 16 03:35:49 UTC 2015
Author: ngie
Date: Thu Apr 16 03:35:47 2015
New Revision: 281584
URL: https://svnweb.freebsd.org/changeset/base/281584
Log:
Fix race when testing for ETXTBSY writing to ${n0} (process image) by making
sure the process has been started beforehand with pgrep
pkill the process afterwards to make sure it's dead when the unlink is run
(not strictly required, but I was being conservative)
MFC after: 1 week
Reviewed by: Darius O'Conner, mjohnston
Sponsored by: EMC / Isilon Storage Division
Modified:
head/contrib/pjdfstest/tests/open/20.t
head/contrib/pjdfstest/tests/truncate/11.t
Modified: head/contrib/pjdfstest/tests/open/20.t
==============================================================================
--- head/contrib/pjdfstest/tests/open/20.t Thu Apr 16 02:44:37 2015 (r281583)
+++ head/contrib/pjdfstest/tests/open/20.t Thu Apr 16 03:35:47 2015 (r281584)
@@ -14,7 +14,11 @@ n0=`namegen`
cp -pf `which sleep` ${n0}
./${n0} 3 &
+while ! pkill -0 -f ./${n0}; do
+ sleep 0.1
+done
expect ETXTBSY open ${n0} O_WRONLY
expect ETXTBSY open ${n0} O_RDWR
expect ETXTBSY open ${n0} O_RDONLY,O_TRUNC
+pkill -9 -f ./${n0}
expect 0 unlink ${n0}
Modified: head/contrib/pjdfstest/tests/truncate/11.t
==============================================================================
--- head/contrib/pjdfstest/tests/truncate/11.t Thu Apr 16 02:44:37 2015 (r281583)
+++ head/contrib/pjdfstest/tests/truncate/11.t Thu Apr 16 03:35:47 2015 (r281584)
@@ -14,5 +14,9 @@ n0=`namegen`
cp -pf `which sleep` ${n0}
./${n0} 3 &
+while ! pkill -0 -f ./${n0}; do
+ sleep 0.1
+done
expect ETXTBSY truncate ${n0} 123
+pkill -9 -f ./${n0}
expect 0 unlink ${n0}
More information about the svn-src-head
mailing list