Whamcloud - gitweb
LU-864 test: Hostname name doesn't equal NID and use facet_mntpt
authorJames Simmons <uja.ornl@gmail.com>
Mon, 28 Nov 2011 14:26:41 +0000 (09:26 -0500)
committerOleg Drokin <green@whamcloud.com>
Mon, 12 Dec 2011 21:31:10 +0000 (16:31 -0500)
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>
lustre/tests/conf-sanity.sh
lustre/tests/lnet-selftest.sh
lustre/tests/obdfilter-survey.sh
lustre/tests/sanity.sh
lustre/tests/test-framework.sh

index fc6ec98..15e81ee 100644 (file)
@@ -2418,7 +2418,7 @@ test_52() {
        [ $? -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
 
index 06d3b57..860aa92 100755 (executable)
@@ -4,6 +4,7 @@ LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
 . $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}
+init_logging
 
 #
 ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT"
 
 #
 ALWAYS_EXCEPT="$ALWAYS_EXCEPT $LNET_SELFTEST_EXCEPT"
@@ -25,8 +26,9 @@ if [ "$SLOW" = no ]; then
     [ $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
index 1e1284b..ea1af2e 100644 (file)
@@ -36,14 +36,16 @@ fi
 get_targets () {
         local targets
         local devs
 get_targets () {
         local targets
         local devs
+        local nid
         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
@@ -58,7 +60,7 @@ obdflter_survey_targets () {
        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
index e992507..c50b040 100644 (file)
@@ -1353,8 +1353,7 @@ check_seq_oid()
                 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 ||
@@ -1374,7 +1373,7 @@ check_seq_oid()
                 [ $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
 }
@@ -8225,12 +8224,15 @@ run_test 216 "check lockless direct write works and updates file size and kms co
 
 test_217() { # bug 22430
        local node
 
 test_217() { # bug 22430
        local node
+       local nid
+
        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
                else
                else
-                       echo "skipping $node (no hiphen detected)"
+                       echo "skipping $node (no hyphen detected)"
                fi
        done
 }
                fi
        done
 }
index aacc64b..0e5fa31 100644 (file)
@@ -1615,6 +1615,18 @@ do_lmc() {
     exit 1
 }
 
     exit 1
 }
 
+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"
@@ -4590,7 +4602,7 @@ remove_mdt_files() {
     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 $?
@@ -4607,7 +4619,7 @@ duplicate_mdt_files() {
     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 $?