From: Andreas Dilger Date: Tue, 15 Dec 2015 09:44:45 +0000 (-0700) Subject: LU-7555 tests: add load_module to mount_facet X-Git-Tag: 2.7.65~50 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=87b0e9a2af342d661348fb4d4394b53dd0d94380 LU-7555 tests: add load_module to mount_facet Since commit 2a223541d299bc8 there has not been automated loading of lustre modules in the log() command, since this command only needs libcfs loaded to use the "lctl mark" functionality. When testing from a local build tree, conf-sanity.sh was failing because it unloads the modules during cleanup and is not able to automatically load the modules on demand if they are not installed, and does not always manually load the modules for each running test. Add a call to load_modules() in mount_facet() where the modules are actually needed for the filesystem to mount. Signed-off-by: Andreas Dilger Change-Id: Ie7655c04a7bf42ec9969cb5c11fab3ac92f3dc0b Reviewed-on: http://review.whamcloud.com/17603 Reviewed-by: Jian Yu Tested-by: Jenkins Reviewed-by: wangdi Tested-by: Maloo Reviewed-by: Wei Liu Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 08f468b..60f80d9 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -2828,7 +2828,6 @@ test_41a() { #bug 14134 stop ost1 -f || error "unable to stop OST1" stop_mds || error "Unable to stop MDS" stop_mds || error "Unable to stop MDS on second try" - unload_modules_conf || error "unload_modules_conf failed" } run_test 41a "mount mds with --nosvc and --nomgs" @@ -2980,7 +2979,6 @@ test_42() { #bug 14693 do_facet mgs $LCTL conf_param $FSNAME.sys.some_wrong_param=20 cleanup || error "stopping $FSNAME failed with invalid sys param" - load_modules setup check_mount || error "client was not mounted with invalid sys param" cleanup || error "stopping $FSNAME failed with invalid sys param" @@ -3660,7 +3658,6 @@ test_50i() { [ "$MDSCOUNT" -lt "2" ] && skip_env "$MDSCOUNT < 2, skipping" && return [ $(facet_fstype ost1) == zfs ] && import_zpool ost1 - load_modules do_facet mds2 "$TUNEFS --param mdc.active=0 $(mdsdevname 2)" || error "tunefs MDT2 failed" start_mds || error "Unable to start MDT" @@ -3959,7 +3956,6 @@ thread_sanity() { local newvalue="${opts}=$(expr $basethr \* $ncpts)" setmodopts -a $modname "$newvalue" oldvalue - load_modules setup check_mount || return 41 @@ -3975,7 +3971,6 @@ thread_sanity() { return $? cleanup - load_modules setup } @@ -4956,7 +4951,6 @@ test_72() { #LU-2634 run_test 72 "test fast symlink with extents flag enabled" test_73() { #LU-3006 - load_modules [ $(facet_fstype ost1) == zfs ] && import_zpool ost1 do_facet ost1 "$TUNEFS --failnode=1.2.3.4@$NETTYPE $(ostdevname 1)" || error "1st tunefs failed" @@ -5706,7 +5700,6 @@ test_84() { local correct_clients local wrap_up=5 - load_modules echo "start mds service on $(facet_active_host $facet)" start_mds \ "-o recovery_time_hard=$time_min,recovery_time_soft=$time_min" $@ || @@ -6217,8 +6210,6 @@ test_91() { local nid local found - load_modules - [[ $(lustre_version_code ost1) -ge $(version_code 2.7.63) ]] || { skip "Need OST version at least 2.7.63" && return 0; } [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.63) ]] || diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index baaaae9..47f65ea 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1224,6 +1224,8 @@ mount_facet() { local mntpt=$(facet_mntpt $facet) local opts="${!opt} $@" + module_loaded lustre || load_modules + if [ $(facet_fstype $facet) == ldiskfs ] && ! do_facet $facet test -b ${!dev}; then opts=$(csa_add "$opts" -o loop) @@ -1287,19 +1289,19 @@ mount_facet() { # start facet device options start() { - local facet=$1 - shift - local device=$1 - shift - eval export ${facet}_dev=${device} - eval export ${facet}_opt=\"$@\" + local facet=$1 + shift + local device=$1 + shift + eval export ${facet}_dev=${device} + eval export ${facet}_opt=\"$@\" - local varname=${facet}failover_dev - if [ -n "${!varname}" ] ; then - eval export ${facet}failover_dev=${!varname} - else - eval export ${facet}failover_dev=$device - fi + local varname=${facet}failover_dev + if [ -n "${!varname}" ] ; then + eval export ${facet}failover_dev=${!varname} + else + eval export ${facet}failover_dev=$device + fi local mntpt=$(facet_mntpt $facet) do_facet ${facet} mkdir -p $mntpt