Whamcloud - gitweb
LU-3976 tests: sanity-hsm test_9a is buggy 23/7723/2
authorjcl <jacques-charles.lafoucriere@cea.fr>
Sun, 22 Sep 2013 21:58:43 +0000 (23:58 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 24 Sep 2013 17:15:33 +0000 (17:15 +0000)
After a file is successfully archived, it's HSM status is
EXIST and ARCHIVED so 0x00000009
Also add a generic function to test the minimum count of clients
needed by a test

Test-Parameters: clientcount=4
Signed-off-by: JC Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Change-Id: I878e994d1a903646adc1c55e706ea9118196c0a1
Reviewed-on: http://review.whamcloud.com/7723
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/tests/sanity-hsm.sh

index 527d3f0..7aa54d5 100644 (file)
@@ -306,9 +306,10 @@ cdt_restart() {
        cdt_set_sanity_policy
 }
 
-need2clients() {
-       if [[ $CLIENTCOUNT -lt 2 ]]; then
-               skip "Need two or more clients, have $CLIENTCOUNT"
+needclients() {
+       local clnt_count=$1
+       if [[ $CLIENTCOUNT -lt $clnt_count ]]; then
+               skip "Need $clnt_count or more clients, have $CLIENTCOUNT"
                return 1
        fi
        return 0
@@ -677,8 +678,7 @@ test_9() {
 run_test 9 "Use of explict archive number, with dedicated copytool"
 
 test_9a() {
-       [[ $CLIENTCOUNT -ge 3 ]] ||
-               { skip "Need three or more clients"; return 0; }
+       needclients 3 || return 0
 
        local n
        local file
@@ -700,7 +700,7 @@ test_9a() {
 
                $LFS hsm_archive $file || error "could not archive file $file"
                wait_request_state $fid ARCHIVE SUCCEED
-               check_hsm_flags $file "0x00000001"
+               check_hsm_flags $file "0x00000009"
        done
 
        trap - EXIT
@@ -985,7 +985,7 @@ test_12g() {
 run_test 12g "Restore a released file implicitly"
 
 test_12h() {
-       need2clients || return 0
+       needclients 2 || return 0
 
        # test needs a running copytool
        copytool_setup
@@ -1619,7 +1619,7 @@ run_test 28 "Concurrent archive/file remove"
 test_30a() {
        # restore at exec cannot work on agent node (because of Linux kernel
        # protection of executables)
-       need2clients || return 0
+       needclients 2 || return 0
 
        # test needs a running copytool
        copytool_setup
@@ -1650,7 +1650,7 @@ run_test 30a "Restore at exec (import case)"
 test_30b() {
        # restore at exec cannot work on agent node (because of Linux kernel
        # protection of executables)
-       need2clients || return 0
+       needclients 2 || return 0
 
        # test needs a running copytool
        copytool_setup
@@ -2098,7 +2098,7 @@ run_test 56 "Setattr during an archive is ok"
 
 test_57() {
        # Need one client for I/O, one for request
-       need2clients || return 0
+       needclients 2 || return 0
 
        # test needs a running copytool
        copytool_setup