xfs: add a _require_xfs_copy helper

Add a _require helper so that tests can ensure that they're running in
the correct environment for xfs_copy to work (no external devices).

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Darrick J. Wong
2020-09-14 18:43:59 -07:00
committed by Eryu Guan
parent ff334a75e2
commit a98a9c291a
6 changed files with 12 additions and 11 deletions
+7
View File
@@ -945,3 +945,10 @@ _try_wipe_scratch_xfs()
fi
rm -f $tmp.mkfs
}
_require_xfs_copy()
{
[ -n "$XFS_COPY_PROG" ] || _notrun "xfs_copy binary not yet installed"
[ "$USE_EXTERNAL" = yes ] && \
_notrun "Cannot xfs_copy with external devices"
}