summaryrefslogtreecommitdiffstats
path: root/contrib/pjdfstest
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-04-16 03:35:47 +0000
committerngie <ngie@FreeBSD.org>2015-04-16 03:35:47 +0000
commit833a9d1e0eccc0091c373939241568ea646c3a33 (patch)
tree214207b671b837284271572c20725f1749ed09d9 /contrib/pjdfstest
parent5ca111b13feb51eed1681bc2c3eb8a2c017ae236 (diff)
downloadFreeBSD-src-833a9d1e0eccc0091c373939241568ea646c3a33.zip
FreeBSD-src-833a9d1e0eccc0091c373939241568ea646c3a33.tar.gz
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
Diffstat (limited to 'contrib/pjdfstest')
-rw-r--r--contrib/pjdfstest/tests/open/20.t4
-rw-r--r--contrib/pjdfstest/tests/truncate/11.t4
2 files changed, 8 insertions, 0 deletions
diff --git a/contrib/pjdfstest/tests/open/20.t b/contrib/pjdfstest/tests/open/20.t
index de80b61..7b94b03 100644
--- a/contrib/pjdfstest/tests/open/20.t
+++ b/contrib/pjdfstest/tests/open/20.t
@@ -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}
diff --git a/contrib/pjdfstest/tests/truncate/11.t b/contrib/pjdfstest/tests/truncate/11.t
index b00d7b8..f4ecb42 100644
--- a/contrib/pjdfstest/tests/truncate/11.t
+++ b/contrib/pjdfstest/tests/truncate/11.t
@@ -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}
OpenPOWER on IntegriCloud