QA test updates.
authorfsgqa <fsgqa>
Thu, 17 Jul 2003 23:06:11 +0000 (23:06 +0000)
committerfsgqa <fsgqa>
Thu, 17 Jul 2003 23:06:11 +0000 (23:06 +0000)
Fix location of fsstress and clamp the uid/gid range for chown so as to
limit memory requirements for xfs_db/check afterward.

013
common.config
common.rc
ltp/fsstress.c

diff --git a/013 b/013
index e5a8be8f11e99d79b6b34338afcd40852e84dd42..316dba008fd925d0115ee0a04435fa83f8a8395e 100755 (executable)
--- a/013
+++ b/013
@@ -86,7 +86,8 @@ _do_test()
     echo "fsstress.$_n : $_param"
     echo "-----------------------------------------------"
     # -v >$tmp.out
     echo "fsstress.$_n : $_param"
     echo "-----------------------------------------------"
     # -v >$tmp.out
-    if ! $here/src/fsstress $_param $FSSTRESS_AVOID -n $_count -d $out >/dev/null 2>&1
+    # -m limits number of users/groups so check doesn't fail (malloc) later
+    if ! $here/ltp/fsstress $_param $FSSTRESS_AVOID -m 8 -n $_count -d $out >/dev/null 2>&1
     then
         echo "    fsstress (count=$_count) returned $? - see $seq.full"
         
     then
         echo "    fsstress (count=$_count) returned $? - see $seq.full"
         
index 3202fff61e9a5a01ed55b0c29527d90c196d13a1..02c0908a3f1acb457c2a909ead7fc68a8b33a4b6 100644 (file)
@@ -89,7 +89,7 @@ in
        SCRATCH_DEV=/dev/sdb5
        SCRATCH_LOGDEV=/dev/sda11
        TEST_DIR=/mnt/xfs1
        SCRATCH_DEV=/dev/sdb5
        SCRATCH_LOGDEV=/dev/sda11
        TEST_DIR=/mnt/xfs1
-       TEST_DEV=/dev/sda10
+       TEST_DEV=/dev/sdc3
        TEST_LOGDEV=/dev/sda9
        TAPE_DEV=/dev/st0
        RMT_TAPE_DEV=bruce:/dev/st0
        TEST_LOGDEV=/dev/sda9
        TAPE_DEV=/dev/st0
        RMT_TAPE_DEV=bruce:/dev/st0
index 2dc706d888f77c714468d89be9783bc56ad8df4b..1ad7066034b580bcf673b4358ace13c00adcf73f 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -44,11 +44,7 @@ umask 022
 
 # awk
 AWK_PROG=awk
 
 # awk
 AWK_PROG=awk
-
-# extra parameters for fsstress
-FSSTRESS_AVOID=
-
-export AWK_PROG FSSTRESS_AVOID
+export AWK_PROG
 
 # we override mount and mkfs.xfs so we can specify extra options
 
 
 # we override mount and mkfs.xfs so we can specify extra options
 
@@ -667,7 +663,7 @@ then
         if ! _test_mount
         then
             echo "common.rc: retrying test device mount with external set"
         if ! _test_mount
         then
             echo "common.rc: retrying test device mount with external set"
-            [ "$USE_EXTERNAL" != "yes" ] && USE_EXTERNAL=yes
+            [ "$USE_EXTERNAL" != "yes" ] && export USE_EXTERNAL=yes
             if ! _test_mount
             then
                 echo "common.rc: could not mount $TEST_DEV on $TEST_DIR"
             if ! _test_mount
             then
                 echo "common.rc: could not mount $TEST_DEV on $TEST_DIR"
index 4d5a14b461848c2fc7e7c34f18196490f5bcff85..d3f15968fb289344202a5d63379cfdef89502ae3 100644 (file)
@@ -39,6 +39,7 @@
 #include <dirent.h>
 
 #define XFS_ERRTAG_MAX         17
 #include <dirent.h>
 
 #define XFS_ERRTAG_MAX         17
