<arg choice="opt">-B, --badpassword-frequency <frequency></arg>
<arg choice="opt">--dns-rate <rate></arg>
<arg choice="opt">-t, --timing-data <file></arg>
+ <arg choice="opt">--random-seed <seed></arg>
<arg choice="opt">-U, --username user</arg>
<arg choice="opt">--password <password></arg>
<arg choice="opt">-W --workgroup <workgroup></arg>
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>random-seed</term>
+ <listitem><para>
+ A number to seed the random number generator with. When traffic is
+ generated from a model-file, use this option to keep the traffic
+ consistent across multiple test runs. This allows you to compare the
+ performance of Samba between different releases.
+ </para></listitem>
+ </varlistentry>
+
<varlistentry>
<term>Traffic Model Options</term>
<listitem><para>
<para>
For taking performance measurements over several test runs,
it's recommended to use this option and replay the traffic from
- a traffic-summary file.
+ a traffic-summary file, or to use the --random-seed option.
</para></listitem>
</varlistentry>
</itemizedlist>
<para>The traffic generated is an approximation of what was seen in
the network capture. The traffic generation involves some randomness,
so running the same command multiple times may result in slightly
- different traffic being generated.</para>
+ different traffic being generated (although you can avoid this, by
+ specifying the --random-seed option).</para>
<para>As well as changing how long the model runs for, you can also
change how many conversations get generated and how fast the traffic
import optparse
import tempfile
import shutil
+import random
sys.path.insert(0, "bin/python")
parser.add_option('-c', '--clean-up',
action="store_true",
help='Clean up the generated groups and user accounts')
+ parser.add_option('--random-seed', type='int', default=0,
+ help='Use to keep randomness consistent across multiple runs')
model_group = optparse.OptionGroup(parser, 'Traffic Model Options',
'These options alter the traffic '
" for the users created as part of this test"))
sys.exit(1)
+ if opts.random_seed:
+ random.seed(opts.random_seed)
+
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)