From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: david@fromorbit.com
Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org,
xfs@oss.sgi.com, hch@infradead.org
Subject: [PATCH v2 2/7] tests: don't put loop control files on the scratch mount
Date: Thu, 26 May 2016 20:28:05 -0700 [thread overview]
Message-ID: <20160527032804.GA9418@birch.djwong.org> (raw)
In-Reply-To: <146424223512.6278.15231849939938178494.stgit@birch.djwong.org>
If we're doing write/overwrite/snapshot/resource exhaustion tests on
the scratch device, use the test directory to hold the loop
termination signal files. This way we don't run infinitely because we
can't create the flag due to ENOSPC.
v2: put the control files in /tmp, not $TEST_DIR
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/generic/162 | 8 +++++---
tests/generic/163 | 8 +++++---
tests/generic/164 | 8 +++++---
tests/generic/165 | 8 +++++---
tests/generic/166 | 8 +++++---
tests/generic/167 | 8 +++++---
tests/generic/168 | 8 +++++---
tests/generic/170 | 8 +++++---
tests/generic/333 | 20 ++++++++++++--------
tests/generic/334 | 20 ++++++++++++--------
10 files changed, 64 insertions(+), 40 deletions(-)
diff --git a/tests/generic/162 b/tests/generic/162
index 5ff2ee2..61cf463 100755
--- a/tests/generic/162
+++ b/tests/generic/162
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file
wait
}
@@ -51,6 +51,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
mkdir $testdir
loops=512
@@ -64,7 +66,7 @@ _pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file2 >> $seqres.full
_scratch_cycle_mount
overwrite() {
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
seq $nr_loops -1 0 | while read i; do
_pwrite_byte 0x61 $((i * blksz)) $blksz $testdir/file2 >> $seqres.full
done
@@ -81,7 +83,7 @@ for i in `seq 1 2`; do
done
done
echo "Finished dedupeing"
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/163 b/tests/generic/163
index fcba677..e2c6042 100755
--- a/tests/generic/163
+++ b/tests/generic/163
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file
wait
}
@@ -51,6 +51,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
mkdir $testdir
loops=512
@@ -64,7 +66,7 @@ _pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file2 >> $seqres.full
_scratch_cycle_mount
overwrite() {
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
seq $nr_loops -1 0 | while read i; do
_pwrite_byte 0x61 $((i * blksz)) $blksz $testdir/file1 >> $seqres.full
done
@@ -81,7 +83,7 @@ for i in `seq 1 2`; do
done
done
echo "Finished dedupeing"
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/164 b/tests/generic/164
index acacb7f..78ea787 100755
--- a/tests/generic/164
+++ b/tests/generic/164
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file
wait
}
@@ -53,6 +53,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
mkdir $testdir
loops=512
@@ -71,7 +73,7 @@ fbytes() {
}
reader() {
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
_read_range $testdir/file3 0 $((loops * blksz)) | fbytes
done
}
@@ -91,7 +93,7 @@ for i in `seq 1 2`; do
done
done
echo "Finished reflinking"
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/165 b/tests/generic/165
index b742d19..ca11e1e 100755
--- a/tests/generic/165
+++ b/tests/generic/165
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file
wait
}
@@ -54,6 +54,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
mkdir $testdir
loops=512
@@ -72,7 +74,7 @@ fbytes() {
}
reader() {
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
_read_range $testdir/file3 0 $((loops * blksz)) -d | fbytes
done
}
@@ -92,7 +94,7 @@ for i in `seq 1 2`; do
done
done
echo "Finished reflinking"
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/166 b/tests/generic/166
index 0e31f2e..8600a13 100755
--- a/tests/generic/166
+++ b/tests/generic/166
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file
wait
}
@@ -54,6 +54,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
mkdir $testdir
loops=1024
@@ -68,7 +70,7 @@ _scratch_cycle_mount
# Snapshot creator...
snappy() {
n=0
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)"
res=$?
echo "$out" | grep -q "No space left" && break
@@ -83,7 +85,7 @@ snappy &
seq $nr_loops -1 0 | while read i; do
_pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file1 >> $seqres.full
done
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/167 b/tests/generic/167
index b2d6c87..261506b 100755
--- a/tests/generic/167
+++ b/tests/generic/167
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file
wait
}
@@ -53,6 +53,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
mkdir $testdir
loops=1024
@@ -67,7 +69,7 @@ _scratch_cycle_mount
# Snapshot creator...
snappy() {
n=0
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)"
res=$?
echo "$out" | grep -q "No space left" && break
@@ -82,7 +84,7 @@ snappy &
seq $nr_loops -1 0 | while read i; do
_pwrite_byte 0x63 $((i * blksz)) $blksz $testdir/file1 >> $seqres.full
done
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/168 b/tests/generic/168
index 7047d10..ceee264 100755
--- a/tests/generic/168
+++ b/tests/generic/168
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file
wait
}
@@ -52,6 +52,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
mkdir $testdir
loops=1024
@@ -66,7 +68,7 @@ _scratch_cycle_mount
# Direct I/O overwriter...
overwrite() {
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
seq $nr_loops -1 0 | while read i; do
_pwrite_byte 0x63 $((i * blksz)) $blksz $testdir/file2 >> $seqres.full
done
@@ -82,7 +84,7 @@ seq 1 10 | while read j; do
[ $? -ne 0 ] && exit
done
done
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/170 b/tests/generic/170
index 4861052..6559243 100755
--- a/tests/generic/170
+++ b/tests/generic/170
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file
wait
}
@@ -53,6 +53,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
mkdir $testdir
loops=1024
@@ -67,7 +69,7 @@ _scratch_cycle_mount
# Direct I/O overwriter...
overwrite() {
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
seq $nr_loops -1 0 | while read i; do
_pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file2 >> $seqres.full
done
@@ -83,7 +85,7 @@ seq 1 10 | while read j; do
[ $? -ne 0 ] && exit
done
done
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/333 b/tests/generic/333
index 8db86e3..3d874d7 100755
--- a/tests/generic/333
+++ b/tests/generic/333
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file $abort_file
wait
}
@@ -54,6 +54,10 @@ _scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
+abort_file=/tmp/abort
+rm -rf $abort_file
mkdir $testdir
loops=1024
@@ -68,7 +72,7 @@ _scratch_cycle_mount
# Snapshot creator...
snappy() {
n=0
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)"
res=$?
echo $out | grep -q "No space left" && break
@@ -76,7 +80,7 @@ snappy() {
test $res -ne 0 && break
n=$((n + 1))
done
- touch $testdir/abort
+ touch $abort_file
}
echo "Snapshot a file undergoing directio rewrite"
@@ -85,13 +89,13 @@ seq 1 1000 | while read j; do
seq $nr_loops -1 0 | while read i; do
out="$(_pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file1 2>&1)"
echo $out >> $seqres.full
- echo $out | grep -q "No space left" && touch $testdir/abort
- echo $out | grep -qi "error" && touch $testdir/abort
- test -e $testdir/abort && break
+ echo $out | grep -q "No space left" && touch $abort_file
+ echo $out | grep -qi "error" && touch $abort_file
+ test -e $abort_file && break
done
- test -e $testdir/abort && break
+ test -e $abort_file && break
done
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
diff --git a/tests/generic/334 b/tests/generic/334
index 5714125..fb21d4f 100755
--- a/tests/generic/334
+++ b/tests/generic/334
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
- rm -rf $tmp.*
+ rm -rf $tmp.* $finished_file $abort_file
wait
}
@@ -53,6 +53,10 @@ _scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
+finished_file=/tmp/finished
+rm -rf $finished_file
+abort_file=/tmp/abort
+rm -rf $abort_file
mkdir $testdir
loops=1024
@@ -67,7 +71,7 @@ _scratch_cycle_mount
# Snapshot creator...
snappy() {
n=0
- while [ ! -e $testdir/finished ]; do
+ while [ ! -e $finished_file ]; do
out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)"
res=$?
echo $out | grep -q "No space left" && break
@@ -75,7 +79,7 @@ snappy() {
test $res -ne 0 && break
n=$((n + 1))
done
- touch $testdir/abort
+ touch $abort_file
}
echo "Snapshot a file undergoing buffered rewrite"
@@ -84,13 +88,13 @@ seq 1 1000 | while read j; do
seq $nr_loops -1 0 | while read i; do
out="$(_pwrite_byte 0x63 $((i * blksz)) $blksz $testdir/file1 2>&1)"
echo $out >> $seqres.full
- echo $out | grep -q "No space left" && touch $testdir/abort
- echo $out | grep -qi "error" && touch $testdir/abort
- test -e $testdir/abort && break
+ echo $out | grep -q "No space left" && touch $abort_file
+ echo $out | grep -qi "error" && touch $abort_file
+ test -e $abort_file && break
done
- test -e $testdir/abort && break
+ test -e $abort_file && break
done
-touch $testdir/finished
+touch $finished_file
wait
# success, all done
next prev parent reply other threads:[~2016-05-27 3:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 5:57 [PATCH 0/7] xfstests: minor fixes for the reflink/dedupe tests Darrick J. Wong
2016-05-26 5:57 ` [PATCH 1/7] xfs/104: don't enospc when ag metadata overhead grows Darrick J. Wong
2016-05-26 8:08 ` Christoph Hellwig
2016-05-26 5:57 ` [PATCH 2/7] tests: don't put loop control files on the scratch mount Darrick J. Wong
2016-05-26 8:09 ` Christoph Hellwig
2016-05-26 16:07 ` Darrick J. Wong
2016-05-27 3:28 ` Darrick J. Wong [this message]
2016-05-31 12:52 ` [PATCH v2 " Christoph Hellwig
2016-05-26 5:57 ` [PATCH 3/7] xfs: test copy-on-write leftover recovery Darrick J. Wong
2016-05-26 8:22 ` Christoph Hellwig
2016-05-26 5:57 ` [PATCH 4/7] xfs: test per-ag allocation accounting during truncate-caused refcountbt expansion Darrick J. Wong
2016-05-26 8:23 ` Christoph Hellwig
2016-05-26 5:57 ` [PATCH 5/7] reflink: test interaction with swap files Darrick J. Wong
2016-05-26 8:24 ` Christoph Hellwig
2016-05-26 5:57 ` [PATCH 6/7] xfs: test rmap behavior when multiple bmbt records map to a single rmapbt record Darrick J. Wong
2016-05-26 8:04 ` Christoph Hellwig
2016-05-26 16:12 ` Darrick J. Wong
2016-05-27 3:28 ` [PATCH v2 " Darrick J. Wong
2016-05-31 12:52 ` Christoph Hellwig
2016-05-26 5:57 ` [PATCH 7/7] reflink: test changing sharers of a block while keeping refcount the same Darrick J. Wong
2016-05-26 8:24 ` Christoph Hellwig
2016-05-27 18:02 ` [PATCH 8/7] xfs/122: don't break on old xfsprogs Darrick J. Wong
2016-05-31 12:51 ` Christoph Hellwig
2016-05-31 16:41 ` Darrick J. Wong
2016-05-31 16:43 ` [PATCH v2 " Darrick J. Wong
2016-05-31 19:33 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160527032804.GA9418@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=hch@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).