+#define XFS_IDMODULO_MAX       32
 
 typedef enum {
        OP_ALLOCSP,
 
 typedef enum {
        OP_ALLOCSP,
@@ -204,6 +205,7 @@ int         nameseq;
 int            nops;
 int            nproc = 1;
 int            operations = 1;
 int            nops;
 int            nproc = 1;
 int            operations = 1;
+unsigned int   idmodulo = XFS_IDMODULO_MAX;
 int            procid;
 int            rtpct;
 unsigned long  seed = 0;
 int            procid;
 int            rtpct;
 unsigned long  seed = 0;
@@ -265,7 +267,7 @@ int main(int argc, char **argv)
        int             stat;
        struct timeval  t;
        ptrdiff_t       srval;
        int             stat;
        struct timeval  t;
        ptrdiff_t       srval;
-        int             nousage=0;
+       int             nousage = 0;
        xfs_error_injection_t   err_inj;
 
        errrange = errtag = 0;
        xfs_error_injection_t   err_inj;
 
        errrange = errtag = 0;
@@ -273,7 +275,7 @@ int main(int argc, char **argv)
        nops = sizeof(ops) / sizeof(ops[0]);
        ops_end = &ops[nops];
        myprog = argv[0];
        nops = sizeof(ops) / sizeof(ops[0]);
        ops_end = &ops[nops];
        myprog = argv[0];
-       while ((c = getopt(argc, argv, "d:e:f:i:n:p:rs:vwzHS")) != -1) {
+       while ((c = getopt(argc, argv, "d:e:f:i:m:n:p:rs:vwzHS")) != -1) {
                switch (c) {
                case 'd':
                        dirname = optarg;
                switch (c) {
                case 'd':
                        dirname = optarg;
@@ -299,6 +301,15 @@ int main(int argc, char **argv)
                        ilist = realloc(ilist, ++ilistlen * sizeof(*ilist));
                        ilist[ilistlen - 1] = strtol(optarg, &p, 16);
                        break;
                        ilist = realloc(ilist, ++ilistlen * sizeof(*ilist));
                        ilist[ilistlen - 1] = strtol(optarg, &p, 16);
                        break;
+               case 'm':
+                       idmodulo = strtoul(optarg, NULL, 0);
+                       if (idmodulo > XFS_IDMODULO_MAX) {
+                               fprintf(stderr,
+                                       "chown modulo %d too big (max %d)\n",
+                                       idmodulo, XFS_IDMODULO_MAX);
+                               exit(1);
+                       }
+                       break;
                case 'n':
                        operations = atoi(optarg);
                        break;
                case 'n':
                        operations = atoi(optarg);
                        break;
@@ -1273,6 +1284,7 @@ usage(void)
        printf("   -f op_name=freq  changes the frequency of option name to freq\n");
        printf("                    the valid operation names are:\n");
        show_ops(-1, "                        ");
        printf("   -f op_name=freq  changes the frequency of option name to freq\n");
        printf("                    the valid operation names are:\n");
        show_ops(-1, "                        ");
+       printf("   -m modulo        uid/gid modulo for chown/chgrp (default 32)\n");
        printf("   -n nops          specifies the no. of operations per process (default 1)\n");
        printf("   -p nproc         specifies the no. of processes (default 1)\n");
        printf("   -r               specifies random name padding\n");
        printf("   -n nops          specifies the no. of operations per process (default 1)\n");
        printf("   -p nproc         specifies the no. of processes (default 1)\n");
        printf("   -r               specifies random name padding\n");
@@ -1541,18 +1553,21 @@ chown_f(int opno, long r)
        pathname_t      f;
        int             nbits;
        uid_t           u;
        pathname_t      f;
        int             nbits;
        uid_t           u;
+       gid_t           g;
        int             v;
 
        init_pathname(&f);
        if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
                append_pathname(&f, ".");
        u = (uid_t)random();
        int             v;
 
        init_pathname(&f);
        if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
                append_pathname(&f, ".");
        u = (uid_t)random();
-       nbits = (int)(random() % 32);
+       g = (gid_t)random();
+       nbits = (int)(random() % idmodulo);
        u &= (1 << nbits) - 1;
        u &= (1 << nbits) - 1;
-       e = lchown_path(&f, u, -1) < 0 ? errno : 0;
+       g &= (1 << nbits) - 1;
+       e = lchown_path(&f, u, g) < 0 ? errno : 0;
        check_cwd();
        if (v)
        check_cwd();
        if (v)
-               printf("%d/%d: chown %s %d %d\n", procid, opno, f.path, u, e);
+               printf("%d/%d: chown %s %d/%d %d\n", procid, opno, f.path, u, g, e);
        free_pathname(&f);
 }
 
        free_pathname(&f);
 }