Whamcloud - gitweb
LU-3700 tests: Strengthen and clarify sanity-hsm/test_21 67/8467/3
authorBruno Faccini <bruno.faccini@intel.com>
Tue, 3 Dec 2013 14:45:00 +0000 (15:45 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 7 Dec 2013 14:19:47 +0000 (14:19 +0000)
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 <bruno.faccini@intel.com>
Change-Id: I7546d95c7e90aa9dd213870f3af9d2e9e33c7632
Reviewed-on: http://review.whamcloud.com/8467
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/tests/sanity-hsm.sh

index ae96f81..cd0b98a 100644 (file)
@@ -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"