From be0b82d025f63cbbee53489f22948e8079692177 Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Tue, 3 Dec 2013 15:45:00 +0100 Subject: [PATCH] LU-3700 tests: Strengthen and clarify sanity-hsm/test_21 This patch is intended to add full debug and clarify some of the controls in subtest test_21 of sanity-hsm. Signed-off-by: Bruno Faccini Change-Id: I7546d95c7e90aa9dd213870f3af9d2e9e33c7632 Reviewed-on: http://review.whamcloud.com/8467 Reviewed-by: Andreas Dilger Reviewed-by: Nathaniel Clark Tested-by: Jenkins Tested-by: Maloo --- lustre/tests/sanity-hsm.sh | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index ae96f81..cd0b98a 100644 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -1335,19 +1335,32 @@ test_21() { local fid=$(make_small $f) check_hsm_flags $f "0x00000000" + local orig_size=$(stat -c "%s" $f) + local orig_blocks=$(stat -c "%b" $f) + + start_full_debug_logging + $LFS hsm_archive $f || error "could not archive file" wait_request_state $fid ARCHIVE SUCCEED - [ $(stat -c "%b" $f) -ne "1" ] || error "wrong block number" - local sz=$(stat -c "%s" $f) - [ $sz -ne "0" ] || error "file size should not be zero" + local blocks=$(stat -c "%b" $f) + [ $blocks -eq $orig_blocks ] || + error "$f: wrong block number after archive: " \ + "$blocks != $orig_blocks" + local size=$(stat -c "%s" $f) + [ $size -eq $orig_size ] || + error "$f: wrong size after archive: $size != $orig_size" # Release and check states $LFS hsm_release $f || error "could not release file" check_hsm_flags $f "0x0000000d" - [ $(stat -c "%b" $f) -eq "1" ] || error "wrong block number" - [ $(stat -c "%s" $f) -eq $sz ] || error "wrong file size" + blocks=$(stat -c "%b" $f) + [ $blocks -gt 5 ] && + error "$f: too many blocks after release: $blocks > 5" + size=$(stat -c "%s" $f) + [ $size -ne $orig_size ] && + error "$f: wrong size after release: $size != $orig_size" # Check we can release an file without stripe info f=$f.nolov @@ -1365,6 +1378,8 @@ test_21() { $LFS hsm_release $f || fail "second release should succeed" check_hsm_flags $f "0x0000000d" + stop_full_debug_logging + copytool_cleanup } run_test 21 "Simple release tests" -- 1.8.3.1