From 86da66cc4f083e3006d0f4679bd9ef24d93e6b7a Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Tue, 27 May 2014 12:07:36 +1000 Subject: [PATCH] common: add helper require function _require_btrfs_cloner So that the same check (btrfs cloner program presence) can be reused by other tests. Signed-off-by: Filipe David Borba Manana Reviewed-by: David Disseldorp Signed-off-by: Dave Chinner --- common/rc | 7 +++++++ tests/btrfs/035 | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common/rc b/common/rc index d1788d1f..f27ee533 100644 --- a/common/rc +++ b/common/rc @@ -2085,6 +2085,13 @@ _require_fssum() [ -x $FSSUM_PROG ] || _notrun "fssum not built" } +_require_btrfs_cloner() +{ + CLONER_PROG=$here/src/cloner + [ -x $CLONER_PROG ] || \ + _notrun "cloner binary not present at $CLONER_PROG" +} + # Given 2 files, verify that they have the same mapping but different # inodes - i.e. an undisturbed reflink # Silent if so, make noise if not diff --git a/tests/btrfs/035 b/tests/btrfs/035 index 6808179a..dd303af4 100755 --- a/tests/btrfs/035 +++ b/tests/btrfs/035 @@ -45,13 +45,11 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs btrfs _supported_os Linux _require_scratch +_require_btrfs_cloner _scratch_mkfs > /dev/null 2>&1 _scratch_mount -CLONER_PROG=$here/src/cloner -[ -x $CLONER_PROG ] || _notrun "cloner binary not present at $CLONER_PROG" - src_str="aaaaaaaaaa" echo -n "$src_str" > $SCRATCH_MNT/src -- 2.39.5