Two nvme tests create and mount XFS filesystems and check for mkfs.xfs.
They should also check for XFS support in the kernel so create a common
helper for this.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
return 0
}
+_have_fs() {
+ modprobe "$1" >/dev/null 2>&1
+ if [[ ! -d "/sys/fs/$1" ]]; then
+ SKIP_REASON="kernel does not support filesystem $1"
+ return 1
+ fi
+}
+
_test_dev_is_rotational() {
[[ $(cat "${TEST_DEV_SYSFS}/queue/rotational") -ne 0 ]]
}
--- /dev/null
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2017 Omar Sandoval
+#
+# fio helper functions.
+
+. common/shellcheck
+
+_have_xfs() {
+ _have_fs xfs && _have_program mkfs.xfs
+}
# Test mkfs with data verification for block device backed ns.
. tests/nvme/rc
+. common/xfs
DESCRIPTION="run mkfs and data verification fio job on NVMeOF block device-backed ns"
TIMED=1
requires() {
_nvme_requires
- _have_program mkfs.xfs && _have_program fio && \
- _have_modules loop
+ _have_xfs
+ _have_program fio
+ _have_modules loop
_require_nvme_trtype_is_fabrics
}
# Test mkfs with data verification for file backed ns.
. tests/nvme/rc
+. common/xfs
DESCRIPTION="run mkfs and data verification fio job on NVMeOF file-backed ns"
TIMED=1
requires() {
_nvme_requires
- _have_program mkfs.xfs && _have_fio
+ _have_xfs
+ _have_fio
_require_nvme_trtype_is_fabrics
}