search_copytools() {
local hosts=${1:-$(facet_active_host $SINGLEAGT)}
- do_nodesv $hosts "libtool execute pgrep -x $HSMTOOL"
+ do_nodesv $hosts "pgrep --pidfile=$HSMTOOL_PID_FILE hsmtool"
}
wait_copytools() {
{
local fid="$1"
- case "$HSMTOOL" in
- lhsmtool_posix)
- printf "%s" "$(hsm_root)/*/*/*/*/*/*/$fid"
- ;;
+ case "$HSMTOOL_ARCHIVE_FORMAT" in
+ v1)
+ printf "%s" "$(hsm_root)/*/*/*/*/*/*/$fid"
+ ;;
+ v2)
+ printf "%s" "$(hsm_root)/*/$fid"
+ ;;
esac
}
copytool_suspend() {
local agents=${1:-$(facet_active_host $SINGLEAGT)}
- stack_trap \
- "do_nodesv $agents libtool execute pkill -CONT -x '$HSMTOOL' || true" EXIT
- do_nodesv $agents "libtool execute pkill -STOP -x $HSMTOOL" || return 0
+ stack_trap "pkill_copytools $agents CONT || true" EXIT
+ pkill_copytools $agents STOP || return 0
echo "Copytool is suspended on $agents"
}
# Lustre mount-point is mandatory and last parameter on
# copytool cmd-line.
- local mntpnt=$(do_rpc_nodes $agent libtool execute ps -C $HSMTOOL -o args= |
+ local mntpnt=$(do_rpc_nodes $agent \
+ pgrep --pidfile=$HSMTOOL_PID_FILE --list-full hsmtool |
awk '{print $NF}')
[ -n "$mntpnt" ] || error "Found no Agent or with no mount-point "\
"parameter"
error "wrong archive number, $st != $LOCAL_HSM_ARCHIVE_NUMBER"
LOCAL_HSM_ARCHIVE_NUMBER=33
- if [ $(lustre_version_code client) -ge $(version_code 2.11.56) ] &&
- [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.11.56) ]; then
+ if [ "$CLIENT_VERSION" -ge $(version_code 2.11.56) ] &&
+ [ "$MDS1_VERSION" -ge $(version_code 2.11.56) ]; then
# lustre in the new version supports unlimited archiveID.
# Test whether setting archive number > 32 is supported
$LFS hsm_set --exists --archive-id $LOCAL_HSM_ARCHIVE_NUMBER $f ||
run_test 1d "Archive, Release and Restore DoM file"
test_1e() {
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] &&
+ [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] &&
skip "skipped for lustre < $SEL_VER"
mkdir -p $DIR/$tdir
}
run_test 11b "Import a deleted file using its FID"
+test_11c() {
+ pool_add $TESTNAME || error "Pool creation failed"
+ pool_add_targets $TESTNAME 1 1 || error "pool_add_targets failed"
+
+ mkdir -p $DIR/$tdir
+ $LFS setstripe -p "$TESTNAME" $DIR/$tdir
+
+ copy2archive /etc/hosts $tdir/$tfile
+ copytool import $tdir/$tfile $DIR/$tdir/$tfile
+}
+run_test 11c "Import a file to a directory with a pool"
+
test_12a() {
# test needs a running copytool
copytool setup
# LU-4388/LU-4389 - ZFS does not report full number of blocks
# used until file is flushed to disk
- if [ $(facet_fstype ost1) == "zfs" ]; then
+ if [ "$ost1_FSTYPE" == "zfs" ]; then
# this causes an OST_SYNC rpc to be sent
dd if=/dev/zero of=$f bs=512 count=1 oflag=sync conv=notrunc,fsync
# clear locks to reread file data
test_500()
{
- [ $MDS1_VERSION -lt $(version_code 2.6.92) ] &&
+ [ "$MDS1_VERSION" -lt $(version_code 2.6.92) ] &&
skip "HSM migrate is not supported"
test_mkdir -p $DIR/$tdir
- if [ $(lustre_version_code client) -lt $(version_code 2.11.56) ] ||
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.56) ];
+ if [ "$CLIENT_VERSION" -lt $(version_code 2.11.56) ] ||
+ [ "$MDS1_VERSION" -lt $(version_code 2.11.56) ];
then
llapi_hsm_test -d $DIR/$tdir -b ||
error "One llapi HSM test failed"
run_test 500 "various LLAPI HSM tests"
test_600() {
- [ $MDS1_VERSION -lt $(version_code 2.10.58) ] &&
+ [ "$MDS1_VERSION" -lt $(version_code 2.10.58) ] &&
skip "need MDS version at least 2.10.58"
mkdir -p $DIR/$tdir
local llog_reader=$(do_facet mgs "which llog_reader 2> /dev/null")
llog_reader=${llog_reader:-$LUSTRE/utils/llog_reader}
[ -z $(do_facet mgs ls -d $llog_reader 2> /dev/null) ] &&
- skip_env "missing llog_reader" && return
- local fstype=$(facet_fstype mds1)
+ skip_env "missing llog_reader"
mkdir -p $DIR/$tdir
local entry
#remount mds1 as ldiskfs or zfs type
- stack_trap "stop mds1; start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS" EXIT
stop mds1 || error "stop mds1 failed"
+ stack_trap "unmount_fstype mds1; start mds1 $(mdsdevname 1)\
+ $MDS_MOUNT_OPTS" EXIT
mount_fstype mds1 || error "remount mds1 failed"
for ((i = 0; i < 1; i++)); do