rm -f $file
- $LFS hsm_remove -a 0 $fid
+ $LFS hsm_remove --mntpath "$MOUNT" -a 0 $fid ||
+ error "cannot hsm_remove '$fid'"
# give time for CDT to handle remove request and create broadcasted
sleep 2
echo "$count archive requests submitted"
}
+cleanup_test_40() {
+ trap 0
+ set_hsm_param max_requests $max_requests
+ copytool_cleanup
+}
+
test_40() {
local stream_count=4
local file_count=100
local i=""
local p=""
local fid=""
+ local max_requests=$(get_hsm_param max_requests)
+
+ # Increase the number of HSM request that can be performed in
+ # parallel. With the coordinator running once per second, this
+ # also limits the number of requests per seconds that can be
+ # performed, so we pick a decent number. But we also need to keep
+ # that number low because the copytool has no rate limit and will
+ # fail some requests if if gets too many at once.
+ set_hsm_param max_requests 300
+
+ trap cleanup_test_40 EXIT
for i in $(seq 1 $file_count); do
for p in $(seq 1 $stream_count); do
wait ${pids[*]}
echo OK
wait_all_done 100
- copytool_cleanup
+
+ cleanup_test_40
}
run_test 40 "Parallel archive requests"
DATA=CEA
DATAHEX='[434541]'
test_104() {
- # test needs a running copytool
- copytool_setup
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
fid=$(make_custom_file_for_progress $f 39 1000000)
[ $? != 0 ] && skip "not enough free space" && return
- # if cdt is on, it can serve too quickly the request
- cdt_disable
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER --data $DATA $f
local data1=$(do_facet $SINGLEMDS "$LCTL get_param -n\
$HSM_PARAM.actions |\
grep $fid | cut -f16 -d=")
- cdt_enable
[[ "$data1" == "$DATAHEX" ]] ||
error "Data field in records is ($data1) and not ($DATAHEX)"
+ # archive the file
+ copytool_setup
+
+ wait_request_state $fid ARCHIVE SUCCEED
+
copytool_cleanup
}
run_test 104 "Copy tool data field"
+cleanup_test_105() {
+ trap 0
+ set_hsm_param max_requests $max_requests
+ copytool_cleanup
+}
+
test_105() {
+ local max_requests=$(get_hsm_param max_requests)
mkdir -p $DIR/$tdir
local i=""
+ set_hsm_param max_requests 300
+
+ trap cleanup_test_105 EXIT
+
cdt_disable
for i in $(seq -w 1 10); do
cp /etc/passwd $DIR/$tdir/$i
$HSM_PARAM.actions |\
grep WAITING | wc -l")
cdt_restart
+
cdt_disable
local reqcnt2=$(do_facet $SINGLEMDS "$LCTL get_param -n\
$HSM_PARAM.actions |\
[[ "$reqcnt1" == "$reqcnt2" ]] ||
error "Requests count after shutdown $reqcnt2 != "\
"before shutdown $reqcnt1"
+
+ cleanup_test_105
}
run_test 105 "Restart of coordinator"
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
+ # wait request to reach CT
+ wait_request_state $fid ARCHIVE STARTED
+
rm -f $f
copytool_continue
copytool_suspend
$LFS hsm_restore $f
+
+ # wait request to reach CT
+ wait_request_state $fid RESTORE STARTED
+
rm -f $f
copytool_continue
copytool_suspend
$LFS hsm_remove $f
+
+ # wait for request to reach CT
+ wait_request_state $fid REMOVE STARTED
+
rm -f $f
copytool_continue