diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-30 04:59:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:03 -0500 |
commit | cb1cff90f165d82cbbf1dd87e475a1b13984d45e (patch) | |
tree | f43c4f7017f22ce535305394b46b34f2ded4dad4 /source4/torture/torture.c | |
parent | 1dc8e52f91797bb6953301cc1ebd9bb5a60626ea (diff) | |
download | samba-cb1cff90f165d82cbbf1dd87e475a1b13984d45e.tar.gz samba-cb1cff90f165d82cbbf1dd87e475a1b13984d45e.tar.bz2 samba-cb1cff90f165d82cbbf1dd87e475a1b13984d45e.zip |
r3386: - fixed --seed option in smbtorture
- added new tests BASE-NTDENY1 and BASE-NTDENY2. These are the
ntcreatex equivalents of the BASE-DENY1 and BASE-DENY2
tests. Unfortunately, with ntcreatex there are 4 million combination
and trying each one takes 1 second, so randomised testing is the
only choice. The BASE-DENY1 test can operate in parallel with
hundreds of connections, speeding things up a bit (as most time is
spent waiting 1 second for a sharing violation to come back)
(This used to be commit b95493d3d16581b8dd8f4727cd10631c18e16748)
Diffstat (limited to 'source4/torture/torture.c')
-rw-r--r-- | source4/torture/torture.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c index 713e4cd6f1..08670a0724 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -24,6 +24,7 @@ int torture_nprocs=4; int torture_numops=100; int torture_entries=1000; int torture_failures=1; +int torture_seed=0; static int procnum; /* records process count number when forking */ static struct smbcli_state *current_cli; static BOOL use_oplocks; @@ -359,7 +360,6 @@ static BOOL rw_torture3(struct smbcli_state *c, const char *lockfname) ssize_t sent = 0; BOOL correct = True; - srandom(1); for (i = 0; i < sizeof(buf); i += sizeof(uint32_t)) { SIVAL(buf, i, sys_random()); @@ -2419,6 +2419,8 @@ static struct { {"BASE-DENY1", torture_denytest1, 0}, {"BASE-DENY2", torture_denytest2, 0}, {"BASE-DENY3", torture_denytest3, 0}, + {"BASE-NTDENY1", NULL, torture_ntdenytest1}, + {"BASE-NTDENY2", torture_ntdenytest2, 0}, {"BASE-TCON", run_tcon_test, 0}, {"BASE-TCONDEV", run_tcon_devtype_test, 0}, {"BASE-VUID", run_vuidtest, 0}, @@ -2655,7 +2657,7 @@ static BOOL is_binding_string(const char *binding_string) struct poptOption long_options[] = { POPT_AUTOHELP {"smb-ports", 'p', POPT_ARG_STRING, NULL, 0, "SMB ports", NULL}, - {"seed", 0, POPT_ARG_STRING, NULL, 0, "seed", 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}, @@ -2712,7 +2714,11 @@ static BOOL is_binding_string(const char *binding_string) lp_load(dyn_CONFIGFILE,True,False,False); load_interfaces(); - srandom(time(NULL)); + if (torture_seed == 0) { + torture_seed = time(NULL); + } + printf("Using seed %d\n", torture_seed); + srandom(torture_seed); argv_new = discard_const_p(char *, poptGetArgs(pc)); |