From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: david@fromorbit.com, darrick.wong@oracle.com
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, xfs@oss.sgi.com
Subject: [PATCH 07/32] common: create _require_test_program to look for programs in src/
Date: Thu, 11 Feb 2016 15:40:02 -0800 [thread overview]
Message-ID: <20160211234002.2202.899.stgit@birch.djwong.org> (raw)
In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org>
Create a helper that looks for a test program in src/ and fails the
test if it doesn't exist. Refactor the existing testcases to use it.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
common/rc | 9 +++++++++
tests/generic/010 | 2 +-
tests/generic/094 | 2 +-
tests/generic/225 | 2 +-
tests/generic/285 | 2 +-
tests/generic/286 | 2 +-
tests/generic/311 | 2 +-
tests/xfs/032 | 3 +--
tests/xfs/044 | 2 +-
9 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/common/rc b/common/rc
index 84f794a..63eb90b 100644
--- a/common/rc
+++ b/common/rc
@@ -1684,6 +1684,15 @@ _require_aiodio()
_require_odirect
}
+# this test requires that a test program exists under src/
+# $1 - command (require)
+#
+_require_test_program()
+{
+ SRC_TEST=src/$1
+ [ -x $SRC_TEST ] || _notrun "$SRC_TEST not built"
+}
+
# run an aio-dio program
# $1 - command
_run_aiodio()
diff --git a/tests/generic/010 b/tests/generic/010
index ea8ea50..1c9d8f7 100755
--- a/tests/generic/010
+++ b/tests/generic/010
@@ -51,7 +51,7 @@ _filter_dbtest()
. ./common/rc
. ./common/filter
-[ -x $here/src/dbtest ] || _notrun "dbtest was not built for this platform"
+_require_test_program "dbtest"
# real QA test starts here
_supported_fs generic
diff --git a/tests/generic/094 b/tests/generic/094
index 4e4b668..a51738a 100644
--- a/tests/generic/094
+++ b/tests/generic/094
@@ -53,7 +53,7 @@ _scratch_mount > /dev/null 2>&1
rm -f $seqres.full
fiemapfile=$SCRATCH_MNT/$seq.fiemap
-[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built"
+_require_test_program "fiemap-tester"
seed=`date +%s`
diff --git a/tests/generic/225 b/tests/generic/225
index 6134c8c..c8e0f64 100755
--- a/tests/generic/225
+++ b/tests/generic/225
@@ -53,7 +53,7 @@ rm -f $seqres.full
fiemapfile=$SCRATCH_MNT/$seq.fiemap
fiemaplog=$SCRATCH_MNT/$seq.log
-[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built"
+_require_test_program "fiemap-tester"
seed=`date +%s`
diff --git a/tests/generic/285 b/tests/generic/285
index d6275b5..16e70b1 100755
--- a/tests/generic/285
+++ b/tests/generic/285
@@ -45,7 +45,7 @@ _require_seek_data_hole
BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile
-[ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built"
+_require_test_program "seek_sanity_test"
# Disable extent zeroing for ext4 as that change where holes are created
if [ "$FSTYP" = "ext4" ]; then
diff --git a/tests/generic/286 b/tests/generic/286
index f6bf356..f88f079 100755
--- a/tests/generic/286
+++ b/tests/generic/286
@@ -44,7 +44,7 @@ _require_seek_data_hole
src=$TEST_DIR/seek_copy_testfile
dest=$TEST_DIR/seek_copy_testfile.dest
-[ -x $here/src/seek_copy_test ] || _notrun "seek_copy_test not built"
+_require_test_program "seek_copy_test"
_cleanup()
{
diff --git a/tests/generic/311 b/tests/generic/311
index f552011..69bc1bf 100755
--- a/tests/generic/311
+++ b/tests/generic/311
@@ -62,7 +62,7 @@ _require_metadata_journaling $SCRATCH_DEV
# the test system supports fallocate() for allocation
_require_xfs_io_command "falloc"
-[ -x $here/src/fsync-tester ] || _notrun "fsync-tester not built"
+_require_test_program "fsync-tester"
rm -f $seqres.full
SEED=1
diff --git a/tests/xfs/032 b/tests/xfs/032
index 063f272..6216379 100755
--- a/tests/xfs/032
+++ b/tests/xfs/032
@@ -40,8 +40,7 @@ _supported_fs xfs
_supported_os IRIX Linux
_require_scratch
-
-[ $here/src/feature ] || _notrun "src/feature not built, skipping this test"
+_require_test_program "feature"
[ "$USE_EXTERNAL" = yes ] && _notrun "Cannot xfs_copy with external devices"
[ -n "$XFS_COPY_PROG" ] || _notrun "xfs_copy binary not yet installed"
diff --git a/tests/xfs/044 b/tests/xfs/044
index 2ffd74f..ea58c07 100755
--- a/tests/xfs/044
+++ b/tests/xfs/044
@@ -124,7 +124,7 @@ _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1
[ $lversion -ne 1 ] && \
_notrun "Cannot run this test yet using MKFS_OPTIONS specified"
-[ $here/src/loggen ] || _notrun "loggen not built, skipping test"
+_require_test_program "loggen"
_check_mount
_check_require_logdev
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-02-11 23:40 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 23:39 [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls Darrick J. Wong
2016-02-11 23:39 ` [PATCH 01/32] generic/182: this is a dedupe test, check for dedupe Darrick J. Wong
2016-02-11 23:39 ` [PATCH 02/32] xfstests: filter whitespace in 128 and 132 Darrick J. Wong
2016-02-11 23:39 ` [PATCH 03/32] xfstests: make _scratch_mkfs_blocksized usable Darrick J. Wong
2016-02-11 23:39 ` [PATCH 04/32] reflink: remove redundant filesystem checks from the end of the tests Darrick J. Wong
2016-02-11 23:39 ` [PATCH 05/32] reflink: remove unnecessary umounts from test code Darrick J. Wong
2016-02-11 23:39 ` [PATCH 06/32] common/dmerror: add some more dmerror routines Darrick J. Wong
2016-02-11 23:40 ` Darrick J. Wong [this message]
2016-02-11 23:40 ` [PATCH 08/32] common: provide a method to repair the scratch fs Darrick J. Wong
2016-02-11 23:40 ` [PATCH 09/32] reflink: refactor mixed block creation code Darrick J. Wong
2016-02-11 23:40 ` [PATCH 10/32] reflink: fix style problems in existing tests Darrick J. Wong
2016-02-11 23:40 ` [PATCH 11/32] reflink: add _require_odirect to the directio tests Darrick J. Wong
2016-02-11 23:40 ` [PATCH 12/32] dio: unwritten conversion bug tests Darrick J. Wong
2016-02-12 3:52 ` Dave Chinner
2016-02-12 15:22 ` Theodore Ts'o
2016-02-12 22:49 ` Dave Chinner
2016-02-12 17:40 ` Darrick J. Wong
2016-02-11 23:40 ` [PATCH 13/32] reflink: test intersecting CoW and falloc/fpunch/fzero/fcollapse/finsert/ftrunc Darrick J. Wong
2016-02-11 23:40 ` [PATCH 14/32] reflink: test CoW behavior with IO errors Darrick J. Wong
2016-02-11 23:40 ` [PATCH 15/32] reflink: test CoW operations against the source file Darrick J. Wong
2016-02-11 23:41 ` [PATCH 16/32] reflink: ensure that we can handle reflinking a lot of extents Darrick J. Wong
2016-02-11 23:41 ` [PATCH 17/32] xfs: more reflink tests Darrick J. Wong
2016-02-11 23:41 ` [PATCH 18/32] xfs/122: support refcount/rmap data structures Darrick J. Wong
2016-02-11 23:41 ` [PATCH 19/32] xfs: test fragmentation characteristics of copy-on-write Darrick J. Wong
2016-02-11 23:41 ` [PATCH 20/32] reflink: high offset reflink and dedupe tests Darrick J. Wong
2016-02-11 23:41 ` [PATCH 21/32] reflink: test xfs cow behavior when the filesystem crashes Darrick J. Wong
2016-02-11 23:41 ` [PATCH 22/32] reflink: test quota accounting Darrick J. Wong
2016-02-11 23:41 ` [PATCH 23/32] reflink: test CoW across a mixed range of block types with cowextsize set Darrick J. Wong
2016-02-11 23:42 ` [PATCH 24/32] xfs: test the automatic cowextsize extent garbage collector Darrick J. Wong
2016-02-11 23:42 ` [PATCH 25/32] xfs: test rmapbt functionality Darrick J. Wong
2016-02-11 23:42 ` [PATCH 26/32] reflink: test aio copy on write Darrick J. Wong
2016-02-11 23:42 ` [PATCH 27/32] xfs: aio cow tests Darrick J. Wong
2016-02-11 23:42 ` [PATCH 28/32] xfs: test xfs_getbmapx behavior with shared extents Darrick J. Wong
2016-02-11 23:42 ` [PATCH 29/32] reflink: test reflink+cow+enospc all at the same time Darrick J. Wong
2016-02-11 23:42 ` [PATCH 30/32] xfs: ensure that we don't crash when freeing the ag reservations on a ro mount Darrick J. Wong
2016-02-11 23:42 ` [PATCH 31/32] xfs: test source CoW across mixed block types with cowextsz set Darrick J. Wong
2016-02-11 23:42 ` [PATCH 32/32] reflink: kick the slow tests out of the 'quick' group Darrick J. Wong
2016-02-12 17:41 ` [PATCH 33/32] aiocp: fix the gcc warnings Darrick J. Wong
2016-02-13 1:26 ` [PATCH v4.2 00/32] xfstests: test the nfs/cifs/btrfs/xfs reflink/dedupe ioctls Dave Chinner
2016-02-13 4:38 ` Darrick J. Wong
2016-02-13 8:03 ` 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=20160211234002.2202.899.stgit@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=fstests@vger.kernel.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