From b91d5d4263951ee831b6a73761781d924f2a942d Mon Sep 17 00:00:00 2001 From: Nathan Rutman Date: Thu, 10 Jun 2010 16:30:17 -0700 Subject: [PATCH] b=15253 fix conf-sanity 30b for non-tcp networks i=rread (also sync test with b18 version) --- lustre/tests/conf-sanity.sh | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 9c25930..9ea4428 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -958,18 +958,31 @@ 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-????????*/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 + NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1)) + echo "should have 2 failover nids: $NIDCOUNT" + [ $NIDCOUNT -eq 2 ] || error "Failover nid not added" do_facet mgs "$LCTL conf_param -d $FSNAME-OST0000.failover.node" || error "conf_param delete failed" umount_client $MOUNT mount_client $MOUNT || return 3 - NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-????????*/import | grep failover_nids) - NIDCOUNT=$(echo "$NIDS" | wc -w) - echo "only 1 final nid should remain: $NIDS" - [ $NIDCOUNT -eq 2 ] || fail "Failover nids not removed" - pass + NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids) + echo $NIDS + NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1)) + echo "only 1 final nid should remain: $NIDCOUNT" + [ $NIDCOUNT -eq 1 ] || error "Failover nids not removed" cleanup } -- 1.8.3.1