From 9ad76c8375e4127caf12ed29f0602ff26d36d708 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 4 Apr 2017 15:09:14 +0300 Subject: [PATCH] LU-9288 tests: t-f to check if ZFS module is loaded it's possible that ZFS modules are missing in /lib/modules/ in a development environment. if so, then modprobe fails preventing regular testing. t-f can check whether ZFS module is loaded already. Change-Id: Ie871be7a9af3c15968de8b5d8a8c99b3e1cb4274 Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/26334 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Nathaniel Clark Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- lustre/tests/test-framework.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index dab9279..0143715 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -611,7 +611,7 @@ load_modules_local() { [ "$LQUOTA" != "no" ] && load_module quota/lquota $LQUOTAOPTS if [[ $(node_fstypes $HOSTNAME) == *zfs* ]]; then - modprobe zfs + lsmod | grep zfs >&/dev/null || modprobe zfs load_module osd-zfs/osd_zfs fi if [[ $(node_fstypes $HOSTNAME) == *ldiskfs* ]]; then @@ -1092,7 +1092,7 @@ create_zpool() { shift 3 local opts=${@:-"-o cachefile=none"} - do_facet $facet "modprobe zfs; + do_facet $facet "lsmod | grep zfs >&/dev/null || modprobe zfs; $ZPOOL list -H $poolname >/dev/null 2>&1 || $ZPOOL create -f $opts $poolname $vdev" } @@ -1159,7 +1159,7 @@ import_zpool() { if [[ -n "$poolname" ]]; then opts+=" -d $(dirname $(facet_vdevice $facet))" - do_facet $facet "modprobe zfs; + do_facet $facet "lsmod | grep zfs >&/dev/null || modprobe zfs; $ZPOOL list -H $poolname >/dev/null 2>&1 || $ZPOOL import -f $opts $poolname" fi -- 1.8.3.1