Whamcloud - gitweb
LU-2849 hsm: don't run sanity-hsm for ver < 2.3.61
authorJohann Lombardi <johann.lombardi@intel.com>
Thu, 21 Feb 2013 15:17:43 +0000 (16:17 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 20 Mar 2013 21:25:44 +0000 (17:25 -0400)
Add version check in sanity-hsm.
Now that sanity-hsm has been added, we should consider running it by
default.

Test-Parameters: testlist=sanity-hsm

Signed-off-by: Johann Lombardi <johann.lombardi@intel.com>
Change-Id: I8cec304bed46ac24354a27716ad12f5233c75a3f
Reviewed-on: http://review.whamcloud.com/5502
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
lustre/tests/sanity-hsm.sh

index a0914b8..7e852fe 100644 (file)
@@ -31,19 +31,21 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
-
 SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
 FAIL_ON_ERROR=false
 
 [ "$SANITYLOG" ] && rm -f $SANITYLOG || true
 check_and_setup_lustre
 
 SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
 FAIL_ON_ERROR=false
 
 [ "$SANITYLOG" ] && rm -f $SANITYLOG || true
 check_and_setup_lustre
 
+if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.61) ]; then
+       skip_env "Need MDS version at least 2.3.61" && exit
+fi
+
 DIR=${DIR:-$MOUNT}
 assert_DIR
 
 build_test_filter
 
 DIR=${DIR:-$MOUNT}
 assert_DIR
 
 build_test_filter
 
-
 test_1() {
        mkdir -p $DIR/$tdir
        chmod 777 $DIR/$tdir
 test_1() {
        mkdir -p $DIR/$tdir
        chmod 777 $DIR/$tdir
@@ -78,7 +80,6 @@ test_1() {
            error "root could not clear hsm state"
        $LFS hsm_state $TESTFILE | grep -q "(0x00000000)" ||
            error "wrong hsm state, should be empty"
            error "root could not clear hsm state"
        $LFS hsm_state $TESTFILE | grep -q "(0x00000000)" ||
            error "wrong hsm state, should be empty"
-
 }
 run_test 1 "lfs hsm flags root/non-root access"
 
 }
 run_test 1 "lfs hsm flags root/non-root access"
 
@@ -179,7 +180,6 @@ test_3() {
 }
 run_test 3 "Check file dirtyness when opening for write"
 
 }
 run_test 3 "Check file dirtyness when opening for write"
 
-
 log "cleanup: ======================================================"
 cd $ORIG_PWD
 check_and_cleanup_lustre
 log "cleanup: ======================================================"
 cd $ORIG_PWD
 check_and_cleanup_lustre
@@ -187,4 +187,3 @@ echo '=========================== finished ==============================='
 [ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 ||
        true
 echo "$0: completed"
 [ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 ||
        true
 echo "$0: completed"
-