r19510: Make smbtorture's `nprocs' parameter a parametric option.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 30 Oct 2006 00:17:16 +0000 (00:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:24:42 +0000 (14:24 -0500)
(This used to be commit f5d6b3ca29788d171d53822a26295ae895a5ed8f)

source4/torture/basic/misc.c
source4/torture/nbench/nbench.c
source4/torture/raw/oplock.c
source4/torture/smbtorture.c
source4/torture/torture.c
source4/torture/torture.h
source4/torture/util_smb.c

index 0059574939341d67f2c9bcb8191c17e08106a538..e8e7985f931de67cb17d32299db79eb17b5546f4 100644 (file)
@@ -596,7 +596,8 @@ static NTSTATUS benchrw_mkdir(struct torture_context *tctx,struct smbcli_request
        NT_STATUS_NOT_OK_RETURN(req->status);
        
        /* open/create the files */
-       torture_comment(tctx, "Open File %d/%d\n",state->nr+1,torture_nprocs);
+       torture_comment(tctx, "Open File %d/%d\n",state->nr+1,
+                                       lp_parm_int(-1, "torture", "nprocs", 4));
        open_parms=talloc_zero(state->mem_ctx, union smb_open);
        NT_STATUS_HAVE_NO_MEMORY(open_parms);
        open_parms->openx.level = RAW_OPEN_OPENX;
@@ -760,9 +761,10 @@ BOOL run_benchrw(struct torture_context *tctx)
        union smb_mkdir parms;
        int finished = 0;
        BOOL success=True;
+       int torture_nprocs = lp_parm_int(-1, "torture", "nprocs", 4);
        
        torture_comment(tctx, "Start BENCH-READWRITE num_ops=%d num_nprocs=%d\n",
-               torture_numops,torture_nprocs);
+               torture_numops, torture_nprocs);
 
        /*init talloc context*/
        ev = event_context_init(tctx);
index a9ff8e55079120cde6d884aeaddd49cd26532b39..2bd42940a0d77a3fc9bf9308b8495bf1d28b801f 100644 (file)
@@ -38,7 +38,7 @@ static const char *loadfile;
 /* run a test that simulates an approximate netbench client load */
 static BOOL run_netbench(struct torture_context *tctx, struct smbcli_state *cli, int client)
 {
-       extern int torture_nprocs;
+       int torture_nprocs = lp_parm_int(-1, "torture", "nprocs", 4);
        int i;
        pstring line;
        char *cname;
@@ -171,7 +171,7 @@ done:
 BOOL torture_nbench(struct torture_context *torture)
 {
        BOOL correct = True;
-       extern int torture_nprocs;
+       int torture_nprocs = lp_parm_int(-1, "torture", "nprocs", 4);
        struct smbcli_state *cli;
        const char *p;
 
index 98744e0ec20d7757389280ab172205724d9f3744..f2e894a6eb662409f7e2d7ed487a7202a7978ac9 100644 (file)
@@ -767,7 +767,7 @@ BOOL torture_bench_oplock(struct torture_context *torture)
        struct smbcli_state **cli;
        BOOL ret = True;
        TALLOC_CTX *mem_ctx = talloc_new(torture);
-       extern int torture_nprocs;
+       int torture_nprocs = lp_parm_int(-1, "torture", "nprocs", 4);
        int i, count=0;
        int timelimit = torture_setting_int(torture, "timelimit", 10);
        union smb_open io;
index cd640f87d3d0bc085f329cfa005fd00336f255d5..38f91454e65ebf18e002b0658502d8fc7df130f5 100644 (file)
@@ -448,7 +448,6 @@ const static struct torture_ui_ops quiet_ui_ops = {
                {"format", 0, POPT_ARG_STRING, &ui_ops_name, 0, "Output format (one of: simple, subunit, harness)", NULL },
                {"smb-ports",   'p', POPT_ARG_STRING, NULL,     OPT_SMB_PORTS,  "SMB ports",    NULL},
                {"seed",          0, POPT_ARG_INT,  &torture_seed,      0,      "seed",         NULL},
-               {"num-progs",     0, POPT_ARG_INT,  &torture_nprocs,    0,      "num progs",    NULL},
                {"num-ops",       0, POPT_ARG_INT,  &torture_numops,    0,      "num ops",      NULL},
                {"entries",       0, POPT_ARG_INT,  &torture_entries,   0,      "entries",      NULL},
                {"show-all",      0, POPT_ARG_NONE, &torture_showall,   0,      "show all",     NULL},
index 76c589fcfb34990426babcee22978857c52a9ee6..fbf8f8ca1d940eb6e7854024449ba879194eb709 100644 (file)
@@ -25,7 +25,6 @@
 #include "build.h"
 #include "lib/util/dlinklist.h"
 
-_PUBLIC_ int torture_nprocs=4;
 _PUBLIC_ int torture_numops=10;
 _PUBLIC_ int torture_entries=1000;
 _PUBLIC_ int torture_failures=1;
index a88c1c3654e990e0c7ac236e17a8d6bfe7193838..d821268ba227fa3c72d67d086c410f328727fb6a 100644 (file)
@@ -31,7 +31,6 @@ extern struct torture_suite *torture_root;
 extern BOOL use_oplocks;
 extern BOOL torture_showall;
 extern int torture_entries;
-extern int torture_nprocs;
 extern int torture_seed;
 extern int torture_numops;
 extern int torture_failures;
index 9473ab018bc9b88a247edeb9dbec414d35cb767f..75fa9648f42404b8eaf73048794ac8019c422cfd 100644 (file)
@@ -608,6 +608,7 @@ double torture_create_procs(struct torture_context *tctx,
        volatile bool *child_status_out;
        int synccount;
        int tries = 8;
+       int torture_nprocs = lp_parm_int(-1, "torture", "nprocs", 4);
        double start_time_limit = 10 + (torture_nprocs * 1.5);
        struct timeval tv;