Esempio n. 1
0
def main():
    args = parse_arguments(path.basename(__file__))
    analyze_dir = path.abspath(path.dirname(__file__))

    if args.s3_link:
        # download .tar.xz from S3 and decompress
        os.chdir(args.s3_dir_prefix)
        tar_name = check_output(['basename', args.s3_link]).strip()
        tar_dir = tar_name[:-7]
        check_call(['rm', '-rf', tar_name, tar_dir])

        check_call(['wget', args.s3_link])
        check_call(['tar', 'xJf', tar_name])
        os.chdir(tar_dir)
    else:
        os.chdir(args.data_dir)

    # prepare scripts path
    analyze_pre_setup = path.join(analyze_dir, 'analysis_pre_setup.py')
    plot_summary = path.join(analyze_dir, 'plot_summary.py')
    generate_report = path.join(analyze_dir, 'generate_report.py')

    if not args.no_pre_setup:
        check_call(['python', analyze_pre_setup])

    plot_summary_cmd = ['python', plot_summary]
    generate_report_cmd = ['python', generate_report]
    if args.include_acklink:
        plot_summary_cmd.append('--include-acklink')
        generate_report_cmd.append('--include-acklink')

    if args.analyze_schemes:
        plot_summary_cmd += ['--analyze-schemes', args.analyze_schemes]
        generate_report_cmd += ['--analyze-schemes', args.analyze_schemes]

    check_call(plot_summary_cmd)
    check_call(generate_report_cmd)
Esempio n. 2
0
def main():
    args = parse_arguments(path.basename(__file__))

    setup = Setup(args)
    setup.setup()
Esempio n. 3
0
def main():
    # arguments and source files location setup
    args = parse_arguments(path.basename(__file__))

    test_dir = path.abspath(path.dirname(__file__))
    src_dir = path.abspath(path.join(test_dir, '../src'))
    root_dir = path.abspath(path.join(test_dir, os.pardir))
    pre_setup_src = path.join(test_dir, 'pre_setup.py')
    setup_src = path.join(test_dir, 'setup.py')
    test_src = path.join(test_dir, 'test.py')
    metadata_fname = path.join(test_dir, 'pantheon_metadata.json')

    # test congestion control schemes
    pre_setup_cmd = ['python', pre_setup_src]
    setup_cmd = ['python', setup_src]
    test_cmd = ['python', test_src]

    if args.remote:
        pre_setup_cmd += ['-r', args.remote]
        setup_cmd += ['-r', args.remote]
        test_cmd += ['-r', args.remote]

    test_cmd += ['-t', str(args.runtime), '-f', str(args.flows)]

    if args.flows > 1:
        test_cmd += ['--interval', str(args.interval)]

    if args.remote:
        test_cmd += ['--tunnel-server', args.server_side]
        if args.local_addr:
            test_cmd += ['--local-addr', args.local_addr]
        if args.ntp_addr:
            test_cmd += ['--ntp-addr', args.ntp_addr]

        test_cmd += ['--sender-side', args.sender_side]

    if args.local_if:
        pre_setup_cmd += ['--local-interface', args.local_if]
        test_cmd += ['--local-interface', args.local_if]

    if args.remote_if:
        pre_setup_cmd += ['--remote-interface', args.remote_if]
        test_cmd += ['--remote-interface', args.remote_if]

    if args.downlink_trace and not args.remote:
        test_cmd += ['--downlink-trace', args.downlink_trace]
    if args.uplink_trace and not args.remote:
        test_cmd += ['--uplink-trace', args.uplink_trace]
    if args.prepend_mm_cmds and not args.remote:
        test_cmd += ['--prepend-mm-cmds', args.prepend_mm_cmds]
    if args.append_mm_cmds and not args.remote:
        test_cmd += ['--append-mm-cmds', args.append_mm_cmds]
    if args.extra_mm_link_args and not args.remote:
        test_cmd += ['--extra-mm-link-args', args.extra_mm_link_args]

    run_setup = True
    run_test = True
    if args.run_only == 'setup':
        run_test = False
    elif args.run_only == 'test':
        run_setup = False

    cc_schemes = args.schemes.split()
    if not check_cc_schemes_valid(src_dir, cc_schemes):
        exit(1)

    if args.random_order:
        random.shuffle(cc_schemes)

    # setup and run each congestion control
    if run_setup:
        # check for git version mismatch
        get_git_info(args, root_dir, check_modified_files=False)
        check_call(pre_setup_cmd)
        for cc in cc_schemes:
            cmd = setup_cmd + [cc]
            check_call(cmd)

    error_in_test = False
    if run_test:
        git_info = get_git_info(args, root_dir, check_modified_files=True)
        create_metadata_file(args, git_info, metadata_fname)

        sys.stderr.write('\n')
        for run_id in xrange(1, 1 + args.run_times):
            i = 0
            for cc in cc_schemes:
                i += 1

                msg = ('Running scheme %d of %d (%s) for experiment run %d of '
                       '%d.\n' % (i, len(cc_schemes), cc, run_id,
                                  args.run_times))
                sys.stderr.write(msg)
                cmd = test_cmd + ['--run-id', str(run_id), cc]

                try:
                    check_call(cmd)
                except subprocess.CalledProcessError as e:
                    sys.stderr.write('run.py returned %d while r%s' %
                                     (e.returncode, msg[1:]))
                    sys.stderr.write('It\'s output was %s\n' % str(e.output))
                    error_in_test = True

    if error_in_test:
        sys.stderr.write('Error in tests!\n')
        exit(1)
    else:
        sys.stderr.write('All tests done!\n')
Esempio n. 4
0
def main():
    args = parse_arguments(path.basename(__file__))

    generate_report = GenerateReport(args)
    generate_report.generate_report()
Esempio n. 5
0
def main():
    args = parse_arguments(path.basename(__file__))

    plot_summary = PlotSummary(args.no_plots, args.include_acklink,
                               args.data_dir, args.analyze_schemes)
    plot_summary.plot_summary()
Esempio n. 6
0
def main():
    args = parse_arguments(path.basename(__file__))

    pre_setup = PreSetup(args)
    pre_setup.pre_setup()
def main():
    args = parse_arguments(path.basename(__file__))

    plot_throughput_time = PlotThroughputTime(args)
    plot_throughput_time.plot_throughput_time()
Esempio n. 8
0
def main():
    args = parse_arguments(path.basename(__file__))

    test = Test(args)
    test.test()