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
# 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
# use small MDS + OST size to speed formatting time
# do not use too small MDSSIZE/OSTSIZE, which affect the default journal size
MDSSIZE=100000
-[ $(facet_fstype $SINGLEMDS) == zfs ] && MDSSIZE=300000
+[ "$mds1_FSTYPE" == zfs ] && MDSSIZE=300000
OSTSIZE=100000
-[ $(facet_fstype ost1) == zfs ] && OSTSIZE=300000
+[ "$ost1_FSTYPE" == zfs ] && OSTSIZE=300000
# no need too many OSTs, to reduce the format/start/stop overhead
cleanupall
test_1b()
{
- [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
- skip "OI Scrub not implemented for ZFS" && return
+ [ "$mds1_FSTYPE" != ldiskfs ] &&
+ skip "OI Scrub not implemented for ZFS"
lfsck_prep 1 1
test_4()
{
- [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
- skip "OI Scrub not implemented for ZFS" && return
+ [ "$mds1_FSTYPE" != ldiskfs ] &&
+ skip "OI Scrub not implemented for ZFS"
lfsck_prep 3 3
cleanup_mount $MOUNT || error "(0.1) Fail to stop client!"
test_5()
{
- [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
- skip "OI Scrub not implemented for ZFS" && return
+ [ "$mds1_FSTYPE" != ldiskfs ] &&
+ skip "OI Scrub not implemented for ZFS"
lfsck_prep 1 1 1
cleanup_mount $MOUNT || error "(0.1) Fail to stop client!"
test_34()
{
- [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
- [ $(facet_fstype $SINGLEMDS) != zfs ] &&
- skip "Only valid for ZFS backend" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
+ [ "$mds1_FSTYPE" != zfs ] && skip "Only valid for ZFS backend"
lfsck_prep 1 1
test_38()
{
- [[ $MDS1_VERSION -le $(version_code 2.12.51) ]] &&
+ [[ "$MDS1_VERSION" -le $(version_code 2.12.51) ]] &&
skip "Need MDS version newer than 2.12.51"
test_mkdir $DIR/$tdir
test_39()
{
- [[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.12.51) ]] &&
+ [[ "$MDS1_VERSION" -le $(version_code 2.12.51) ]] &&
skip "Need MDS version newer than 2.12.51"
test_mkdir $DIR/$tdir
}
[ ! -z $inject ] && [ $inject -eq 1 ] &&
- [ $(facet_fstype $SINGLEMDS) = "zfs" ] && {
+ [ "$mds1_FSTYPE" = "zfs" ] && {
#define OBD_FAIL_OSD_FID_MAPPING 0x193
do_nodes $(comma_list $(mdts_nodes)) \
$LCTL set_param fail_loc=0x193
stop mds$n > /dev/null || error "Fail to stop MDS$n!"
done
- [ ! -z $inject ] && [ $(facet_fstype $SINGLEMDS) = "ldiskfs" ] && {
+ [ ! -z $inject ] && [ "$mds1_FSTYPE" = "ldiskfs" ] && {
if [ $inject -eq 1 ]; then
for n in $(seq $MDSCOUNT); do
mds_backup_restore mds$n ||
}
scrub_remove_ois() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] && return
local error_id=$1
local index=$2
}
full_scrub_ratio() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] && return
local ratio=$1
}
full_scrub_threshold_rate() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] && return
local rate=$1
scrub_prep 0 2
echo "start MDTs without disabling OI scrub"
scrub_start_mds 2 "$MOUNT_OPTS_SCRUB"
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_status 3 completed
mount_client $MOUNT || error "(4) Fail to start client!"
scrub_check_data2 runas 5
run_test 1b "Trigger OI scrub when MDT mounts for OI files remove/recreate case"
test_1c() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] &&
- skip "ldiskfs special test" && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] &&
+ skip "ldiskfs special test"
local index
run_test 1c "Auto detect kinds of OI file(s) removed/recreated cases"
test_2() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] &&
- skip "ldiskfs special test" && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] &&
+ skip "ldiskfs special test"
scrub_prep 0 1
echo "starting MDTs without disabling OI scrub"
echo "starting MDTs with OI scrub disabled"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
scrub_check_status 3 init
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
}
#run_test 3 "Do not trigger OI scrub when MDT mounts if 'noscrub' specified"
scrub_prep 0 1
echo "starting MDTs with OI scrub disabled"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
run_test 4a "Auto trigger OI scrub if bad OI mapping was found (1)"
test_4b() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] &&
- skip "ldiskfs special test" && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] &&
+ skip "ldiskfs special test"
scrub_prep 5 1
echo "starting MDTs with OI scrub disabled"
run_test 4b "Auto trigger OI scrub if bad OI mapping was found (2)"
test_4c() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] &&
- skip "ldiskfs special test" && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] &&
+ skip "ldiskfs special test"
scrub_prep 500 1
echo "starting MDTs with OI scrub disabled"
run_test 4c "Auto trigger OI scrub if bad OI mapping was found (3)"
test_4d() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] && skip "ldiskfs only test"
+ [ "$mds1_FSTYPE" != "ldiskfs" ] && skip "ldiskfs only test"
check_mount_and_prep
echo "starting MDTs with OI scrub disabled (1)"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
scrub_check_status 3 init
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
scrub_prep 100 1
echo "starting MDTs with OI scrub disabled"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
scrub_prep 500 1
echo "starting MDTs with OI scrub disabled"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
done
scrub_check_status 8 scanning
- if [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ]; then
+ if [ "$mds1_FSTYPE" != "ldiskfs" ]; then
scrub_check_flags 9 inconsistent,auto
else
scrub_check_flags 9 recreated,inconsistent,auto
scrub_prep 128 1
echo "starting MDTs with OI scrub disabled"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
#define OBD_FAIL_OSD_SCRUB_DELAY 0x190
test_9() {
# Skip scrub speed test for ZFS because of performance unstable
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] &&
- skip "test scrub speed only on ldiskfs" && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] &&
+ skip "test scrub speed only on ldiskfs"
if [ -z "$(grep "processor.*: 1" /proc/cpuinfo)" ]; then
skip "Testing on UP system, the speed may be inaccurate."
- return 0
fi
scrub_prep 6000 1
scrub_prep 0 1
echo "starting mds$n with OI scrub disabled (1)"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
scrub_prep 0 1
echo "starting MDTs with OI scrub disabled"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
#define OBD_FAIL_OSD_SCRUB_DELAY 0x190
#run_test 10b "non-stopped OI scrub should auto restarts after MDS remount (2)"
test_11() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] &&
- skip "ldiskfs special test" && return
+ [ "$mds1_FSTYPE" != "ldiskfs" ] &&
+ skip "ldiskfs special test"
local CREATED=100
local n
run_test 13 "OI scrub can rebuild missed /O entries"
test_14() {
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] &&
+ [ "$mds1_FSTYPE" != "ldiskfs" ] &&
skip "ldiskfs special test"
check_mount_and_prep
echo "starting MDTs with OI scrub disabled"
scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
scrub_check_status 3 init
- [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] ||
+ [ "$mds1_FSTYPE" != "ldiskfs" ] ||
scrub_check_flags 4 recreated,inconsistent
# run under dryrun mode
scrub_start 5 --dryrun
scrub_check_status 6 completed
- if [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ]; then
+ if [ "$mds1_FSTYPE" != "ldiskfs" ]; then
scrub_check_flags 7 inconsistent
repaired=2
else
# run under dryrun mode again
scrub_start 10 --dryrun
scrub_check_status 11 completed
- if [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ]; then
+ if [ "$mds1_FSTYPE" != "ldiskfs" ]; then
scrub_check_flags 12 inconsistent
else
scrub_check_flags 12 recreated,inconsistent