if $SHARED_KEY; then
# bug number for skipped tests: LU-9795 (all below)
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 0 31 32a 32d 35a"
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 53a 53b 54b 76a 76b"
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 76c 76d 78 103"
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 84 86 103"
fi
if ! combined_mgs_mds; then
# and stop to generate the startup logs.
start_mds
start_ost
- wait_osc_import_state mds ost FULL
+ wait_osc_import_state mds ost FULL
stop_ost
stop_mds
}
}
reformat() {
- formatall
+ formatall
}
start_mgs () {
for num in $(seq $MDSCOUNT); do
start_mdt $num $@ || return 94
done
+ for num in $(seq $MDSCOUNT); do
+ wait_clients_import_state ${CLIENTS:-$HOSTNAME} mds${num} FULL
+ done
}
start_mgsmds() {
}
stop_mgs() {
- echo "stop mgs service on `facet_active_host mgs`"
- # These tests all use non-failover stop
- stop mgs -f || return 97
+ echo "stop mgs service on `facet_active_host mgs`"
+ # These tests all use non-failover stop
+ stop mgs -f || return 97
}
start_ost() {
echo "start ost1 service on `facet_active_host ost1`"
start ost1 $(ostdevname 1) $OST_MOUNT_OPTS $@ || return 95
+ wait_clients_import_state ${CLIENTS:-$HOSTNAME} ost1 FULL
}
stop_ost() {
start_ost2() {
echo "start ost2 service on `facet_active_host ost2`"
start ost2 $(ostdevname 2) $OST_MOUNT_OPTS $@ || return 92
+ wait_clients_import_state ${CLIENTS:-$HOSTNAME} ost2 FULL
}
stop_ost2() {
do_facet client "cp /etc/passwd $DIR/a" || return 71
do_facet client "rm $DIR/a" || return 72
# make sure lustre is actually mounted (touch will block,
- # but grep won't, so do it after)
- do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
+ # but grep won't, so do it after)
+ do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
echo "setup single mount lustre success"
}
local writeconf=$2
local dne_upgrade=${dne_upgrade:-"no"}
local dom_upgrade=${dom_upgrade:-"no"}
+ local project_upgrade=${project_upgrade:-"no"}
local ff_convert=${ff_convert:-"no"}
local shall_cleanup_mdt=false
local shall_cleanup_mdt1=false
error_noexit "import zfs pool failed"
return 1
}
+ elif [ "$project_upgrade" != "no" ]; then
+ ! $r tune2fs -O project $mdt_dev &&
+ error_noexit "enable project on mdt0 failed" &&
+ return 1
+ $mdt2_is_available && ! $r tune2fs "-O project" $mdt2_dev &&
+ error_noexit "enable project on mdt failed" &&
+ return 1
+ ! $r tune2fs -O project $ost_dev &&
+ error_noexit "enable project on mdt failed" &&
+ return 1
fi
$r $LCTL set_param debug="$PTLDEBUG"
return 1
}
+ if [ "$mds1_FSTYPE" == ldiskfs -a \
+ "$project_upgrade" != "no" ]; then
+ ! $LFS project -d -p 1 $tmp/mnt/lustre/* &&
+ error_noexit "set project failed" &&
+ return 1
+ fi
+
[[ $(do_facet mds1 pgrep orph_.*-MDD | wc -l) == 0 ]] ||
error "MDD orphan cleanup thread not quit"
t32_check
for tarball in $tarballs; do
- banner "testing $tarball upgrade with ff convert"
- ff_convert=yes t32_test $tarball || rc=$?
+ banner "testing $tarball upgrade with ff convert and project upgrade"
+ project_upgrade="no"
+ [[ "$MDS1_VERSION" -ge $(version_code 2.13.54) ]] &&
+ [[ "$tarball" =~ "disk2_4-ldiskfs" ]] &&
+ project_upgrade="yes"
+ project_upgrade=$project_upgrade ff_convert=yes t32_test \
+ $tarball || rc=$?
done
return $rc
}
-run_test 32d "convert ff test"
+run_test 32d "convert ff and project quota upgrade test"
test_32e() {
[[ "$MDS1_VERSION" -ge $(version_code 2.10.56) ]] ||
skip "ldiskfs module has not been loaded"
fi
+ if grep -q "CONFIG_DEBUG_LOCK_ALLOC=y" /boot/config-$(uname -r); then
+ skip "test is not compatible with CONFIG_DEBUG_LOCK_ALLOC=y"
+ fi
+
echo "$inode_slab ldiskfs inodes per page"
[ "${inode_slab%.*}" -ge "3" ] && return 0
[[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
skip "Need server version newer than 2.7.55"
- local OST_OPTS="$(mkfs_opts ost1 $(ostdevname 1)) \
- --reformat $(ostdevname 1) $(ostvdevname 1)"
-
local NEWSIZE=1024
local OLDSIZE=$(do_facet ost1 "$DEBUGFS -c -R stats $(ostdevname 1)" |
awk '/Flex block group size: / { print $NF; exit; }')
- local opts=OST_OPTS
- if [[ ${!opts} != *mkfsoptions* ]]; then
- eval opts=\"${!opts} \
- --mkfsoptions='\\\"-O flex_bg -G $NEWSIZE\\\"'\"
- else
- val=${!opts//--mkfsoptions=\\\"/ \
- --mkfsoptions=\\\"-O flex_bg -G $NEWSIZE }
- eval opts='${val}'
- fi
+ [ "$OLDSIZE" == "$NEWSIZE" ] && skip "$NEWSIZE groups already"
+ local opts=" -O flex_bg -G $NEWSIZE"
+ opts=$(OST_FS_MKFS_OPTS+="$opts" mkfs_opts ost1 $(ostdevname 1))
+ opts+=" --reformat $(ostdevname 1) $(ostvdevname 1)"
echo "params: $opts"
trap cleanup_86 EXIT ERR
check_uuid_on_mdt() {
local nid=$1
- do_facet $SINGLEMDS "$LCTL get_param mdt.${FSNAME}*.exports.'$nid'.uuid"
+ do_facet $SINGLEMDS "$LCTL get_param mdt.${mds1_svc}*.exports.'$nid'.uuid"
}
test_91() {
echo "evict $nid"
do_facet $SINGLEMDS \
"$LCTL set_param -n mdt.${mds1_svc}.evict_client nid:$nid"
+ sleep 1 # eviction above is async, give it some time to proceed
found=$(check_uuid_on_mdt $nid | grep $uuid)
[ -n "$found" ] && error "found $uuid $nid on MDT"
}
run_test 100 "check lshowmount lists MGS, MDT, OST and 0@lo"
-test_101() {
+test_101a() {
local createmany_pid
local dev=$FSNAME-OST0000-osc-MDT0000
setup
unlinkmany $DIR1/$tdir/$tfile-%d 50000
cleanup
}
-run_test 101 "Race MDT->OST reconnection with create"
+run_test 101a "Race MDT->OST reconnection with create"
+
+test_101b () {
+ local dev=$FSNAME-OST0000-osc-MDT0000
+ local dir=$DIR1/$tdir
+ setup
+
+ mkdir $dir
+ $LFS setstripe -c 1 -i 0 $dir
+ do_facet $SINGLEMDS "$LCTL --device $dev deactivate;"
+#define OBD_FAIL_OSP_CON_EVENT_DELAY 0x2107
+ do_facet mds1 "$LCTL set_param fail_loc=0x80002107 fail_val=20"
+ do_facet $SINGLEMDS "$LCTL --device $dev activate;"
+ stop_ost
+ sleep 25
+ start_ost
+
+ wait_osc_import_state client ost1 FULL
+ touch $dir/$tfile || error "Can't create file"
+
+ cleanup
+}
+run_test 101b "Race events DISCONNECT and ACTIVE in osp"
test_102() {
[[ "$MDS1_VERSION" -gt $(version_code 2.9.53) ]] ||
(( $val == 1 )) || error "obdfilter.$FSNAME-OST0001*.no_precreate=$val"
mount_client $MOUNT || error "mount client failed"
+ wait_osc_import_state mds1 ost1 FULL
+ wait_osc_import_state client ost1 FULL
wait_osc_import_state client ost2 FULL
$LFS setstripe -i 0 $DIR/$tfile.0 ||
sleep_maxage
$LFS setstripe -i 1 $DIR/$tfile.2 ||
error "failed to create $tfile.2 on ost1 facet"
+ # files not cleaned with ONLY_REPEAT because of client unmount below
+ rm -f $DIR/$tfile.[012]
stop_ost2 || error "stop ost2 facet failed"
cleanup
}
MDSSIZE=$old_mdssize
MDSISIZE=$old_mdsisize
- do_facet $SINGLEMDS $MKFS $opts17t $tmpmnt/$mdtimg ||
+
+ do_facet $SINGLEMDS $MKFS \
+ ${opts17t/-E /-E lazy_itable_init,lazy_journal_init,} \
+ $tmpmnt/$mdtimg ||
error "failed to mkfs for $tmpmnt/$mdtimg"
do_facet $SINGLEMDS $TUNE2FS -l $tmpmnt/$mdtimg |
local yaml
local orig_val
+ local mgs_arg=""
+
+ [[ $MGS_VERSION -gt $(version_code 2.13.54) ]] ||
+ mgs_arg="--device MGS"
orig_val=$(do_facet mgs $LCTL get_param jobid_name)
do_facet mgs $LCTL set_param -P jobid_name="TESTNAME"
- yaml=$(do_facet mgs $LCTL --device MGS llog_print params |
+ yaml=$(do_facet mgs $LCTL $mgs_arg llog_print params |
grep jobid_name | tail -n 1)
local param=$(awk '{ print $10 }' <<< "$yaml")
local start=10
local end=50
+ local mgs_arg=""
+
+ [[ $MGS_VERSION -gt $(version_code 2.13.54) ]] ||
+ mgs_arg="--device MGS"
[ -d $MOUNT/.lustre ] || setup
# - { index: 10, event: add_uuid, nid: 192.168.20.1@tcp(0x20000c0a81401,
# node: 192.168.20.1@tcp }
- do_facet mgs $LCTL --device MGS \
+ do_facet mgs $LCTL $mgs_arg \
llog_print --start $start --end $end $FSNAME-client | tr -d , |
while read DASH BRACE INDEX idx EVENT BLAH BLAH BLAH; do
(( idx >= start )) || error "llog_print index $idx < $start"
[ -d $MOUNT/.lustre ] || setupall
local max=$($LCTL get_param -n osc.*-OST0000-*.max_dirty_mb | head -1)
+ local mgs_arg=""
+
+ [[ $MGS_VERSION -gt $(version_code 2.13.54) ]] ||
+ mgs_arg="--device MGS"
if do_facet mgs "$LCTL help llog_cancel" 2>&1| grep -q -- --log_id; then
# save one set_param -P record in case none exist
do_facet mgs $LCTL set_param -P osc.*.max_dirty_mb=$max
local log=params
- local orig=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ local orig=$(do_facet mgs $LCTL $mgs_arg llog_print $log |
tail -1 | awk '{ print $4 }' | tr -d , )
do_facet mgs $LCTL set_param -P osc.*.max_dirty_mb=$max
- do_facet mgs $LCTL --device MGS llog_print $log | tail -1 |
+ do_facet mgs $LCTL $mgs_arg llog_print $log | tail -1 |
grep "parameter: osc.*.max_dirty_mb" ||
error "new set_param -P wasn't stored in params log"
# - { index: 71, event: set_param, device: general,
# param: osc.*.max_dirty_mb, value: 256 }
- local id=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ local id=$(do_facet mgs $LCTL $mgs_arg llog_print $log |
tail -1 | awk '{ print $4 }' | tr -d , )
- do_facet mgs $LCTL --device MGS llog_cancel $log --log_idx=$id
- local new=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ do_facet mgs $LCTL $mgs_arg llog_cancel $log --log_idx=$id
+ local new=$(do_facet mgs $LCTL $mgs_arg llog_print $log |
tail -1 | awk '{ print $4 }' | tr -d , )
(( new == orig )) ||
error "new llog_cancel now $new, not at $orig records"
[ -z $mds2failover_HOST ] && skip "needs MDT failover setup"
setup
+ do_facet mgs $LCTL --device MGS llog_print $FSNAME-client |
+ grep 1.2.3.4@tcp && error "Should not be fake nid"
+ do_facet mgs $LCTL conf_param $FSNAME-MDT0001.failover.node=1.2.3.4@tcp\
+ || error "Set params error"
+ do_facet mgs $LCTL --device MGS llog_print $FSNAME-client |
+ grep 1.2.3.4@tcp || error "Fake nid should be added"
cleanup
load_modules
echo "Before: ${facet} ${device} ${pre_max_sectors} ${max_hw_sectors}"
- do_facet ${facet} "libtool execute l_tunedisk ${device}"
+ do_facet ${facet} "l_tunedisk ${device}"
# Value after l_tunedisk
local post_max_sectors=$(get_max_sectors_kb ${facet} ${device})
}
run_test 126 "mount in parallel shouldn't cause a crash"
+test_127() {
+ [[ "$ost1_FSTYPE" == ldiskfs ]] || skip "ldiskfs only test"
+
+ cleanup
+ setup
+ zconf_umount_clients $RCLIENTS $MOUNT
+
+ wait_osp_active ost ${FSNAME}-OST0000 0 1
+ local osc_tgt="$FSNAME-OST0000-osc-$($LFS getname -i $DIR)"
+ local avail1=($($LCTL get_param -n osc.${osc_tgt}.kbytesavail))
+
+ $LFS setstripe -i 0 $DIR/$tfile || error "failed creating $DIR/$tfile"
+ dd if=/dev/zero of=$DIR/$tfile bs=1M oflag=direct || true
+
+ local avail2=($($LCTL get_param -n osc.${osc_tgt}.kbytesavail))
+
+ if ((avail2 * 100 / avail1 > 1)); then
+ lfs df $DIR
+ ls -l $DIR/$tfile
+ error "more than 1% space left: before=$avail1 after=$avail2"
+ fi
+
+ local mbs=$(($(stat -c %s $DIR/$tfile) / (1024 * 1024)))
+
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=$mbs conv=notrunc \
+ oflag=direct || error "overwrite failed"
+}
+run_test 127 "direct io overwrite on full ost"
+
+test_128()
+{
+ combined_mgs_mds && skip "need separate mgs device"
+ [ "$ost2_FSTYPE" == zfs ] && import_zpool ost2
+
+ format_ost 2
+ # Try to apply nolocallogs to the virgin OST. Should fail.
+ do_facet ost2 "$TUNEFS --nolocallogs $(ostdevname 2)" &&
+ error "nolocallogs should not be allowed on the virgin target"
+
+ setupall
+ stopall
+
+ [ "$ost1_FSTYPE" == zfs ] && import_zpool ost1
+ # Start OST without MGS (local configs)
+ do_facet ost1 "$TUNEFS --dryrun $(ostdevname 1)"
+ start_ost || error "unable to start OST1"
+ stop_ost || error "Unable to stop OST1"
+
+ [ "$ost1_FSTYPE" == zfs ] && import_zpool ost1
+ # Do not allow reading local configs, should fail
+ do_facet ost1 "$TUNEFS --nolocallogs $(ostdevname 1)" ||
+ error "Can not set nolocallogs"
+ start_ost && error "OST1 started, but should fail"
+
+ # Connect to MGS successfully, reset nolocallogs flag
+ [ "$ost1_FSTYPE" == zfs ] && import_zpool ost1
+ start_mgs || error "unable to start MGS"
+ start_ost || error "unable to start OST1"
+
+ do_facet ost1 "$TUNEFS --dryrun $(ostdevname 1)" | grep "nolocallogs" &&
+ error "nolocallogs expected to be reset"
+
+ stop_ost || error "Unable to stop OST1"
+}
+run_test 128 "Force using remote logs with --nolocallogs"
+
if ! combined_mgs_mds ; then
stop mgs
fi