summaryrefslogtreecommitdiff
path: root/script/traffic_replay
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2018-11-06 10:52:38 +1300
committerAndrew Bartlett <abartlet@samba.org>2018-11-07 17:55:08 +0100
commit85b6d8898993c45726dd6c1afc2536ab79ba5a3c (patch)
tree89bc2ccc7ecdbdbbb886f37e6befa39500c924db /script/traffic_replay
parentfd089c37a118e58d09fc04c16fdc3eee9d62d3d2 (diff)
downloadsamba-85b6d8898993c45726dd6c1afc2536ab79ba5a3c.tar.gz
traffic_replay: Move machine account creation
I was assuming that generate_users_and_groups() only gets called in the --generate-users-only case. However, it also gets called in the default traffic replay case. This patch reworks the code so that the number of machine accounts to create gets passed in, and the 'create 25% more computers than users' assumption only applies to the --generate-users-only case. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'script/traffic_replay')
-rwxr-xr-xscript/traffic_replay6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/traffic_replay b/script/traffic_replay
index 9642ea87d05..2cd84f7a0bb 100755
--- a/script/traffic_replay
+++ b/script/traffic_replay
@@ -324,12 +324,16 @@ def main():
sys.exit(1)
if opts.generate_users_only:
+ # generate computer accounts for added realism. Assume there will be
+ # some overhang with more computer accounts than users
+ computer_accounts = int(1.25 * number_of_users)
traffic.generate_users_and_groups(ldb,
opts.instance_id,
opts.fixed_password,
opts.number_of_users,
opts.number_of_groups,
- opts.group_memberships)
+ opts.group_memberships,
+ machine_accounts=computer_accounts)
sys.exit()
tempdir = tempfile.mkdtemp(prefix="samba_tg_")