Example #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)
Example #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)
Example #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)
Example #4
0
def main():
    common.run_test(taco_barnes_hut, "Barnes Hut")
    return
Example #5
0
def main():
    common.run_test(taco_barnes_hut, "FMM")
    return
Example #6
0
def test_parameters(config, numofproc):
    run_test(parameters, config, numofproc)
    check_close_logger_call()
Example #7
0
def main():
    common.run_test(taco_compute, "Direct")
    return
Example #8
0
def main():
    common.run_test(taco_barnes_hut, "FMM")
    return
Example #9
0
def main():
    common.run_test(taco_barnes_hut, "Barnes Hut")
    return
Example #10
0
def test_convert(config):
    run_test(convert, config)
    check_close_logger_call()