On our test systems the hostname of the servers is on the
ethernet fabric and for lustre we use infiniband separately.
Currently several test will not run because of the assumption
that lustre will use the same fabric and we use to login and
manage the server. This patch allows one to grab the real NIDs
instead of assuming its "hostname"@NETTYPE. The second part of
the patch removes using $MOUNT% directly and uses facet_mntpt.
The reason being is on our system the mount points are different
on our servers from our clients. MOUNT is assumed to be the same
for clients and the servers. This patch allows test to work if
that is not the case.
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I49f365561e341d44ace4c961fcae8b871dce7407
Reviewed-on: http://review.whamcloud.com/248
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
[ $? -eq 0 ] || { error "Unable to mount client"; return 3; }
local nrfiles=8
[ $? -eq 0 ] || { error "Unable to mount client"; return 3; }
local nrfiles=8
- local ost1mnt=${MOUNT%/*}/ost1
+ local ost1mnt=$(facet_mntpt ost1)
local ost1node=$(facet_active_host ost1)
local ost1tmp=$TMP/conf52
local ost1node=$(facet_active_host ost1)
local ost1tmp=$TMP/conf52
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
#
ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT"
#
ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT"
[ $smoke_DURATION -le 300 ] || smoke_DURATION=300
fi
[ $smoke_DURATION -le 300 ] || smoke_DURATION=300
fi
-lst_SERVERS=${lst_SERVERS:-$(comma_list $(osts_nodes) $(mdts_nodes))}
-lst_CLIENTS=${lst_CLIENTS:-${CLIENTS:-`hostname`}}
+nodes=$(comma_list "$(osts_nodes) $(mdts_nodes)")
+lst_SERVERS=${lst_SERVERS:-$(comma_list "$(host_nids_address $nodes $NETTYPE)")}
+lst_CLIENTS=${lst_CLIENTS:-$(comma_list "$(host_nids_address $CLIENTS $NETTYPE)")}
is_mounted () {
local mntpt=$1
is_mounted () {
local mntpt=$1
get_targets () {
local targets
local devs
get_targets () {
local targets
local devs
local oss
for oss in $(osts_nodes); do
devs=$(do_node $oss "lctl dl |grep obdfilter |sort" | awk '{print $4}')
local oss
for oss in $(osts_nodes); do
devs=$(do_node $oss "lctl dl |grep obdfilter |sort" | awk '{print $4}')
+ nid=$(host_nids_address $oss $NETTYPE)
for d in $devs; do
# if oss is local -- obdfilter-survey needs dev wo/ host
target=$d
for d in $devs; do
# if oss is local -- obdfilter-survey needs dev wo/ host
target=$d
- [[ $oss = `hostname` ]] || target=$oss:$target
+ [[ $oss = `hostname` ]] || target=$nid:$target
targets="$targets $target"
done
done
targets="$targets $target"
done
done
case $case in
disk) targets=$(get_targets);;
netdisk) targets=$(get_targets);;
case $case in
disk) targets=$(get_targets);;
netdisk) targets=$(get_targets);;
- network) targets="$(osts_nodes)";;
+ network) targets=$(host_nids_address $(comma_list $(osts_nodes)) $NETTYPE);;
*) error "unknown obdflter-survey case!" ;;
esac
echo $targets
*) error "unknown obdflter-survey case!" ;;
esac
echo $targets
local objid=${lmm[$((j+1))]}
local group=${lmm[$((j+3))]}
local dev=$(ostdevname $devnum)
local objid=${lmm[$((j+1))]}
local group=${lmm[$((j+3))]}
local dev=$(ostdevname $devnum)
- local dir=${MOUNT%/*}/ost$devnum
- local mntpt=$(facet_mntpt ost$devnum)
+ local dir=$(facet_mntpt ost$devnum)
stop ost$devnum
do_facet ost$devnum mount -t $FSTYPE $dev $dir $OST_MOUNT_OPTS ||
stop ost$devnum
do_facet ost$devnum mount -t $FSTYPE $dev $dir $OST_MOUNT_OPTS ||
[ $stripe -eq $i ] || { error "stripe mismatch"; return 6; }
echo -e "\t\tost $obdidx, objid $objid, group $group"
[ $stripe -eq $i ] || { error "stripe mismatch"; return 6; }
echo -e "\t\tost $obdidx, objid $objid, group $group"
- do_facet ost$devnum umount -d $mntpt
+ do_facet ost$devnum umount -d $dir
start ost$devnum $dev $OST_MOUNT_OPTS
done
}
start ost$devnum $dev $OST_MOUNT_OPTS
done
}
test_217() { # bug 22430
local node
test_217() { # bug 22430
local node
for node in $(nodes_list); do
for node in $(nodes_list); do
- if [[ $node = *-* ]] ; then
- echo "lctl ping $node@$NETTYPE"
- lctl ping $node@$NETTYPE
+ nid=$(host_nids_address $node $NETTYPE)
+ if [[ $nid = *-* ]] ; then
+ echo "lctl ping $nid@$NETTYPE"
+ lctl ping $nid@$NETTYPE
- echo "skipping $node (no hiphen detected)"
+ echo "skipping $node (no hyphen detected)"
+host_nids_address() {
+ local nodes=$1
+ local kind=$2
+
+ if [ -n "$kind" ]; then
+ nids=$(do_nodes $nodes "$LCTL list_nids | grep $kind | cut -f 1 -d '@'")
+ else
+ nids=$(do_nodes $nodes "$LCTL list_nids all | cut -f 1 -d '@'")
+ fi
+ echo $nids
+}
+
h2name_or_ip() {
if [ "$1" = "client" -o "$1" = "'*'" ]; then echo \'*\'; else
echo $1"@$2"
h2name_or_ip() {
if [ "$1" = "client" -o "$1" = "'*'" ]; then echo \'*\'; else
echo $1"@$2"
local mdtdev=$2
shift 2
local files="$@"
local mdtdev=$2
shift 2
local files="$@"
- local mntpt=${MOUNT%/*}/$facet
+ local mntpt=$(facet_mntpt $facet)
echo "removing files from $mdtdev on $facet: $files"
mount -t $FSTYPE $MDS_MOUNT_OPTS $mdtdev $mntpt || return $?
echo "removing files from $mdtdev on $facet: $files"
mount -t $FSTYPE $MDS_MOUNT_OPTS $mdtdev $mntpt || return $?
local mdtdev=$2
shift 2
local files="$@"
local mdtdev=$2
shift 2
local files="$@"
- local mntpt=${MOUNT%/*}/$facet
+ local mntpt=$(facet_mntpt $facet)
echo "duplicating files on $mdtdev on $facet: $files"
mkdir -p $mntpt || return $?
echo "duplicating files on $mdtdev on $facet: $files"
mkdir -p $mntpt || return $?