Whamcloud - gitweb
New scripts to aid in testing; on one machine you should be able to run
authorpschwan <pschwan>
Thu, 7 Feb 2002 21:24:33 +0000 (21:24 +0000)
committerpschwan <pschwan>
Thu, 7 Feb 2002 21:24:33 +0000 (21:24 +0000)
sh tests/llmount-server.sh

and on another machine:

sh tests/llmount-client.sh
mount -t lustre_light -o device=3 none /mnt/obd

and do things like:

ls -ld /mnt/obd
chmod 777 /mnt/obd

This works now--even over the socknal, on an SMP kernel (although I haven't
tested it on an SMP machine)

You'll need to edit the SERVER variable in llmount-client.sh.  If you want
to get really fancy, you'll make it a command-line option.

lustre/tests/common.sh [new file with mode: 0644]
lustre/tests/lllocalmount.sh
lustre/tests/llmount-client.sh [new file with mode: 0644]
lustre/tests/llmount-server.sh [new file with mode: 0644]
lustre/tests/llmount.sh
lustre/tests/llmountcleanup.sh
lustre/tests/mdcreq.sh
lustre/tests/mdcreqcleanup.sh

diff --git a/lustre/tests/common.sh b/lustre/tests/common.sh
new file mode 100644 (file)
index 0000000..ba676ad
--- /dev/null
@@ -0,0 +1,14 @@
+if [ -d /r ]; then
+  R=/r
+fi
+
+if [ -b /dev/loop0 ]; then
+  LOOP=/dev/loop
+else
+  if [ -b /dev/loop/0 ]; then
+    LOOP=/dev/loop/
+  else
+    echo "Cannot find /dev/loop0 or /dev/loop/0";
+    exit -1
+  fi
+fi
index d562351..35066cf 100755 (executable)
@@ -1,14 +1,7 @@
 #!/bin/sh
 
-#R=/r
-LOOP0=/dev/loop0
-LOOP1=/dev/loop1
-
-if [ ! -e $LOOP0 ]; then
-    echo $LOOP0 doesnt exist: not using devfs? 
-    exit
-fi
-
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
 
 mknod /dev/portals c 10 240
 
@@ -28,11 +21,11 @@ insmod $R/usr/src/obd/llight/llight.o
 
 dd if=/dev/zero of=/tmp/ost bs=1024 count=10000
 mke2fs -b 4096 -F /tmp/ost
-losetup $LOOP0 /tmp/ost
+losetup ${LOOP}0 /tmp/ost
 
 dd if=/dev/zero of=/tmp/mds bs=1024 count=10000
 mke2fs -b 4096 -F /tmp/mds
-losetup $LOOP1 /tmp/mds
+losetup ${LOOP}1 /tmp/mds
 
 mknod /dev/obd c 10 241
 echo 8291 > /proc/sys/obd/debug
@@ -41,10 +34,10 @@ echo 8291 > /proc/sys/obd/trace
 $R/usr/src/obd/utils/obdctl <<EOF
 device 0
 attach mds
-setup $LOOP1 ext2
+setup ${LOOP}1 ext2
 device 1
 attach obdext2
-setup $LOOP0
+setup ${LOOP}0
 device 2
 attach ost
 setup 1
diff --git a/lustre/tests/llmount-client.sh b/lustre/tests/llmount-client.sh
new file mode 100644 (file)
index 0000000..aafc15a
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
+
+SERVER=compila
+
+mknod /dev/portals c 10 240
+
+insmod $R/usr/src/portals/linux/oslib/portals.o
+insmod $R/usr/src/portals/linux/socknal/ksocknal.o
+
+$R/usr/src/portals/linux/utils/ptlctl <<EOF
+mynid
+setup tcp
+connect $SERVER 1234
+add_uuid self
+add_uuid mds
+EOF
+
+insmod $R/usr/src/obd/rpc/ptlrpc.o
+insmod $R/usr/src/obd/class/obdclass.o 
+insmod $R/usr/src/obd/ext2obd/obdext2.o
+insmod $R/usr/src/obd/ost/ost.o
+insmod $R/usr/src/obd/osc/osc.o
+insmod $R/usr/src/obd/mds/mds.o
+insmod $R/usr/src/obd/mdc/mdc.o
+insmod $R/usr/src/obd/llight/llight.o
+
+dd if=/dev/zero of=/tmp/ost bs=1024 count=10000
+mke2fs -b 4096 -F /tmp/ost
+losetup ${LOOP}0 /tmp/ost
+
+mknod /dev/obd c 10 241
+
+$R/usr/src/obd/utils/obdctl <<EOF
+device 1
+attach obdext2
+setup ${LOOP}0
+device 2
+attach ost
+setup 1
+device 3
+attach osc
+setup 2
+quit
+EOF
+
+mkdir /mnt/obd
+# mount -t lustre_light -o device=3 none /mnt/obd
diff --git a/lustre/tests/llmount-server.sh b/lustre/tests/llmount-server.sh
new file mode 100644 (file)
index 0000000..c1439dd
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
+
+mknod /dev/portals c 10 240
+
+insmod $R/usr/src/portals/linux/oslib/portals.o
+insmod $R/usr/src/portals/linux/socknal/ksocknal.o
+
+$R/usr/src/portals/linux/utils/acceptor 1234 &
+
+$R/usr/src/portals/linux/utils/ptlctl <<EOF
+mynid
+setup tcp
+add_uuid self
+EOF
+
+insmod $R/usr/src/obd/rpc/ptlrpc.o
+insmod $R/usr/src/obd/class/obdclass.o 
+insmod $R/usr/src/obd/ext2obd/obdext2.o
+insmod $R/usr/src/obd/ost/ost.o
+insmod $R/usr/src/obd/mds/mds.o
+
+dd if=/dev/zero of=/tmp/ost bs=1024 count=10000
+mke2fs -b 4096 -F /tmp/ost
+losetup ${LOOP}0 /tmp/ost
+
+dd if=/dev/zero of=/tmp/mds bs=1024 count=10000
+mke2fs -b 4096 -F /tmp/mds
+losetup ${LOOP}1 /tmp/mds
+
+mknod /dev/obd c 10 241
+
+$R/usr/src/obd/utils/obdctl <<EOF
+device 0
+attach mds
+setup ${LOOP}1 ext2
+device 1
+attach obdext2
+setup ${LOOP}0
+device 2
+attach ost
+setup 1
+quit
+EOF
index dc3ee2a..154b7a7 100755 (executable)
@@ -1,12 +1,7 @@
 #!/bin/sh
 
-LOOP0=/dev/loop0
-LOOP1=/dev/loop1
-
-if [ ! -e $LOOP0 ]; then 
-    echo "$LOOP0 doesn't exist - check devfs"
-    exit 1
-fi
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
 
 mknod /dev/portals c 10 240
 
@@ -17,9 +12,10 @@ $R/usr/src/portals/linux/utils/acceptor 1234 &
 
 $R/usr/src/portals/linux/utils/ptlctl <<EOF
 mynid
-setup tcp localhost 1234
-connect self
-connect mds
+setup tcp
+connect localhost 1234
+add_uuid self
+add_uuid mds
 EOF
 
 insmod $R/usr/src/obd/rpc/ptlrpc.o
@@ -33,22 +29,23 @@ insmod $R/usr/src/obd/llight/llight.o
 
 dd if=/dev/zero of=/tmp/ost bs=1024 count=10000
 mke2fs -b 4096 -F /tmp/ost
-losetup $LOOP0 /tmp/ost
+losetup ${LOOP}0 /tmp/ost
 
 dd if=/dev/zero of=/tmp/mds bs=1024 count=10000
 mke2fs -b 4096 -F /tmp/mds
-losetup $LOOP1 /tmp/mds
+losetup ${LOOP}1 /tmp/mds
 
 mknod /dev/obd c 10 241
 echo 8291 > /proc/sys/obd/debug
 echo 8291 > /proc/sys/obd/trace
+
 $R/usr/src/obd/utils/obdctl <<EOF
 device 0
 attach mds
-setup $LOOP1 ext2
+setup ${LOOP}1 ext2
 device 1
 attach obdext2
-setup $LOOP0
+setup ${LOOP}0
 device 2
 attach ost
 setup 1
index 81a5832..7621fba 100755 (executable)
@@ -1,17 +1,14 @@
 #!/bin/sh
-LOOP0=/dev/loop0
-LOOP1=/dev/loop1
 
-if [ ! -e $LOOP0 ]; then
-    echo $LOOP0 'doesnt exist: (not) using devfs?' 
-    exit
-fi
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
 
 umount /mnt/obd
 
 rmmod llight
 rmmod mdc
-/usr/src/obd/utils/obdctl <<EOF
+
+$R/usr/src/obd/utils/obdctl <<EOF
 device 3
 cleanup
 detach
@@ -26,20 +23,24 @@ cleanup
 detach
 quit
 EOF
+
 rmmod mds
 rmmod osc
 rmmod ost
 rmmod obdext2
 rmmod obdclass
 rmmod ptlrpc
-/usr/src/portals/linux/utils/ptlctl <<EOF
-setup tcp localhost 1234
-disconnect self
-disconnect mds
+
+$R/usr/src/portals/linux/utils/ptlctl <<EOF
+setup tcp
+disconnect localhost
+del_uuid self
+del_uuid mds
 EOF
+
 rmmod ksocknal
 killall acceptor
 rmmod portals
 
-losetup -d $LOOP0
-losetup -d $LOOP1
\ No newline at end of file
+losetup -d ${LOOP}0
+losetup -d ${LOOP}1
\ No newline at end of file
index 56b5bc6..47f2902 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
-R=/r
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
 
 mknod /dev/portals c 10 240
 
@@ -11,9 +12,10 @@ $R/usr/src/portals/linux/utils/acceptor 1234 &
 
 $R/usr/src/portals/linux/utils/ptlctl <<EOF
 mynid
-setup tcp localhost 1234
-connect self
-connect mds
+setup tcp
+connect localhost 1234
+add_uuid self
+add_uuid mds
 EOF
 
 insmod $R/usr/src/obd/rpc/ptlrpc.o
@@ -27,18 +29,16 @@ insmod $R/usr/src/obd/llight/llight.o
 
 dd if=/dev/zero of=/tmp/fs bs=1024 count=10000
 mke2fs -b 4096 -F /tmp/fs
-losetup /dev/loop/0 /tmp/fs
+losetup ${LOOP}0 /tmp/fs
 
 mknod /dev/obd c 10 241
 
 $R/usr/src/obd/utils/obdctl <<EOF
 device 0
 attach mds
-setup /dev/loop/0 ext2
+setup ${LOOP}0 ext2
 quit
 EOF
 
 mknod /dev/request c 10 244
-# $R/usr/src/obd/tests/testreq
-
-
+# $R/usr/src/obd/tests/testreq
\ No newline at end of file
index da87ece..5fbc70a 100755 (executable)
@@ -1,22 +1,34 @@
+#!/bin/sh
+
+SRCDIR="`dirname $0`"
+. $SRCDIR/common.sh
+
 rmmod llight
 rmmod mdc
-/usr/src/obd/utils/obdctl <<EOF
+
+$R/usr/src/obd/utils/obdctl <<EOF
 device 0
 cleanup
 detach
 quit
 EOF
+
 rmmod mds
 rmmod osc
 rmmod ost
 rmmod obdext2
 rmmod obdclass
 rmmod ptlrpc
-/usr/src/portals/linux/utils/ptlctl <<EOF
-setup tcp localhost 1234
-disconnect self
-disconnect mds
+
+$R/usr/src/portals/linux/utils/ptlctl <<EOF
+setup tcp
+disconnect localhost
+del_uuid self
+del_uuid mds
 EOF
+
+losetup -d ${LOOP}0
+
 killall acceptor
 rmmod ksocknal
 rmmod portals