コード例 #1
0
ファイル: test_reprocessing.py プロジェクト: mBr001/onionperf
def test_log_match_with_wrong_filter_date():
    tgen_logs = reprocessing.collect_logs(DATA_DIR, '*tgen.log')
    torctl_logs = reprocessing.collect_logs(DATA_DIR, '*torctl.log')
    test_date = datetime.date(2017, 01, 01)
    log_pairs = reprocessing.match(tgen_logs, torctl_logs, test_date)
    well_known_list = []
    assert_equals(log_pairs, well_known_list)
コード例 #2
0
def test_end_to_end():
    tgen_logs = reprocessing.collect_logs(DATA_DIR, '*tgen.log')
    torctl_logs = reprocessing.collect_logs(DATA_DIR, '*torctl.log')
    log_pairs = reprocessing.match(tgen_logs, torctl_logs, None)
    work_dir = tempfile.mkdtemp()
    reprocessing.multiprocess_logs(log_pairs, work_dir)
    json_file = os.path.join(work_dir, "2019-01-10.onionperf.analysis.json.xz")
    assert (os.path.exists(json_file))
    shutil.rmtree(work_dir)
コード例 #3
0
ファイル: test_reprocessing.py プロジェクト: mBr001/onionperf
def test_log_match():
    tgen_logs = reprocessing.collect_logs(DATA_DIR, '*tgen.log')
    torctl_logs = reprocessing.collect_logs(DATA_DIR, '*torctl.log')
    log_pairs = reprocessing.match(tgen_logs, torctl_logs, None)
    well_known_list = [
        (DATA_DIR + 'logs/onionperf_2019-01-10_23:59:59.tgen.log',
         DATA_DIR + 'logs/onionperf_2019-01-10_23:59:59.torctl.log',
         datetime.datetime(2019, 1, 10, 0, 0))
    ]
    assert_equals(log_pairs, well_known_list)
コード例 #4
0
ファイル: test_reprocessing.py プロジェクト: mBr001/onionperf
def test_end_to_end():
    tgen_logs = reprocessing.collect_logs(DATA_DIR, '*tgen.log')
    torctl_logs = reprocessing.collect_logs(DATA_DIR, '*torctl.log')
    log_pairs = reprocessing.match(tgen_logs, torctl_logs, None)
    work_dir = tempfile.mkdtemp()
    reprocessing.multiprocess_logs(log_pairs, work_dir)
    json_file = os.path.join(work_dir, "2019-01-10.onionperf.analysis.json.xz")
    assert (os.path.exists(json_file))
    for i in ['51200', '5242880', '1048576']:
        torperf_file = os.path.join(work_dir,
                                    "op-ab-{0}-2019-01-10.tpf".format(i))
        assert (os.path.exists(torperf_file))
    shutil.rmtree(work_dir)
コード例 #5
0
ファイル: test_reprocessing.py プロジェクト: mBr001/onionperf
def test_log_collection_torctl():
    log_list = reprocessing.collect_logs(DATA_DIR, '*torctl.log')
    well_known_list = [
        DATA_DIR + 'logs/onionperf_2019-01-10_23:59:59.torctl.log',
        DATA_DIR + 'logs/onionperf.torctl.log'
    ]
    assert_equals(log_list, well_known_list)
コード例 #6
0
ファイル: test_reprocessing.py プロジェクト: mBr001/onionperf
def test_log_match_no_log_date():
    tgen_logs = reprocessing.collect_logs(DATA_DIR, '*perf.tgen.log')
    torctl_logs = reprocessing.collect_logs(DATA_DIR, '*perf.torctl.log')
    log_pairs = reprocessing.match(tgen_logs, torctl_logs, None)
    well_known_list = []
    assert_equals(log_pairs, well_known_list)