From 649f0b1ffee6dbb72befff4592da13a9a8d69e4c Mon Sep 17 00:00:00 2001
From: shaver <shaver>
Date: Mon, 26 Jan 2004 23:38:28 +0000
Subject: [PATCH] b=2605: fix conf-sanity test 9 (--ptldebug/--subsystem in lmc
 and lconf) r=ccooper

---
 lustre/tests/conf-sanity.sh    | 43 +++++++++++++++++++++++++---------
 lustre/tests/test-framework.sh |  6 ++---
 2 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh
index f6f77db1a1..2b2e1efdf9 100644
--- a/lustre/tests/conf-sanity.sh
+++ b/lustre/tests/conf-sanity.sh
@@ -226,25 +226,45 @@ test_9() {
         start_ost
         start_mds
         mount_client $MOUNT
-        [ "`cat /proc/sys/portals/debug`" = "1" ] && \
-           echo "lmc --debug success" || return 1
-        [ "`cat /proc/sys/portals/subsystem_debug`" = "16777216" ] && \
-           echo "lmc --subsystem success" || return 1
+        CHECK_PTLDEBUG="`cat /proc/sys/portals/debug`"
+        if [ $CHECK_PTLDEBUG = "1" ]; then
+           echo "lmc --debug success"
+        else
+           echo "lmc --debug: want 1, have $CHECK_PTLDEBUG"
+           return 1
+        fi
+        CHECK_SUBSYSTEM="`cat /proc/sys/portals/subsystem_debug`"
+        if [ $CHECK_SUBSYSTEM = "2" ]; then
+           echo "lmc --subsystem success"
+        else
+           echo "lmc --subsystem: want 2, have $CHECK_SUBSYSTEM"
+           return 1
+        fi
         check_mount || return 41
         cleanup
 
         # the new PTLDEBUG/SUBSYSTEM used for lconf --ptldebug/subsystem
-        PTLDEBUG="inode"
-        SUBSYSTEM="mds"
+        PTLDEBUG="inode+trace"
+        SUBSYSTEM="mds+ost"
 
         # check lconf --ptldebug/subsystem overriding lmc --ptldebug/subsystem
         start_ost
         start_mds
+        CHECK_PTLDEBUG="`do_facet mds cat /proc/sys/portals/debug`"
+        if [ $CHECK_PTLDEBUG = "3" ]; then
+           echo "lconf --debug success"
+        else
+           echo "lconf --debug: want 3, have $CHECK_PTLDEBUG"
+           return 1
+        fi
+        CHECK_SUBSYSTEM="`do_facet mds cat /proc/sys/portals/subsystem_debug`"
+        if [ $CHECK_SUBSYSTEM = "20" ]; then
+           echo "lconf --subsystem success"
+        else
+           echo "lconf --subsystem: want 20, have $CHECK_SUBSYSTEM"
+           return 1
+        fi
         mount_client $MOUNT
-        [ "`cat /proc/sys/portals/debug`" = "2" ] && \
-           echo "lconf --debug overriding success" || return 1
-        [ "`cat /proc/sys/portals/subsystem_debug`" = "33554432" ] && \
-           echo "lconf --subsystem overriding success" || return 1
         check_mount || return 41
         cleanup
 
@@ -253,7 +273,8 @@ test_9() {
         SUBSYSTEM=$OLDSUBSYSTEM
         gen_config
 }
-run_test 9 "test --ptldebug and --subsystem for lmc"
+
+run_test 9 "test --ptldebug and --subsystem for lmc and lconf"
 
 test_10() {
         OLDXMLCONFIG=$XMLCONFIG
diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh
index 9c6586839f..f4678ebfb2 100644
--- a/lustre/tests/test-framework.sh
+++ b/lustre/tests/test-framework.sh
@@ -270,7 +270,8 @@ add_facet() {
     local facet=$1
     shift
     echo "add facet $facet: `facet_host $facet`"
-    do_lmc --add node --node ${facet}_facet $@ --timeout $TIMEOUT
+    do_lmc --add node --node ${facet}_facet $@ --timeout $TIMEOUT \
+        --lustre_upcall $UPCALL --ptldebug $PTLDEBUG --subsystem $SUBSYSTEM
     do_lmc --add net --node ${facet}_facet --nid `facet_nid $facet` \
 	--nettype $NETTYPE
 }
@@ -279,8 +280,7 @@ add_mds() {
     facet=$1
     shift
     rm -f ${facet}active
-    add_facet $facet  --lustre_upcall $UPCALL --ptldebug $PTLDEBUG \
-        --subsystem $SUBSYSTEM
+    add_facet $facet
     do_lmc --add mds --node ${facet}_facet --mds ${facet}_svc $*
 }
 
-- 
GitLab