Beispiel #1
0
def test_library(logger, solution, censor, test_type):
    """
    Pulls each solution from the solution library and tests it against
    it's corresponding censor to confirm the censor wins.
    """
    if censor == "dummy":
        pytest.skip("Skipping dummy censor test.")
    fitness = common.run_test(logger,
                              solution,
                              censor,
                              test_type,
                              log_on_success=True)
    # If the fitness was less than 0, the strategy failed to beat the censor
    if fitness > 0:
        pytest.fail("Fitness was %d - strategy beat censor." % fitness)
Beispiel #2
0
def test_one_library(logger):
    """
    Runs a test using one solution from the library as a quick litmus
    test for code health.
    """
    solution = "\/ [TCP:dataofs:5]-drop-|"
    censor = "censor2"
    test_type = "echo"
    fitness = common.run_test(logger,
                              solution,
                              censor,
                              test_type,
                              log_on_fail=True)
    # If the fitness was less than 0, the strategy failed to beat the censor
    if fitness < 0:
        pytest.fail("Fitness was %d - censor beat strategy." % fitness)
Beispiel #3
0
def test_library(logger, solution, censor, test_type):
    """
    Pulls each solution from the solution library and tests it against
    it's corresponding censor to confirm the solution works.
    """
    docker_censors = censors.censor_driver.get_censors()
    if censor not in docker_censors:
        pytest.skip("Censor %s is disabled." % censor)

    fitness = common.run_test(logger,
                              solution,
                              censor,
                              test_type,
                              log_on_fail=True)
    # If the fitness was less than 0, the strategy failed to beat the censor
    if fitness <= 0:
        pytest.fail("Fitness was %d - strategy failed to beat censor." %
                    fitness)
Beispiel #4
0
def main():
    common.run_test(taco_barnes_hut, "Barnes Hut")
    return
Beispiel #5
0
def main():
    common.run_test(taco_barnes_hut, "FMM")
    return
Beispiel #6
0
def test_parameters(config, numofproc):
    run_test(parameters, config, numofproc)
    check_close_logger_call()
Beispiel #7
0
def main():
    common.run_test(taco_compute, "Direct")
    return
Beispiel #8
0
def main():
    common.run_test(taco_barnes_hut, "FMM")
    return
Beispiel #9
0
def main():
    common.run_test(taco_barnes_hut, "Barnes Hut")
    return
def test_convert(config):
    run_test(convert, config)
    check_close_logger_call()