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>
-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"
run_test 9 "Use of explict archive number, with dedicated copytool"
test_9a() {
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
$LFS hsm_archive $file || error "could not archive file $file"
wait_request_state $fid ARCHIVE SUCCEED
$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"
run_test 12g "Restore a released file implicitly"
test_12h() {
run_test 12g "Restore a released file implicitly"
test_12h() {
- need2clients || return 0
+ needclients 2 || return 0
# test needs a running copytool
copytool_setup
# test needs a running copytool
copytool_setup
test_30a() {
# restore at exec cannot work on agent node (because of Linux kernel
# protection of executables)
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
# test needs a running copytool
copytool_setup
test_30b() {
# restore at exec cannot work on agent node (because of Linux kernel
# protection of executables)
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
# test needs a running copytool
copytool_setup
test_57() {
# Need one client for I/O, one for request
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
# test needs a running copytool
copytool_setup