Whamcloud - gitweb
- minor further changes to the test script:
authorbraam <braam>
Mon, 22 Apr 2002 17:34:25 +0000 (17:34 +0000)
committerbraam <braam>
Mon, 22 Apr 2002 17:34:25 +0000 (17:34 +0000)
 - add a fail function to common.sh to notify user that umount failed

- give all attaches a name.
- clean up llmountcleanup.sh with name2dev
- remove debugging printouts from obdctl

16 files changed:
lustre/tests/common.sh
lustre/tests/fs.sh
lustre/tests/lldlm.sh
lustre/tests/llecho.sh
lustre/tests/llext3.sh
lustre/tests/lllocalmount.sh
lustre/tests/llmount-client.sh
lustre/tests/llmount-server.sh
lustre/tests/llmount.sh
lustre/tests/llmountcleanup.sh
lustre/tests/llrext3.sh
lustre/tests/llrmount.sh
lustre/tests/mdcreq.sh
lustre/tests/ostreq.sh
lustre/tests/runfailure-net
lustre/utils/obdctl.c

index 57fea7d..4245861 100644 (file)
@@ -217,7 +217,7 @@ setup_mds() {
        
        $OBDCTL <<- EOF
        device ${MDS_DEVNO}
-       attach mds
+       attach mds MDSDEV
        setup ${MDS} ${MDSFS}
        quit
        EOF
@@ -268,10 +268,10 @@ setup_ost() {
 
        $OBDCTL <<- EOF
        device ${OBD_DEVNO}
-       attach ${OSTTYPE}
+       attach ${OSTTYPE} OSTDEV
        setup ${OBD} ${OBDARG}
        device ${OST_DEVNO}
-       attach ost
+       attach ost OSTDEV
        setup ${OBD_DEVNO}
        quit
        EOF
@@ -287,7 +287,7 @@ setup_osc() {
        OSC_DEVNO=$DEVNO; DEVNO=`expr $DEVNO + 1`
        $OBDCTL <<- EOF || return $rc
        device ${OSC_DEVNO}
-       attach osc
+       attach osc OSCDEV
        setup -1
        quit
        EOF
@@ -452,3 +452,8 @@ cleanup_client() {
        cleanup_mount && cleanup_osc
        DEVNO=0
 }
+
+fail() { 
+    echo $1
+    exit 1
+}
index 1db9a94..736258f 100644 (file)
@@ -18,7 +18,7 @@ mknod /dev/obd c 10 241
 
 $R/usr/src/obd/utils/obdctl <<EOF
 device 0
-attach obdext2
+attach obdext2 OBDEXT2DEV
 setup /dev/loop/0
 quit
 EOF
index 3cf5b4a..78b1bbc 100755 (executable)
@@ -13,7 +13,7 @@ setup_lustre
 
 $OBDCTL <<EOF
 device 0
-attach ldlm
+attach ldlm LDLMDEV
 setup
 test_ldlm
 quit
index 9a18574..f451e4c 100644 (file)
@@ -13,13 +13,13 @@ setup_lustre
 
 $OBDCTL <<EOF
 device 0
-attach obdecho
+attach obdecho ECHODEV
 setup
 device 1
-attach ost
+attach ost OSTDEV
 setup 0
 device 2
-attach osc
+attach osc OSCDEV
 setup -1
 quit
 EOF
index fad08b6..5d2444b 100755 (executable)
@@ -21,19 +21,19 @@ echo 0xffffffff > /proc/sys/portals/debug
 
 $OBDCTL <<EOF
 device 0
-attach mds
+attach mds MDSDEV
 setup ${MDS} ${MDSFS}
 device 1
-attach obdext2
+attach obdext2 OBDEXT2DEV
 setup ${OST}
 device 2
-attach ost
+attach ost OSTDEV
 setup 1
 device 3
-attach osc
+attach osc OSCDEV
 setup -1
 device 4
-attach ptlrpc
+attach ptlrpc RPCDEV
 setup
 quit
 EOF
index 4c62233..b4300a9 100755 (executable)
@@ -22,16 +22,16 @@ echo 0xffffffff > /proc/sys/portals/debug
 
 $OBDCTL <<EOF
 device 0
-attach mds
+attach mds MDSDEV
 setup ${MDS} ${MDSFS}
 device 1
-attach obdext2
+attach obdext2 OBDEXT2DEV
 setup ${OST}
 device 2
-attach ost
+attach ost OSTDEV
 setup 1
 device 3
-attach osc
+attach osc OSCDEV
 setup 2
 quit
 EOF
index 67c7f0c..7c90e9e 100644 (file)
@@ -14,13 +14,13 @@ setup_lustre
 
 $OBDCTL <<EOF
 device 0
-attach ptlrpc
+attach ptlrpc RPCDEV
 setup
 device 1
-attach ldlm
+attach ldlm LDLMDEV
 setup
 device 2
-attach osc
+attach osc OSCDEV
 setup -1
 quit
 EOF
index 9b92636..f55ad8a 100644 (file)
@@ -21,19 +21,19 @@ MDS=${LOOPDEV}
 
 $OBDCTL <<EOF
 device 0
-attach mds
+attach mds MDSDEV
 setup ${MDS} ${MDSFS}
 device 1
-attach obdext2
+attach obdext2 OBDEXT2DEV
 setup ${OST}
 device 2
-attach ost
+attach ost OSTDEV
 setup 1
 device 3
-attach ptlrpc
+attach ptlrpc RPCDEV
 setup
 device 4
-attach ldlm
+attach ldlm LDLMDEV
 setup
 quit
 EOF
index 7fcd68b..6c89930 100755 (executable)
@@ -10,6 +10,7 @@ PORT=1234
 
 setup_portals
 setup_lustre
+echo -n "Hit return to continue..."
 read
 
 new_fs ext2 /tmp/ost 10000
@@ -22,24 +23,24 @@ echo 0xffffffff > /proc/sys/portals/debug
 
 $OBDCTL <<EOF
 device 0
-attach mds
+attach mds MDSDEV
 setup ${MDS} ${MDSFS}
 device 1
-attach obdfilter
+attach obdfilter FILTERDEV
 setup ${OST} ext2
 device 2
-attach ost
+attach ost OSTDEV
 setup 1
 device 3
-attach ptlrpc
+attach ptlrpc RPCDEV
 setup
 device 4
-attach ldlm
+attach ldlm LDLMDEV
 setup
 device 5
-attach osc
+attach osc OSCDEV
 setup -1
 quit
 EOF
 
-mount -t lustre_lite -o device=5 none /mnt/lustre
+mount -t lustre_lite -o device=`$OBDCTL name2dev OSCDEV` none /mnt/lustre
index aa8f8b1..caa07d3 100755 (executable)
@@ -3,29 +3,29 @@
 SRCDIR="`dirname $0`"
 . $SRCDIR/common.sh
 
-umount /mnt/lustre
+umount /mnt/lustre || fail "cannot unmount"
 
 killall acceptor
 rmmod llite
 rmmod mdc
 
 $OBDCTL <<EOF
-device 5
+name2dev OSCDEV
 cleanup
 detach
-device 4
+name2dev LDLMDEV
 cleanup
 detach
-device 3
+name2dev RPCDEV
 cleanup
 detach
-device 2
+name2dev OSTDEV
 cleanup
 detach
-device 1
+name2dev FILTERDEV
 cleanup
 detach
-device 0
+name2dev MDSDEV
 cleanup
 detach
 quit
index 443679c..c901e01 100755 (executable)
@@ -21,19 +21,19 @@ echo 0xffffffff > /proc/sys/portals/debug
 
 $OBDCTL <<EOF
 device 0
-attach mds
+attach mds MDSDEV
 setup ${MDS} ${MDSFS}
 device 1
-attach obdext2
+attach obdext2 OBDEXT2DEV
 setup ${OST}
 device 2
-attach ost
+attach ost OSTDEV
 setup 1
 device 3
-attach osc
+attach osc OSCDEV
 setup -1
 device 4
-attach ptlrpc
+attach ptlrpc RPCDEV
 setup
 quit
 EOF
index 4dbd546..6e2da11 100755 (executable)
@@ -21,22 +21,22 @@ echo 0xffffffff > /proc/sys/portals/debug
 
 $OBDCTL <<EOF
 device 0
-attach mds
+attach mds MDSDEV
 setup ${MDS} ${MDSFS}
 device 1
-attach obdext2
+attach obdext2 OBDEXT2DEV
 setup ${OST}
 device 2
-attach ost
+attach ost OSTDEV
 setup 1
 device 3
-attach ptlrpc
+attach ptlrpc RPCDEV
 setup
 device 4
-attach ldlm
+attach ldlm LDLMDEV
 setup
 device 5
-attach osc
+attach osc OSCDEV
 setup -1
 quit
 EOF
index e3cba0d..b627f12 100644 (file)
@@ -19,7 +19,7 @@ echo 0xffffffff > /proc/sys/portals/debug
 
 $OBDCTL <<EOF
 device 0
-attach mds
+attach mds MDSDEV
 setup ${MDS} ${MDSFS}
 quit
 EOF
index 658e100..d84bc43 100644 (file)
@@ -24,13 +24,13 @@ OBD=${LOOPDEV}
 
 $OBDCTL <<EOF
 device 0
-attach obdext2
+attach obdext2 OBDEXT2DEV
 setup ${OBD}
 device 1
-attach ost
+attach ost OSTDEV
 setup 0
 device 2
-attach osc
+attach osc OSCDEV
 setup -1
 quit
 EOF
index a902bdf..1442f23 100755 (executable)
@@ -2,6 +2,9 @@
 
 set -vx
 
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
+
 test_fail() {
        echo $1 > /proc/sys/lustre/fail_loc
        shift
@@ -11,7 +14,7 @@ test_fail() {
 
         echo 0 > /proc/sys/lustre/fail_loc
         umount /mnt/lustre || exit 1
-        mount -t lustre_lite -o device=5 none /mnt/lustre || exit 1
+        mount -t lustre_lite -o device=`$OBDCTL name2dev OSCDEV` none /mnt/lustre || exit 1
 }
 
 [ -c /dev/request ] || mknod /dev/request c 10 244
index b59e28d..b9f1289 100644 (file)
@@ -451,17 +451,10 @@ static int jt_attach(int argc, char **argv)
                 data.ioc_inlbuf2 = argv[2];
         }
 
-        printf("%s: len %d addr %p type %s data %s\n",
-               cmdname(argv[0]), data.ioc_len, buf,
-               MKSTR(data.ioc_inlbuf1), MKSTR(data.ioc_inlbuf2));
-
         if (obd_ioctl_pack(&data, &buf, max)) {
                 fprintf(stderr, "error: %s: invalid ioctl\n", cmdname(argv[0]));
                 return -2;
         }
-        printf("%s: len %d addr %p raw %p type %s data %s and %s\n",
-               cmdname(argv[0]), data.ioc_len, buf, rawbuf,
-               MKSTR(data.ioc_inlbuf1), MKSTR(data.ioc_inlbuf2), &buf[516]);
 
         rc = ioctl(fd, OBD_IOC_ATTACH , buf);
         if (rc < 0)
@@ -545,18 +538,10 @@ static int jt_setup(int argc, char **argv)
                 data.ioc_inlbuf2 = argv[2];
         }
 
-        printf("%s: len %d addr %p device %s type %s\n",
-               cmdname(argv[0]), data.ioc_len, buf,
-               MKSTR(data.ioc_inlbuf1), MKSTR(data.ioc_inlbuf2));
-
         if (obd_ioctl_pack(&data, &buf, max)) {
                 fprintf(stderr, "error: %s: invalid ioctl\n", cmdname(argv[0]));
                 return -2;
         }
-        printf("%s: len %d addr %p raw %p device %s type %s\n",
-               cmdname(argv[0]), data.ioc_len, buf, rawbuf,
-               MKSTR(data.ioc_inlbuf1), MKSTR(data.ioc_inlbuf2));
-
         rc = ioctl(fd, OBD_IOC_SETUP , buf);
         if (rc < 0)
                 fprintf(stderr, "error: %s: %s\n", cmdname(argv[0]),