commit 49d458afb2757fb8bf53f2c4e4cdfbd478a9e3a3 Author: Ana Custura ana@netstat.org.uk Date: Wed May 1 16:55:39 2019 +0100
Adds support for private directory creation --- onionperf/measurement.py | 3 ++- onionperf/onionperf | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/onionperf/measurement.py b/onionperf/measurement.py index d76d493..b285794 100644 --- a/onionperf/measurement.py +++ b/onionperf/measurement.py @@ -160,10 +160,11 @@ def logrotate_thread_task(writables, tgen_writable, torctl_writable, docroot, ni
class Measurement(object):
- def __init__(self, tor_bin_path, tgen_bin_path, datadir_path, nickname, oneshot, additional_client_conf=None, torclient_conf_file=None, torserver_conf_file=None): + def __init__(self, tor_bin_path, tgen_bin_path, datadir_path, privatedir_path, nickname, oneshot, additional_client_conf=None, torclient_conf_file=None, torserver_conf_file=None): self.tor_bin_path = tor_bin_path self.tgen_bin_path = tgen_bin_path self.datadir_path = datadir_path + self.privatedir_path = privatedir_path self.oneshot = oneshot self.nickname = nickname self.threads = None diff --git a/onionperf/onionperf b/onionperf/onionperf index 211da5a..9e1226c 100755 --- a/onionperf/onionperf +++ b/onionperf/onionperf @@ -215,6 +215,13 @@ built-in Torperf (50KiB, 1MiB, 5MiB) traffic model""", action="store", dest="prefix", default=os.getcwd() + "/onionperf-data")
+ measure_parser.add_argument('-k', '--key-prefix', + help="""a directory PATH prefix where OnionPerf will store its private key files""", + metavar="PATH", type=type_str_dir_path_out, + action="store", dest="private_prefix", + default=os.getcwd() + "/onionperf-private") + + # analyze analyze_parser = sub_parser.add_parser('analyze', description=DESC_ANALYZE, help=HELP_ANALYZE, formatter_class=my_formatter_class) @@ -386,7 +393,7 @@ def measure(args): server_tor_ctl_port = util.get_random_free_port() server_tor_socks_port = util.get_random_free_port()
- meas = Measurement(args.torpath, args.tgenpath, args.prefix, args.nickname, args.oneshot, args.additional_client_conf, args.torclient_conf_file, args.torserver_conf_file) + meas = Measurement(args.torpath, args.tgenpath, args.prefix, args.private_prefix, args.nickname, args.oneshot, args.additional_client_conf, args.torclient_conf_file, args.torserver_conf_file) meas.run(do_onion=args.do_onion, do_inet=args.do_inet, client_tgen_listen_port=client_tgen_port, client_tgen_connect_ip=client_connect_ip, client_tgen_connect_port=client_connect_port, client_tor_ctl_port=client_tor_ctl_port, client_tor_socks_port=client_tor_socks_port, server_tgen_listen_port=server_tgen_port, server_tor_ctl_port=server_tor_ctl_port, server_tor_socks_port=server_tor_socks_port)
tor-commits@lists.torproject.org