diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py index 87c8daf1970..1d4316586e6 100644 --- a/python/samba/emulate/traffic.py +++ b/python/samba/emulate/traffic.py @@ -1534,6 +1534,7 @@ def replay(conversation_seq, accounts=None, dns_rate=0, duration=None, + latency_timeout=1.0, stop_on_any_error=False, **kwargs): @@ -1559,7 +1560,7 @@ def replay(conversation_seq, # end slightly after the last packet of the last conversation # to start. Conversations other than the last could still be # going, but we don't care. - duration = conversation_seq[-1][-1][0] + 1.0 + duration = conversation_seq[-1][-1][0] + latency_timeout print("We will start in %.1f seconds" % delay, file=sys.stderr) diff --git a/script/traffic_replay b/script/traffic_replay index 6a449a4dbe3..f1e8372c8bb 100755 --- a/script/traffic_replay +++ b/script/traffic_replay @@ -84,6 +84,8 @@ def main(): model_group.add_option('-D', '--duration', type='float', default=60.0, help=('Run model for this long (approx). ' 'Default 60s for models')) + model_group.add_option('--latency-timeout', type='float', default=None, + help=('Wait this long for last packet to finish')) model_group.add_option('-r', '--replay-rate', type='float', default=1.0, help='Replay the traffic faster by this factor') model_group.add_option('--traffic-summary', @@ -368,6 +370,7 @@ def main(): accounts=accounts, dns_rate=opts.dns_rate, duration=opts.duration, + latency_timeout=opts.latency_timeout, badpassword_frequency=opts.badpassword_frequency, prefer_kerberos=opts.prefer_kerberos, statsdir=statsdir,