test script incompatibility when running server as
2.1 and client as 2.2
- conf-sanity: 61
- recovery-small: 100, 101, 102, 103, 104, 105
- santiy: 133a, 133d, 160, 225a, 225b
Signed-off-by: yang sheng <ys@whamcloud.com>
Change-Id: I97dea88cdebb2f229aa6d2852a653619145e59a2
Reviewed-on: http://review.whamcloud.com/2441
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
test_61() { # LU-80
local reformat=false
test_61() { # LU-80
local reformat=false
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.1.53) ] ||
+ { skip "Need MDS version at least 2.1.53"; return 0; }
+
if ! large_xattr_enabled; then
reformat=true
local mds_dev=$(mdsdevname ${SINGLEMDS//mds/})
if ! large_xattr_enabled; then
reformat=true
local mds_dev=$(mdsdevname ${SINGLEMDS//mds/})
test_1() {
if ! check_versions; then
test_1() {
if ! check_versions; then
- skip "liblustre version mismatch: cli $CLIVER, mds $MDSVER, ost $OSTVER"
+ skip "liblustre version mismatch: cli $(lustre_version_code client), \
+ mds $(lustre_version_code $SINGLEMDS), ost $(lustre_version_code ost1)"
elif ! [ "$NETTYPE" = "tcp" -o "$NETTYPE" = "ptl" ]; then
skip "NETTYPE=$NETTYPE unsupported for liblustre"
elif [ ! -x $LIBLUSTRETESTS/sanity ]; then
elif ! [ "$NETTYPE" = "tcp" -o "$NETTYPE" = "ptl" ]; then
skip "NETTYPE=$NETTYPE unsupported for liblustre"
elif [ ! -x $LIBLUSTRETESTS/sanity ]; then
+ do_facet mgs $LCTL list_param mgs.*.ir_timeout ||
+ { skip "MGS without IR support"; return 0; }
+
# disable IR
set_ir_status disabled
# disable IR
set_ir_status disabled
+ do_facet mgs $LCTL list_param mgs.*.ir_timeout ||
+ { skip "MGS without IR support"; return 0; }
+
set_ir_status full
local OST1_IMP=$(get_osc_import_name client ost1)
set_ir_status full
local OST1_IMP=$(get_osc_import_name client ost1)
+ do_facet mgs $LCTL list_param mgs.*.ir_timeout ||
+ { skip "MGS without IR support"; return 0; }
+
local clients=${CLIENTS:-$HOSTNAME}
local old_version
local new_version
local clients=${CLIENTS:-$HOSTNAME}
local old_version
local new_version
+ do_facet mgs $LCTL list_param mgs.*.ir_timeout ||
+ { skip "MGS without IR support"; return 0; }
+
combined_mgs_mds && skip "mgs and mds on the same target" && return 0
# workaround solution to generate config log on the mds
combined_mgs_mds && skip "mgs and mds on the same target" && return 0
# workaround solution to generate config log on the mds
+ do_facet mgs $LCTL list_param mgs.*.ir_timeout ||
+ { skip "MGS without IR support"; return 0; }
+
set_ir_status full
stop ost1
set_ir_status full
stop ost1
test_105()
{
[ -z "$RCLIENTS" ] && skip "Needs multiple clients" && return 0
test_105()
{
[ -z "$RCLIENTS" ] && skip "Needs multiple clients" && return 0
+ do_facet mgs $LCTL list_param mgs.*.ir_timeout ||
+ { skip "MGS without IR support"; return 0; }
[ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
# LU-482 Avert LVM and VM inability to flush caches in pre .33 kernels
[ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
# LU-482 Avert LVM and VM inability to flush caches in pre .33 kernels
-if [ $LINUX_VERSION_CODE -lt $(kernel_version 2 6 33) ]; then
+if [ $LINUX_VERSION_CODE -lt $(version_code 2.6.33) ]; then
sync
do_facet $SINGLEMDS sync
fi
sync
do_facet $SINGLEMDS sync
fi
mkdir -p $DIR
# LU-482 Avert LVM and VM inability to flush caches in pre .33 kernels
mkdir -p $DIR
# LU-482 Avert LVM and VM inability to flush caches in pre .33 kernels
-if [ $LINUX_VERSION_CODE -lt $(kernel_version 2 6 33) ]; then
+if [ $LINUX_VERSION_CODE -lt $(version_code 2.6.33) ]; then
sync
do_facet $SINGLEMDS sync
fi
sync
do_facet $SINGLEMDS sync
fi
rm -rf $DIR/[df][0-9]*
# LU-482 Avert LVM and VM inability to flush caches in pre .33 kernels
rm -rf $DIR/[df][0-9]*
# LU-482 Avert LVM and VM inability to flush caches in pre .33 kernels
-if [ $LINUX_VERSION_CODE -lt $(kernel_version 2 6 33) ]; then
+if [ $LINUX_VERSION_CODE -lt $(version_code 2.6.33) ]; then
sync
do_facet $SINGLEMDS sync
fi
sync
do_facet $SINGLEMDS sync
fi
test_133a() {
remote_ost_nodsh && skip "remote OST with nodsh" && return
remote_mds_nodsh && skip "remote MDS with nodsh" && return
test_133a() {
remote_ost_nodsh && skip "remote OST with nodsh" && return
remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
+ do_facet $SINGLEMDS $LCTL list_param mdt.*.rename_stats ||
+ { skip "MDS doesn't support rename stats"; return; }
local testdir=$DIR/${tdir}/stats_testdir
mkdir -p $DIR/${tdir}
local testdir=$DIR/${tdir}/stats_testdir
mkdir -p $DIR/${tdir}
test_133d() {
remote_ost_nodsh && skip "remote OST with nodsh" && return
remote_mds_nodsh && skip "remote MDS with nodsh" && return
test_133d() {
remote_ost_nodsh && skip "remote OST with nodsh" && return
remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ do_facet $SINGLEMDS $LCTL list_param mdt.*.rename_stats ||
+ { skip "MDS doesn't support rename stats"; return; }
+
local testdir1=$DIR/${tdir}/stats_testdir1
local testdir2=$DIR/${tdir}/stats_testdir2
local testdir1=$DIR/${tdir}/stats_testdir1
local testdir2=$DIR/${tdir}/stats_testdir2
test_160() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
test_160() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.0) ] ||
+ { skip "Need MDS version at least 2.2.0"; return; }
USER=$(do_facet $SINGLEMDS $LCTL --device $MDT0 changelog_register -n)
echo "Registered as changelog user $USER"
do_facet $SINGLEMDS $LCTL get_param -n mdd.$MDT0.changelog_users | \
USER=$(do_facet $SINGLEMDS $LCTL --device $MDT0 changelog_register -n)
echo "Registered as changelog user $USER"
do_facet $SINGLEMDS $LCTL get_param -n mdd.$MDT0.changelog_users | \
if [ -z ${MDSSURVEY} ]; then
skip_env "mds-survey not found" && return
fi
if [ -z ${MDSSURVEY} ]; then
skip_env "mds-survey not found" && return
fi
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.51) ] ||
+ { skip "Need MDS version at least 2.2.51"; return; }
local mds=$(facet_host $SINGLEMDS)
local target=$(do_nodes $mds 'lctl dl' | \
local mds=$(facet_host $SINGLEMDS)
local target=$(do_nodes $mds 'lctl dl' | \
if [ -z ${MDSSURVEY} ]; then
skip_env "mds-survey not found" && return
fi
if [ -z ${MDSSURVEY} ]; then
skip_env "mds-survey not found" && return
fi
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.51) ] ||
+ { skip "Need MDS version at least 2.2.51"; return; }
if [ $($LCTL dl | grep -c osc) -eq 0 ]; then
skip_env "Need to mount OST to test" && return
if [ $($LCTL dl | grep -c osc) -eq 0 ]; then
skip_env "Need to mount OST to test" && return
+version_code() {
+ # split arguments like "1.8.6-wc3" into "1", "8", "6", "wc3"
+ eval set -- $(tr "[:punct:]" " " <<< $*)
+
echo -n $((($1 << 16) | ($2 << 8) | $3))
}
export LINUX_VERSION=$(uname -r | sed -e "s/[-.]/ /3" -e "s/ .*//")
echo -n $((($1 << 16) | ($2 << 8) | $3))
}
export LINUX_VERSION=$(uname -r | sed -e "s/[-.]/ /3" -e "s/ .*//")
-export LINUX_VERSION_CODE=$(kernel_version ${LINUX_VERSION//\./ })
+export LINUX_VERSION_CODE=$(version_code ${LINUX_VERSION//\./ })
case `uname -r` in
2.4.*) EXT=".o"; USE_QUOTA=no; [ ! "$CLIENTONLY" ] && FSTYPE=ext3;;
case `uname -r` in
2.4.*) EXT=".o"; USE_QUOTA=no; [ ! "$CLIENTONLY" ] && FSTYPE=ext3;;
- if ! remote_ost_nodsh && ! remote_mds_nodsh; then
- export MDSVER=$(do_facet $SINGLEMDS "lctl get_param version" | cut -d. -f1,2)
- export OSTVER=$(do_facet ost1 "lctl get_param version" | cut -d. -f1,2)
- export CLIVER=$(lctl get_param version | cut -d. -f 1,2)
- fi
-
remote_mds_nodsh ||
TIMEOUT=$(do_facet $SINGLEMDS "lctl get_param -n timeout")
remote_mds_nodsh ||
TIMEOUT=$(do_facet $SINGLEMDS "lctl get_param -n timeout")
- [ "$MDSVER" = "$CLIVER" -a "$OSTVER" = "$CLIVER" ]
+ [ "$(lustre_version_code client)" = "$(lustre_version_code $SINGLEMDS)" -a \
+ "$(lustre_version_code client)" = "$(lustre_version_code ost1)" ]
get_lustre_version () {
local facet=${1:-"$SINGLEMDS"}
get_lustre_version () {
local facet=${1:-"$SINGLEMDS"}
- do_facet $facet $LCTL get_param -n version | awk '/^lustre:/ {print $2}'
-}
-
-get_mds_version_major () {
- local facet=${1:-"$SINGLEMDS"}
- local version=$(get_lustre_version $facet)
- echo $version | awk -F. '{print $1}'
+ do_facet $facet $LCTL get_param -n version | awk '/^lustre:/ {print $2}'
-get_mds_version_minor () {
local facet=${1:-"$SINGLEMDS"}
local facet=${1:-"$SINGLEMDS"}
- local version=$(get_lustre_version $facet)
- echo $version | awk -F. '{print $2}'
+ version_code $(get_lustre_version $1)
}
# If the 2.0 MDS was mounted on 1.8 device, then the OSC and LOV names
}
# If the 2.0 MDS was mounted on 1.8 device, then the OSC and LOV names
# mdt osc: fsname-OSTXXXX-osc
mds_on_old_device() {
local mds=${1:-"$SINGLEMDS"}
# mdt osc: fsname-OSTXXXX-osc
mds_on_old_device() {
local mds=${1:-"$SINGLEMDS"}
- local major=$(get_mds_version_major $mds)
- local minor=$(get_mds_version_minor $mds)
- if [ $major -ge 2 ] || [ $major -eq 1 -a $minor -gt 8 ]; then
+ if [ $(lustre_version_code $mds) -gt $(version_code 1.9.0) ]; then
do_facet $mds "lctl list_param osc.$FSNAME-OST*-osc \
> /dev/null 2>&1" && return 0
fi
do_facet $mds "lctl list_param osc.$FSNAME-OST*-osc \
> /dev/null 2>&1" && return 0
fi
local mdt_label=$(convert_facet2label $mds_facet)
local mdt_index=$(echo $mdt_label | sed -e 's/^.*-//')
local mdt_label=$(convert_facet2label $mds_facet)
local mdt_index=$(echo $mdt_label | sed -e 's/^.*-//')
- local major=$(get_mds_version_major $mds_facet)
- local minor=$(get_mds_version_minor $mds_facet)
- if [ $major -le 1 -a $minor -le 8 ] || mds_on_old_device $mds_facet; then
+ if [ $(lustre_version_code $mds_facet) -le $(version_code 1.8.0) ] ||
+ mds_on_old_device $mds_facet; then
echo "${ost_label}-osc"
else
echo "${ost_label}-osc-${mdt_index}"
echo "${ost_label}-osc"
else
echo "${ost_label}-osc-${mdt_index}"