From: bobijam Date: Thu, 2 Jul 2009 01:12:04 +0000 (+0000) Subject: Branch b1_8 X-Git-Tag: v1_8_2_01~1^2~276 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=fd33167462442f60f4c8cc95a772b5a7f4f29373;p=fs%2Flustre-release.git Branch b1_8 b=18478 i=yibin.wang Improve sanity test_180. --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 8ac690f..600704d 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -5910,21 +5910,27 @@ run_test 170 "test lctl df to handle corrupted log =====================" obdecho_create_test() { local OBD=$1 - $LCTL attach echo_client ec ec_uuid || return 1 - $LCTL --device ec setup $OBD || return 2 - $LCTL --device ec create 1 || return 3 - $LCTL --device ec cleanup || return 4 - $LCTL --device ec detach || return 5 + local rc=0 + $LCTL attach echo_client ec ec_uuid || rc=1 + [ $rc -eq 0 ] && { $LCTL --device ec setup $OBD || rc=2; } + [ $rc -eq 0 ] && { $LCTL --device ec create 1 || rc=3; } + [ $rc -eq 0 -o $rc -gt 2 ] && { $LCTL --device ec cleanup || rc=4; } + [ $rc -eq 0 -o $rc -gt 1 ] && { $LCTL --device ec detach || rc=5; } + return $rc } test_180() { - load_module obdecho/obdecho + load_module obdecho/obdecho || return 1 + local rc=0 local OBD=`$LCTL dl | awk ' /obdfilter/ { print $4; exit; }'` - [ "x$OBD" != "x" ] && obdecho_create_test $OBD + [ "x$OBD" != "x" ] && { obdecho_create_test $OBD || rc=2; } + [[ $rc -ne 0 ]] && { rmmod obdecho; return $rc; } OBD=`$LCTL dl | awk ' /-osc-/ { print $4; exit; }'` - [ "x$OBD" != "x" ] && obdecho_create_test $OBD + [ "x$OBD" != "x" ] && { obdecho_create_test $OBD || rc=3; } + [[ $rc -ne 0 ]] && { rmmod obdecho; return $rc; } + rmmod obdecho } run_test 180 "test obdecho ============================================"