Whamcloud - gitweb
b=15253 fix conf-sanity 30b for non-tcp networks
authorNathan Rutman <nathan.rutman@oracle.com>
Thu, 10 Jun 2010 23:16:57 +0000 (16:16 -0700)
committerJohann Lombardi <johann@sun.com>
Mon, 14 Jun 2010 11:45:39 +0000 (13:45 +0200)
lustre/tests/conf-sanity.sh

index 883f2a9..19bd80b 100644 (file)
@@ -1091,8 +1091,16 @@ run_test 30a "Big config llog and conf_param deletion"
 test_30b() {
        setup
 
-       NEW="1.2.3.4@tcp"
-       TEST="lctl get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
+       # Make a fake nid.  Use the OST nid, and add 20 to the least significant
+       # numerical part of it. Hopefully that's not already a failover address for
+       # the server.
+       OSTNID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
+       ORIGVAL=$(echo $OSTNID | egrep -oi "[0-9]*@")
+       NEWVAL=$((($(echo $ORIGVAL | egrep -oi "[0-9]*") + 20) % 256))
+       NEW=$(echo $OSTNID | sed "s/$ORIGVAL/$NEWVAL@/")
+       echo "Using fake nid $NEW"
+
+       TEST="$LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
        set_and_check client "$TEST" "$FSNAME-OST0000.failover.node" $NEW || error "didn't add failover nid $NEW"
        NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
        echo $NIDS