From: fsgqa Date: Thu, 17 Jul 2003 23:06:11 +0000 (+0000) Subject: QA test updates. X-Git-Tag: v1.1.0~960 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=74e3d56bf2378bc6c9c0561aa87006b54082f170 QA test updates. Fix location of fsstress and clamp the uid/gid range for chown so as to limit memory requirements for xfs_db/check afterward. --- diff --git a/013 b/013 index e5a8be8f..316dba00 100755 --- a/013 +++ b/013 @@ -86,7 +86,8 @@ _do_test() 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" diff --git a/common.config b/common.config index 3202fff6..02c0908a 100644 --- a/common.config +++ b/common.config @@ -89,7 +89,7 @@ in 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 diff --git a/common.rc b/common.rc index 2dc706d8..1ad70660 100644 --- a/common.rc +++ b/common.rc @@ -44,11 +44,7 @@ umask 022 # 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 @@ -667,7 +663,7 @@ then 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" diff --git a/ltp/fsstress.c b/ltp/fsstress.c index 4d5a14b4..d3f15968 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -39,6 +39,7 @@ #include #define XFS_ERRTAG_MAX 17 +#define XFS_IDMODULO_MAX 32 typedef enum { OP_ALLOCSP, @@ -204,6 +205,7 @@ int nameseq; int nops; int nproc = 1; int operations = 1; +unsigned int idmodulo = XFS_IDMODULO_MAX; 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 nousage=0; + int nousage = 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]; - 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; @@ -299,6 +301,15 @@ int main(int argc, char **argv) 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; @@ -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(" -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"); @@ -1541,18 +1553,21 @@ chown_f(int opno, long r) 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(); - nbits = (int)(random() % 32); + g = (gid_t)random(); + nbits = (int)(random() % idmodulo); 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) - 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); }