Whamcloud - gitweb
LU-2200 obdclass: be more careful processing server name
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 5924489..c14debe 100644 (file)
@@ -1325,11 +1325,6 @@ t32_check() {
                exit 0
        fi
 
-       if [ -n "$($LCTL list_nids | grep -v '\(tcp\|lo\)[[:digit:]]*$')" ]; then
-               skip "LU-2200: Test cannot run over Infiniband"
-               exit 0
-       fi
-
        local IMGTYPE=$(facet_fstype $SINGLEMDS)
 
        tarballs=$($r find $RLUSTRE/tests -maxdepth 1 -name \'disk*-$IMGTYPE.tar.bz2\')
@@ -1550,6 +1545,20 @@ t32_test() {
                        }
                fi
        else
+               if [ -n "$($LCTL list_nids | grep -v '\(tcp\|lo\)[[:digit:]]*$')" ]; then
+                       [[ $(lustre_version_code mgs) -ge $(version_code 2.3.59) ]] ||
+                       { skip "LU-2200: Cannot run over Inifiniband w/o lctl replace_nids "
+                               "(Need MGS version at least 2.3.59)"; return 0; }
+
+                       local osthost=$(facet_active_host ost1)
+                       local ostnid=$(do_node $osthost $LCTL list_nids | head -1)
+
+                       $r mount -t lustre -o loop,nosvc $tmp/mdt $tmp/mnt/mdt
+                       $r lctl replace_nids $fsname-OST0000 $ostnid
+                       $r lctl replace_nids $fsname-MDT0000 $nid
+                       $r umount $tmp/mnt/mdt
+               fi
+
                mopts=loop,exclude=$fsname-OST0000
        fi
 
@@ -1760,8 +1769,8 @@ t32_test() {
                        # on an architecture with different number of bits per
                        # "long".
                        #
-                       if [ $(t32_bits_per_long $(uname -m)) !=                                                \
-                                $(t32_bits_per_long $img_arch) ]; then
+                       if [ $(t32_bits_per_long $(uname -m)) != \
+                               $(t32_bits_per_long $img_arch) ]; then
                                echo "Different number of bits per \"long\" from the disk image"
                                for list in list.orig list; do
                                        sed -i -e 's/^[0-9]\+[ \t]\+//' $tmp/$list
@@ -1834,7 +1843,7 @@ t32_test() {
                        error_noexit "tunefs.lustre before remounting the MDT"
                        return 1
                }
-               $r mount -t lustre -o loop,exclude=$fsname-OST0000 $tmp/mdt                     \
+               $r mount -t lustre -o loop,exclude=$fsname-OST0000 $tmp/mdt \
                                 $tmp/mnt/mdt || {
                        error_noexit "Remounting the MDT"
                        return 1
@@ -1850,7 +1859,7 @@ test_32a() {
 
        t32_check
        for tarball in $tarballs; do
-               t32_test $tarball || rc=$?
+               t32_test $tarball || let "rc += $?"
        done
        return $rc
 }
@@ -1863,7 +1872,7 @@ test_32b() {
 
        t32_check
        for tarball in $tarballs; do
-               t32_test $tarball writeconf || rc=$?
+               t32_test $tarball writeconf || let "rc += $?"
        done
        return $rc
 }