# More specific ones override more general ones. See facet_index().
NETTYPE=${NETTYPE:-tcp}
-MGSNID=${MGSNID:-$(h2$NETTYPE $mgs_HOST)}
+MGSNID=${MGSNID:-$(h2nettype $mgs_HOST)}
#
# Back end file system type(s) of facets can be specified with these
chown $T32_QID.$T32_QID $tmp/src/t32_qf_old
# format ost with comma-separated NIDs to verify LU-4460
- local failnid="$(h2$NETTYPE 1.2.3.4),$(h2$NETTYPE 4.3.2.1)"
+ local failnid="$(h2nettype 1.2.3.4),$(h2nettype 4.3.2.1)"
MGSNID="$MGSNID,$MGSNID" OSTOPT="--failnode=$failnid" formatall
setupall
local device=$(do_facet $SINGLEMDS "$LCTL get_param -n devices" |
awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
do_facet mgs "$LCTL conf_param \
- ${device}.failover.node=$(h2$NETTYPE $FAKENID)" ||
+ ${device}.failover.node=$(h2nettype $FAKENID)" ||
error "Setting ${device}.failover.node=\
- $(h2$NETTYPE $FAKENID) failed."
+ $(h2nettype $FAKENID) failed."
log "Wait for RECONNECT_INTERVAL seconds (10s)"
sleep 10
local device=$(do_facet $SINGLEMDS "$LCTL get_param -n devices" |
awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
do_facet mgs "$LCTL conf_param \
- ${device}.failover.node=$(h2$NETTYPE $FAKENID)" ||
+ ${device}.failover.node=$(h2nettype $FAKENID)" ||
error "Set ${device}.failover.node=\
- $(h2$NETTYPE $FAKENID) failed"
+ $(h2nettype $FAKENID) failed"
local at_max_saved=0
# adaptive timeouts may prevent seeing the issue
local client_ip=$(host_nids_address $HOSTNAME $NETTYPE)
local host=${client_ip//*./}
local net=${client_ip/%$host/}
- local nosquash_nids=$(h2$NETTYPE $net[$host,$host,$host])
+ local nosquash_nids=$(h2nettype $net[$host,$host,$host])
add $fs2mgs $(mkfs_opts mgs $fs2mgsdev) --fsname=$fsname \
--param mdt.root_squash=$RUNAS_ID:$RUNAS_ID \
local fs2ostvdev=$(ostvdevname 1_2)
local fsname=test1234
local mgsnid
- local failnid="$(h2$NETTYPE 1.2.3.4),$(h2$NETTYPE 4.3.2.1)"
+ local failnid="$(h2nettype 1.2.3.4),$(h2nettype 4.3.2.1)"
combined_mgs_mds || stop_mgs || error "stopping MGS service failed"
local client
for client in $clients; do
local client_ip=$(host_nids_address $client $NETTYPE)
- local client_nid=$(h2$NETTYPE $client_ip)
+ local client_nid=$(h2nettype $client_ip)
do_facet mgs $LCTL nodemap_add c${i} || return 1
do_facet mgs $LCTL nodemap_add_range \
--name c${i} --range $client_nid || return 1
test_100() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- [ "$NETTYPE" = tcp ] || \
- { skip "TCP secure port test, not useful for NETTYPE=$NETTYPE" && \
+ [[ "$NETTYPE" =~ tcp ]] ||
+ { skip "TCP secure port test, not useful for NETTYPE=$NETTYPE" &&
return ; }
remote_ost_nodsh && skip "remote OST with nodsh" && return
remote_mds_nodsh && skip "remote MDS with nodsh" && return
- remote_servers || \
+ remote_servers ||
{ skip "useless for local single node setup" && return; }
netstat -tna | ( rc=1; while read PROT SND RCV LOCAL REMOTE STAT; do
for node in $(nodes_list); do
nid=$(host_nids_address $node $NETTYPE)
if [[ $nid = *-* ]] ; then
- echo "lctl ping $nid@$NETTYPE"
- lctl ping $nid@$NETTYPE
+ echo "lctl ping $(h2nettype $nid)"
+ lctl ping $(h2nettype $nid)
else
echo "skipping $node (no hyphen detected)"
fi
set_default_debug
load_module ../lnet/lnet/lnet
- case $NETTYPE in
- o2ib)
- LNETLND="o2iblnd/ko2iblnd"
- ;;
- *)
- ;;
- esac
- LNETLND=${LNETLND:-"socklnd/ksocklnd"}
+
+ LNDPATH=${LNDPATH:-"../lnet/klnds"}
+ if [ -z "$LNETLND" ]; then
+ case $NETTYPE in
+ o2ib*) LNETLND="o2iblnd/ko2iblnd" ;;
+ tcp*) LNETLND="socklnd/ksocklnd" ;;
+ *) local lnd="${NETTYPE%%[0-9]}lnd"
+ [ -f "$LNDPATH/$lnd/k$lnd.ko" ] &&
+ LNETLND="$lnd/k$lnd" ||
+ LNETLND="socklnd/ksocklnd"
+ esac
+ fi
load_module ../lnet/klnds/$LNETLND
load_module obdclass/obdclass
load_module ptlrpc/ptlrpc
clients_up || error "post-failover stat: $?"
}
-do_lmc() {
- echo There is no lmc. This is mountconf, baby.
- exit 1
-}
-
host_nids_address() {
- local nodes=$1
- local kind=$2
+ local nodes=$1
+ local net=${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
+ do_nodes $nodes "$LCTL list_nids | grep $net | cut -f 1 -d @"
}
h2name_or_ip() {
fi
}
-h2ptl() {
- if [ "$1" = "'*'" ]; then echo \'*\'; else
- ID=`xtprocadmin -n $1 2>/dev/null | egrep -v 'NID' | \
- awk '{print $1}'`
- if [ -z "$ID" ]; then
- echo "Could not get a ptl id for $1..."
- exit 1
- fi
- echo $ID"@ptl"
+h2nettype() {
+ if [[ -v NETTYPE ]]; then
+ h2name_or_ip "$1" "$NETTYPE"
+ else
+ h2name_or_ip "$1" "$2"
fi
}
-declare -fx h2ptl
+declare -fx h2nettype
+# Wrapper function to print the deprecation warning
h2tcp() {
- h2name_or_ip "$1" "tcp"
-}
-declare -fx h2tcp
-
-h2elan() {
- if [ "$1" = "'*'" ]; then echo \'*\'; else
- if type __h2elan >/dev/null 2>&1; then
- ID=$(__h2elan $1)
- else
- ID=`echo $1 | sed 's/[^0-9]*//g'`
- fi
- echo $ID"@elan"
+ echo "h2tcp: deprecated, use h2nettype instead" 1>&2
+ if [[ -v NETTYPE ]]; then
+ h2nettype "$@"
+ else
+ h2nettype "$1" "tcp"
fi
}
-declare -fx h2elan
+# Wrapper function to print the deprecation warning
h2o2ib() {
- h2name_or_ip "$1" "o2ib"
+ echo "h2o2ib: deprecated, use h2nettype instead" 1>&2
+ if [[ -v NETTYPE ]]; then
+ h2nettype "$@"
+ else
+ h2nettype "$1" "o2ib"
+ fi
}
-declare -fx h2o2ib
# This enables variables in cfg/"setup".sh files to support the pdsh HOSTLIST
# expressions format. As a bonus we can then just pass in those variables
var=${facet}failover_HOST
if [ -n "${!var}" ] && [ ${!var} != $(facet_host $facet) ]; then
- opts+=" --failnode=$(h2$NETTYPE ${!var})"
+ opts+=" --failnode=$(h2nettype ${!var})"
fi
opts+=${TIMEOUT:+" --param=sys.timeout=$TIMEOUT"}
return 0
fi
- local myMGS_host=$mgs_HOST
- if [ "$NETTYPE" = "ptl" ]; then
- myMGS_host=$(h2ptl $mgs_HOST | sed -e s/@ptl//)
- fi
-
echo Checking config lustre mounted on $mntpt
local mgshost=$(mount | grep " $mntpt " | awk -F@ '{print $1}')
mgshost=$(echo $mgshost | awk -F: '{print $1}')
-# if [ "$mgshost" != "$myMGS_host" ]; then
-# log "Bad config file: lustre is mounted with mgs $mgshost, but mgs_HOST=$mgs_HOST, NETTYPE=$NETTYPE
-# Please use correct config or set mds_HOST correctly!"
-# fi
-
}
check_config_clients () {