Whamcloud - gitweb
LU-9477 tests: check correct handling of dead object 18/27018/3
authorBruno Faccini <bruno.faccini@intel.com>
Fri, 24 Jul 2015 16:16:36 +0000 (18:16 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 16 May 2017 05:48:46 +0000 (05:48 +0000)
Since original fix to allow for correct handling of dead/removed
object has been finally implemented LU-9312
This patch now only introduces related tests of correct handling
in sanity-hsm test suite.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I1e3ce88909e8820657ee5753fea5d6757c354574
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/27018
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-hsm.sh

index c1d7490..a1cdb1b 100755 (executable)
@@ -3333,6 +3333,23 @@ test_60() {
 }
 run_test 60 "Changing progress update interval from default"
 
+test_61() {
+       # test needs a running copytool
+       copytool_setup
+
+       mkdir -p $DIR/$tdir
+       local f=$DIR/$tdir/$tfile
+       local fid=$(copy_file /etc/passwd $f)
+       cdt_disable
+       $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
+       rm -f $f
+       cdt_enable
+       wait_request_state $fid ARCHIVE FAILED
+
+       copytool_cleanup
+}
+run_test 61 "Waiting archive of a removed file should fail"
+
 test_70() {
        # test needs a new running copytool
        copytool_cleanup
@@ -4574,6 +4591,43 @@ test_251() {
 }
 run_test 251 "Coordinator request timeout"
 
+test_252() {
+       # test needs a running copytool
+       copytool_setup
+
+       mkdir -p $DIR/$tdir
+       local f=$DIR/$tdir/$tfile
+       local fid=$(make_custom_file_for_progress $f 103 1048576)
+
+       cdt_disable
+       # to have a short test
+       local old_to=$(get_hsm_param active_request_timeout)
+       set_hsm_param active_request_timeout 20
+       # to be sure the cdt will wake up frequently so
+       # it will be able to cancel the "old" request
+       local old_loop=$(get_hsm_param loop_period)
+       set_hsm_param loop_period 2
+       cdt_enable
+
+       # clear locks to avoid extra delay caused by flush/cancel
+       # and thus prevent early copytool death to timeout.
+       cancel_lru_locks osc
+
+       $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
+       wait_request_state $fid ARCHIVE STARTED
+       rm -f $f
+
+       # wait but less than active_request_timeout+grace_delay
+       sleep 25
+       wait_request_state $fid ARCHIVE CANCELED
+
+       set_hsm_param active_request_timeout $old_to
+       set_hsm_param loop_period $old_loop
+
+       copytool_cleanup
+}
+run_test 252 "Timeout'ed running archive of a removed file should be canceled"
+
 test_300() {
        # the only way to test ondisk conf is to restart MDS ...
        echo "Stop coordinator and remove coordinator state at mount"