def main(): parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument('--all', action='store_true', help='test all the schemes specified in src/config.yml') group.add_argument('--schemes', metavar='"SCHEME1 SCHEME2..."', help='test a space-separated list of schemes') args = parser.parse_args() if args.all: schemes = parse_config()['schemes'].keys() elif args.schemes is not None: schemes = args.schemes.split() curr_dir = path.abspath(path.dirname(__file__)) data_dir = path.join(curr_dir, 'data') shutil.rmtree(data_dir, ignore_errors=True) make_sure_path_exists(data_dir) test_py = path.join(project_root.DIR, 'test', 'test.py') analyze_py = path.join(project_root.DIR, 'analysis', 'analyze.py') cmd = ['python', test_py, 'local', '--schemes', ' '.join(schemes), '-t', '10', '--data-dir', data_dir, '--pkill-cleanup', '--prepend-mm-cmds', 'mm-delay 20', '--extra-mm-link-args', '--uplink-queue=droptail --uplink-queue-args=packets=200'] check_call(cmd) cmd = ['python', analyze_py, '--data-dir', data_dir] check_call(cmd)
def main(): h.call(['echo', '1']) h.check_call('echo 2', shell=True) ret = h.check_output(['echo', '3']).strip() print ret assert ret == '3' proc = h.Popen(['echo', '4'], stdout=h.PIPE) ret = proc.communicate()[0].strip() print ret assert ret == '4' print h.get_open_port() h.make_sure_path_exists(h.TMPDIR) print h.parse_config()
def main(): curr_dir = path.abspath(path.dirname(__file__)) data_dir = path.join(curr_dir, 'data') test_py = path.join(project_root.DIR, 'test', 'test.py') analyze_py = path.join(project_root.DIR, 'analysis', 'analyze.py') schemes = ('default_tcp vegas bbr ledbat pcc verus sprout webrtc ' 'scream copa taova koho_cc calibrated_koho indigo') cmd = ['python', test_py, 'local', '--schemes', schemes, '-t', '10', '--data-dir', data_dir, '--pkill-cleanup', '--prepend-mm-cmds', 'mm-delay 20', '--extra-mm-link-args', '--uplink-queue=droptail --uplink-queue-args=packets=200'] check_call(cmd) cmd = ['python', analyze_py, '--data-dir', data_dir] check_call(cmd)
def run(self): report_uid = uuid.uuid4() latex_path = path.join(TMPDIR, 'pantheon_report_%s.tex' % report_uid) self.latex = open(latex_path, 'w') self.include_summary() self.include_runs() self.latex.close() cmd = ['pdflatex', '-halt-on-error', '-jobname', 'pantheon_report_%s' % report_uid, latex_path] check_call(cmd, cwd=TMPDIR) pdf_src_path = path.join(TMPDIR, 'pantheon_report_%s.pdf' % report_uid) pdf_dst_path = path.join(self.data_dir, 'pantheon_report.pdf') os.rename(pdf_src_path, pdf_dst_path) sys.stderr.write( 'Saved pantheon_report.pdf in %s\n' % self.data_dir)
def main(): args = parse_arguments(path.basename(__file__)) analysis_dir = path.join(project_root.DIR, 'analysis') plot = path.join(analysis_dir, 'plot.py') report = path.join(analysis_dir, 'report.py') plot_cmd = ['python', plot] report_cmd = ['python', report] for cmd in [plot_cmd, report_cmd]: if args.data_dir: cmd += ['--data-dir', args.data_dir] if args.schemes: cmd += ['--schemes', args.schemes] if args.include_acklink: cmd += ['--include-acklink'] check_call(plot_cmd) check_call(report_cmd)
def setup(args): if not args.install_deps: # update submodules update_submodules() # enable IP forwarding sh_cmd = 'sudo sysctl -w net.ipv4.ip_forward=1' check_call(sh_cmd, shell=True) if args.interface is not None: # disable reverse path filtering rpf = 'net.ipv4.conf.%s.rp_filter' sh_cmd = 'sudo sysctl -w %s=0' % (rpf % 'all') check_call(sh_cmd, shell=True) sh_cmd = 'sudo sysctl -w %s=0' % (rpf % args.interface) check_call(sh_cmd, shell=True) # setup specified schemes cc_schemes = None if args.all: cc_schemes = parse_config()['schemes'].keys() elif args.schemes is not None: cc_schemes = args.schemes.split() if cc_schemes is not None: for cc in cc_schemes: try: cc_src = path.join(project_root.DIR, 'src', cc + '.py') # install dependencies if args.install_deps: install_deps(cc_src) else: # persistent setup across reboots if args.setup: check_call(['python', cc_src, 'setup']) # setup required every time after reboot if call(['python', cc_src, 'setup_after_reboot']) != 0: sys.stderr.write('Warning: "%s.py setup_after_reboot"' ' failed but continuing\n' % cc) except Exception as e: print('=========', e)
def main(): parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) group.add_argument('--all', action='store_true', help='test all the schemes specified in src/config.yml') group.add_argument('--schemes', metavar='"SCHEME1 SCHEME2..."', help='test a space-separated list of schemes') args = parser.parse_args() if args.all: schemes = parse_config()['schemes'].keys() elif args.schemes is not None: schemes = args.schemes.split() curr_dir = path.abspath(path.dirname(__file__)) data_dir = path.join(curr_dir, 'data') shutil.rmtree(data_dir, ignore_errors=True) make_sure_path_exists(data_dir) test_py = path.join(project_root.DIR, 'test', 'test.py') analyze_py = path.join(project_root.DIR, 'analysis', 'analyze.py') cmd = [ 'python', test_py, 'local', '--schemes', ' '.join(schemes), '-t', '10', '--data-dir', data_dir, '--pkill-cleanup', '--prepend-mm-cmds', 'mm-delay 20', '--extra-mm-link-args', '--uplink-queue=droptail --uplink-queue-args=packets=200' ] check_call(cmd) cmd = ['python', analyze_py, '--data-dir', data_dir] check_call(cmd)
def setup(args): if not args.install_deps: # update submodules update_submodules() # enable IP forwarding sh_cmd = 'sudo sysctl -w net.ipv4.ip_forward=1' check_call(sh_cmd, shell=True) if args.interface is not None: # disable reverse path filtering rpf = 'net.ipv4.conf.%s.rp_filter' sh_cmd = 'sudo sysctl -w %s=0' % (rpf % 'all') check_call(sh_cmd, shell=True) sh_cmd = 'sudo sysctl -w %s=0' % (rpf % args.interface) check_call(sh_cmd, shell=True) # setup specified schemes cc_schemes = None if args.all: cc_schemes = parse_config()['schemes'].keys() elif args.schemes is not None: cc_schemes = args.schemes.split() if cc_schemes is not None: for cc in cc_schemes: cc_src = path.join(project_root.DIR, 'src', cc + '.py') # install dependencies if args.install_deps: install_deps(cc_src) else: # persistent setup across reboots if args.setup: check_call(['python', cc_src, 'setup']) # setup required every time after reboot if call(['python', cc_src, 'setup_after_reboot']) != 0: sys.stderr.write('Warning: "%s.py setup_after_reboot"' ' failed but continuing\n' % cc)
def main(): curr_dir = path.dirname(path.abspath(__file__)) data_trace = path.join(curr_dir, '12mbps_data.trace') ack_trace = path.join(curr_dir, '12mbps_ack.trace') test_py = path.join(project_root.DIR, 'test', 'test.py') # test a receiver-first scheme --- default_tcp cc = 'default_tcp' cmd = ['python', test_py, 'local', '-t', '5', '-f', '0', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc] check_call(cmd) cmd = ['python', test_py, 'local', '-t', '5', '-f', '1', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc] check_call(cmd) cmd = ['python', test_py, 'local', '-t', '5', '-f', '1', '--run-times', '2', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc] check_call(cmd) cmd = ['python', test_py, 'local', '-t', '5', '-f', '2', '--interval', '2', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc] check_call(cmd) cmd = ['python', test_py, 'local', '-t', '5', '--pkill-cleanup', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--extra-mm-link-args', '--uplink-queue=droptail --uplink-queue-args=packets=200', '--prepend-mm-cmds', 'mm-delay 10', '--append-mm-cmds', 'mm-delay 10', '--schemes', '%s' % cc] check_call(cmd) # test a sender-first scheme --- verus cc = 'verus' cmd = ['python', test_py, 'local', '-t', '5', '-f', '0', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc] check_call(cmd) cmd = ['python', test_py, 'local', '-t', '5', '-f', '1', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc] check_call(cmd)
def main(): curr_dir = path.dirname(path.abspath(__file__)) data_trace = path.join(curr_dir, '12mbps_data.trace') ack_trace = path.join(curr_dir, '12mbps_ack.trace') test_py = path.join(project_root.DIR, 'test', 'test.py') # test a receiver-first scheme cc = 'default_tcp' cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '0', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '1', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '1', '--run-times', '2', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '2', '--interval', '2', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '--pkill-cleanup', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--extra-mm-link-args', '--uplink-queue=droptail --uplink-queue-args=packets=200', '--prepend-mm-cmds', 'mm-delay 10', '--append-mm-cmds', 'mm-delay 10', '--schemes', '%s' % cc ] check_call(cmd) # test a sender-first scheme cc = 'verus' cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '0', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '1', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd)
def main(): curr_dir = path.dirname(path.abspath(__file__)) data_trace = path.join(curr_dir, '12mbps_data.trace') ack_trace = path.join(curr_dir, '12mbps_ack.trace') test_py = path.join(project_root.DIR, 'test', 'test.py') # test a receiver-first scheme --- default_tcp cc = 'default_tcp' cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '0', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '1', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '1', '--run-times', '2', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '2', '--interval', '2', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '--pkill-cleanup', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--extra-mm-link-args', '--uplink-queue=droptail --uplink-queue-args=packets=200', '--prepend-mm-cmds', 'mm-delay 10', '--append-mm-cmds', 'mm-delay 10', '--schemes', '%s' % cc ] check_call(cmd) # test a sender-first scheme --- verus cc = 'verus' cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '0', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) cmd = [ 'python', test_py, 'local', '-t', '5', '-f', '1', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup', '--schemes', '%s' % cc ] check_call(cmd) # test running with a config file -- two reciever first schemes config = get_sample_config('bbr-cubic') cmd = [ 'python', test_py, '-c', config, 'local', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup' ] check_call(cmd) # test running with a config file -- one receiver first, one sender first scheme config = get_sample_config('verus-cubic') cmd = [ 'python', test_py, '-c', config, 'local', '--uplink-trace', data_trace, '--downlink-trace', ack_trace, '--pkill-cleanup' ] check_call(cmd)
def main(): parser = argparse.ArgumentParser() parser.add_argument('remote', metavar='HOSTADDR:PANTHEON-DIR') args = parser.parse_args() remote = args.remote test_py = path.join(project_root.DIR, 'test', 'test.py') # test a receiver-first scheme --- default_tcp cc = 'default_tcp' cmd = ['python', test_py, 'remote', remote, '--pkill-cleanup', '-t', '5', '--schemes', cc] check_call(cmd) cmd = ['python', test_py, 'remote', remote, '-t', '5', '--pkill-cleanup', '--run-times', '2', '--schemes', cc] check_call(cmd) cmd = ['python', test_py, 'remote', remote, '-t', '5', '--pkill-cleanup', '--sender', 'remote', '--schemes', cc] check_call(cmd) cmd = ['python', test_py, 'remote', remote, '-t', '5', '-f', '2', '--pkill-cleanup', '--interval', '2', '--schemes', cc] check_call(cmd) # test a sender-first scheme --- verus cc = 'verus' cmd = ['python', test_py, 'remote', remote, '-t', '5', '--pkill-cleanup', '--schemes', cc] check_call(cmd) cmd = ['python', test_py, 'remote', remote, '-t', '5', '--pkill-cleanup', '--sender', 'remote', '--schemes', cc] check_call(cmd)
def main(): parser = argparse.ArgumentParser() parser.add_argument('remote', metavar='HOSTADDR:PANTHEON-DIR') args = parser.parse_args() remote = args.remote test_py = path.join(project_root.DIR, 'test', 'test.py') # test a receiver-first scheme --- default_tcp cc = 'default_tcp' cmd = [ 'python', test_py, 'remote', remote, '--pkill-cleanup', '-t', '5', '--schemes', cc ] check_call(cmd) cmd = [ 'python', test_py, 'remote', remote, '-t', '5', '--pkill-cleanup', '--run-times', '2', '--schemes', cc ] check_call(cmd) cmd = [ 'python', test_py, 'remote', remote, '-t', '5', '--pkill-cleanup', '--sender', 'remote', '--schemes', cc ] check_call(cmd) cmd = [ 'python', test_py, 'remote', remote, '-t', '5', '-f', '2', '--pkill-cleanup', '--interval', '2', '--schemes', cc ] check_call(cmd) # test a sender-first scheme --- verus cc = 'verus' cmd = [ 'python', test_py, 'remote', remote, '-t', '5', '--pkill-cleanup', '--schemes', cc ] check_call(cmd) cmd = [ 'python', test_py, 'remote', remote, '-t', '5', '--pkill-cleanup', '--sender', 'remote', '--schemes', cc ] check_call(cmd)