[PATCH blktests 8/9] nvme: don't require the nvme drivers to be built in

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use _have_driver instead of _have_modules to check for the availability
of the nvme drivers, and don't bother checking at all for drivers that
are pulled in as dependencies.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 tests/nvme/rc | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/tests/nvme/rc b/tests/nvme/rc
index ccdccf9..998b181 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -16,21 +16,23 @@ _nvme_requires() {
 	_have_program nvme
 	case ${nvme_trtype} in
 	loop)
-		_have_modules nvmet nvme-core nvme-loop
+		_have_driver nvme-loop
 		_have_configfs
 		;;
 	pci)
-		_have_modules nvme nvme-core
+		_have_driver nvme
 		;;
 	tcp)
-		_have_modules nvmet nvme-core nvme-tcp nvmet-tcp
+		_have_driver nvme-tcp
+		_have_driver nvmet-tcp
 		_have_configfs
 		;;
 	rdma)
-		_have_modules nvmet nvme-core nvme-rdma nvmet-rdma
+		_have_driver nvme-rdma
+		_have_driver nvmet-rdma
 		_have_configfs
 		_have_program rdma
-		_have_modules rdma_rxe || _have_modules siw
+		_have_driver rdma_rxe || _have_driver siw
 		;;
 	*)
 		SKIP_REASON="unsupported nvme_trtype=${nvme_trtype}"
@@ -125,11 +127,11 @@ _cleanup_nvmet() {
 	shopt -u nullglob
 	trap SIGINT
 
-	modprobe -r nvme-"${nvme_trtype}" 2>/dev/null
+	modprobe -rq nvme-"${nvme_trtype}" 2>/dev/null
 	if [[ "${nvme_trtype}" != "loop" ]]; then
-		modprobe -r nvmet-"${nvme_trtype}" 2>/dev/null
+		modprobe -rq nvmet-"${nvme_trtype}" 2>/dev/null
 	fi
-	modprobe -r nvmet 2>/dev/null
+	modprobe -rq nvmet 2>/dev/null
 	if [[ "${nvme_trtype}" == "rdma" ]]; then
 		stop_soft_rdma
 	fi
@@ -137,11 +139,11 @@ _cleanup_nvmet() {
 
 _setup_nvmet() {
 	_register_test_cleanup _cleanup_nvmet
-	modprobe nvmet
+	modprobe -q nvmet
 	if [[ "${nvme_trtype}" != "loop" ]]; then
-		modprobe nvmet-"${nvme_trtype}"
+		modprobe -q nvmet-"${nvme_trtype}"
 	fi
-	modprobe nvme-"${nvme_trtype}"
+	modprobe -q nvme-"${nvme_trtype}"
 	if [[ "${nvme_trtype}" == "rdma" ]]; then
 		start_soft_rdma
 		for i in $(rdma_network_interfaces)
-- 
2.30.2




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux