Whamcloud - gitweb
b=1792
authorwangchao <wangchao>
Tue, 13 Jan 2004 06:27:26 +0000 (06:27 +0000)
committerwangchao <wangchao>
Tue, 13 Jan 2004 06:27:26 +0000 (06:27 +0000)
r=phil

add a sanity test case to test iopen_connect_dentry

lustre/tests/iopentest2.c
lustre/tests/sanity.sh

index 6f95f95..97a7d89 100644 (file)
@@ -66,6 +66,7 @@ int main(int argc, char *argv[])
         char *fname_iname, *dir;
         char *dir_iname = NULL, *foo = NULL, *bar = NULL;
         int rc, fd, i, thread = 0;
+        int pidlist[10];
 
         pname = strdup(argv[0]);
         progname = basename(argv[0]);
@@ -86,6 +87,7 @@ int main(int argc, char *argv[])
                         break;
                 }
                 printf("%s: thread #%d (PID %d) started\n", argv[0], i, rc);
+                pidlist[i-1] = rc;
                 rc = 0;
         }
 
@@ -175,6 +177,9 @@ int main(int argc, char *argv[])
 
                         free(dir_iname);
                 }
+        } else {
+                        for ( i=0; i<10; i++)
+                                waitpid(pidlist[i], NULL, 0);
         }
         return 0;
 }
index 5193f97..76359dc 100644 (file)
@@ -168,6 +168,10 @@ EXT2_DEV=${EXT2_DEV:-/tmp/SANITY.LOOP}
 touch $EXT2_DEV
 mke2fs -F $EXT2_DEV 1000 > /dev/null
 
+EXT3_DEV=${EXT3_DEV:-/tmp/SANITY_EXT3_DEV.LOOP}
+touch $EXT3_DEV
+mkfs.ext3 -F $EXT3_DEV 10000 > /dev/null
+
 test_0() {
        touch $DIR/f
        $CHECKSTAT -t file $DIR/f || error
@@ -1537,6 +1541,19 @@ test_54() {
 }
 run_test 54 "unix damain socket test ==========================="
 
+test_55() {
+        rm -rf $DIR/d55
+        mkdir $DIR/d55
+        mount -t ext3 -o loop,iopen $EXT3_DEV $DIR/d55 || error
+        touch $DIR/d55/foo
+        $IOPENTEST1 $DIR/d55/foo $DIR/d55 || error
+        $IOPENTEST2 $DIR/d55 || error
+        echo "check for $EXT3_DEV. Please wait..."
+        rm -rf $DIR/d55/*
+        umount $DIR/d55 || error
+}
+run_test 55 "check iopen_connect_dentry()======================="
+
 test_59() {
        echo "touch 130 files"
        for i in `seq 1 130` ; do