Whamcloud - gitweb
LU-5474 tests: sanity-hsm test_90 use local HSM_ARCHIVE 63/12963/3
authorJames Nunez <james.a.nunez@intel.com>
Fri, 5 Dec 2014 20:28:01 +0000 (12:28 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 27 Jan 2015 02:41:41 +0000 (02:41 +0000)
sanity-hsm test 90 suffers from frequent failures due to
slow archive speeds. If the existing archive is not
local, test 90 now uses a local disk archive to speed
the archive process.

sanity-hsm test 40 was modified to query the SINGLEAGT
node to check if the archive is a local disk for
HSM_ARCHIVE.

copytool_cleanup was modified to match copytool_setup;
remove the contents of $hsm_root and not $hsm_root itself.

This patch is back-ported from the following one:
Lustre-commit: 8641822bdb248a034bf4065c7e2e60cdb7a47041
Lustre-change: http://review.whamcloud.com/12069

Signed-off-by: James Nunez <james.a.nunez@intel.com>
Change-Id: I3aeaedf21d4b6a1316a9510f8e6f3d19662ccdec
Reviewed-on: http://review.whamcloud.com/12963
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-hsm.sh

index 3c8b73d..0634d95 100755 (executable)
@@ -309,7 +309,9 @@ copytool_cleanup() {
                        "$oldstate" 20 ||
                        error "mds${mdtno} cdt state is not $oldstate"
        done
-       do_facet $facet "rm -rf $hsm_root"
+       if do_facet $facet "df $hsm_root" >/dev/null 2>&1 ; then
+               do_facet $facet "rm -rf $hsm_root/*"
+       fi
 }
 
 copytool_suspend() {
@@ -2433,7 +2435,7 @@ test_40() {
        done
        # force copytool to use a local/temp archive dir to ensure best
        # performance vs remote/NFS mounts used in auto-tests
-       if df --local $HSM_ARCHIVE >/dev/null 2>&1 ; then
+       if do_facet $SINGLEAGT "df --local $HSM_ARCHIVE" >/dev/null 2>&1 ; then
                copytool_setup
        else
                copytool_setup $SINGLEAGT $MOUNT $HSM_ARCHIVE_NUMBER $TMP/$tdir
@@ -2975,7 +2977,14 @@ test_90() {
                fid=$(copy_file /etc/hosts $f.$i)
                echo $f.$i >> $FILELIST
        done
-       copytool_setup
+       # force copytool to use a local/temp archive dir to ensure best
+       # performance vs remote/NFS mounts used in auto-tests
+       if do_facet $SINGLEAGT "df --local $HSM_ARCHIVE" >/dev/null 2>&1 ; then
+               copytool_setup
+       else
+               local dai=$(get_hsm_param default_archive_id)
+               copytool_setup $SINGLEAGT $MOUNT $dai $TMP/$tdir
+       fi
        # to be sure wait_all_done will not be mislead by previous tests
        cdt_purge
        wait_for_grace_delay