From 2ef0f3abe5abe609979b9c6dd58945400b2cdecc Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Fri, 24 Jul 2015 18:16:36 +0200 Subject: [PATCH] LU-9477 tests: check correct handling of dead object 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 Signed-off-by: Bob Glossman Change-Id: I1e3ce88909e8820657ee5753fea5d6757c354574 Reviewed-by: Jinshan Xiong Reviewed-by: John L. Hammond Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/27018 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/sanity-hsm.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index c1d7490..a1cdb1b 100755 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -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" -- 1.8.3.1