X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Flnet-selftest.sh;h=ed8104d085423df56c23630c05b0cdc562dc9aab;hb=76ca884398cae59e455caf3ae2ab1609c5fb1eea;hp=a1c525d22e24f488a2afbaa904031cee5527ffe2;hpb=84030bf26c1763edf9ac17a8cd2765e9163294bf;p=fs%2Flustre-release.git diff --git a/lustre/tests/lnet-selftest.sh b/lustre/tests/lnet-selftest.sh index a1c525d..ed8104d 100755 --- a/lustre/tests/lnet-selftest.sh +++ b/lustre/tests/lnet-selftest.sh @@ -1,22 +1,27 @@ #!/bin/bash -# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*- -# vim:shiftwidth=4:softtabstop=4:tabstop=4: -LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} +LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh init_test_env $@ -. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} init_logging -# -ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT" +ALWAYS_EXCEPT="$LNET_SELFTEST_EXCEPT" +if [[ $(uname -m) = aarch64 ]]; then + # bug number for skipped test: LU-10073 + ALWAYS_EXCEPT+=" smoke" +fi -if [[ $MDSCOUNT -ge 2 ]]; then - #LU-4181 - skip "Only run with single MDT for now" && exit +# Check if running on Ubuntu client +if [ -r /etc/os-release ]; then + if grep -qi ubuntu /etc/os-release; then + # bug number for skipped test: LU-10073 + ALWAYS_EXCEPT+=" smoke" + fi fi -[ x$LST = x ] && { skip_env "lst not found LST=$LST" && exit 0; } +build_test_filter + +[ x$LST = x ] && skip_env "lst not found LST=$LST" # FIXME: what is the reasonable value here? lst_LOOP=${lst_LOOP:-100000} @@ -36,6 +41,25 @@ fi nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)") lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")} lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")} +interim_umount=false +interim_umount1=false + +# +# _restore_mount(): This function calls restore_mount function for "MOUNT" and +# "MOUNT2" paths to mount clients if they were not mounted and were umounted +# in this file earlier. +# Parameter: None +# Returns: None. Exit with error if client mount fails. +# +_restore_mount () { + if $interim_umount && ! is_mounted $MOUNT; then + restore_mount $MOUNT || error "Restore $MOUNT failed" + fi + + if $interim_umount1 && ! is_mounted $MOUNT2; then + restore_mount $MOUNT2 || error "Restore $MOUNT2 failed" + fi +} is_mounted () { local mntpt=$1 @@ -55,18 +79,15 @@ fi # 1) because lustre messages clutter logs - we needn't them for testing LNET # 2) it's theoretically possible that lst tests congest comm paths so tightly # that mounted lustre wouldn't able to perform some of its background activities -if is_mounted $MOUNT || is_mounted $MOUNT2; then - if local_mode; then - CLIENTONLY=yes - stopall - else - LOAD_MODULES_REMOTE=true - cleanupall - fi - RESTORE_MOUNT=yes +if is_mounted $MOUNT; then + cleanup_mount $MOUNT || error "Fail to unmount client $MOUNT" + interim_umount=true fi -build_test_filter +if is_mounted $MOUNT2; then + cleanup_mount $MOUNT2 || error "Fail to unmount client $MOUNT2" + interim_umount1=true +fi lst_prepare () { # Workaround for bug 15619 @@ -131,44 +152,44 @@ run_lst () { } check_lst_err () { - local log=$1 + local log=$1 - grep ^Total $log + grep ^Total $log - if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then - error 'lst Error found' - fi + if awk '/^Total.*nodes/ {print $2}' $log | grep -vq '^0$'; then + _restore_mount + error 'lst Error found' + fi } test_smoke () { - lst_prepare + lst_prepare - local servers=$lst_SERVERS - local clients=$lst_CLIENTS + local servers=$lst_SERVERS + local clients=$lst_CLIENTS - local runlst=$TMP/smoke.sh + local runlst=$TMP/smoke.sh - local log=$TMP/$tfile.log - local rc=0 + local log=$TMP/$tfile.log + local rc=0 - test_smoke_sub $servers $clients 2>&1 > $runlst + test_smoke_sub $servers $clients 2>&1 > $runlst - cat $runlst + cat $runlst - run_lst $runlst | tee $log - rc=${PIPESTATUS[0]} - [ $rc = 0 ] || error "$runlst failed: $rc" - - lst_end_session --verbose | tee -a $log + run_lst $runlst | tee $log + rc=${PIPESTATUS[0]} + [ $rc = 0 ] || { _restore_mount; error "$runlst failed: $rc"; } + + lst_end_session --verbose | tee -a $log - # error counters in "lst show_error" should be checked - check_lst_err $log - lst_cleanup_all + # error counters in "lst show_error" should be checked + check_lst_err $log + lst_cleanup_all } run_test smoke "lst regression test" complete $SECONDS -if [ "$RESTORE_MOUNT" = yes ]; then - setupall -fi +_restore_mount +check_and_cleanup_lustre exit_status