Search in sources :

Example 1 with ConfigurableFuzzer

use of org.btrplace.safeplace.testing.fuzzer.ConfigurableFuzzer in project scheduler by btrplace.

the class DefaultTestCampaign method check.

@Override
public ConfigurableFuzzer check(String c) {
    String lower = c.toLowerCase();
    Optional<Constraint> cstr = cstrs.stream().filter(x -> lower.equalsIgnoreCase(x.id())).findFirst();
    if (!cstr.isPresent()) {
        throw new IllegalArgumentException("No specification for constraint '" + c + "'");
    }
    List<Constraint> pre = cores.stream().filter(x -> !lower.equalsIgnoreCase(x.id())).collect(Collectors.toList());
    ConfigurableFuzzer f = new DefaultFuzzer(this, cstr.get(), pre);
    tcFuzzer = f;
    return f;
}
Also used : Fuzzer(org.btrplace.safeplace.testing.fuzzer.Fuzzer) VerifierResult(org.btrplace.safeplace.testing.verification.VerifierResult) ConfigurableFuzzer(org.btrplace.safeplace.testing.fuzzer.ConfigurableFuzzer) IOException(java.io.IOException) Verifier(org.btrplace.safeplace.testing.verification.Verifier) Schedule(org.btrplace.safeplace.testing.verification.btrplace.Schedule) Parameters(org.btrplace.scheduler.choco.Parameters) Collectors(java.util.stream.Collectors) ReconfigurationPlan(org.btrplace.plan.ReconfigurationPlan) Consumer(java.util.function.Consumer) Constraint(org.btrplace.safeplace.spec.Constraint) Limits(org.btrplace.safeplace.testing.limit.Limits) List(java.util.List) CSchedule(org.btrplace.safeplace.testing.verification.btrplace.CSchedule) Replay(org.btrplace.safeplace.testing.fuzzer.Replay) DefaultParameters(org.btrplace.scheduler.choco.DefaultParameters) Optional(java.util.Optional) DefaultFuzzer(org.btrplace.safeplace.testing.fuzzer.DefaultFuzzer) Counting(org.btrplace.safeplace.testing.reporting.Counting) Report(org.btrplace.safeplace.testing.reporting.Report) DefaultChocoScheduler(org.btrplace.scheduler.choco.DefaultChocoScheduler) Path(java.nio.file.Path) SatConstraint(org.btrplace.model.constraint.SatConstraint) SpecVerifier(org.btrplace.safeplace.testing.verification.spec.SpecVerifier) DefaultFuzzer(org.btrplace.safeplace.testing.fuzzer.DefaultFuzzer) Constraint(org.btrplace.safeplace.spec.Constraint) SatConstraint(org.btrplace.model.constraint.SatConstraint) ConfigurableFuzzer(org.btrplace.safeplace.testing.fuzzer.ConfigurableFuzzer)

Example 2 with ConfigurableFuzzer

use of org.btrplace.safeplace.testing.fuzzer.ConfigurableFuzzer in project scheduler by btrplace.

the class Bench method thousand.

public static TestCampaign thousand(TestCampaign tc, String cstr, Verifier v) {
    tc.reportTo(report);
    tc.verifyWith(v);
    if (mode == Mode.REPLAY) {
        tc.replay(Paths.get(source, cstr + ".json"));
        return tc;
    }
    tc.printProgress(true);
    tc.limits().tests(population);
    ConfigurableFuzzer f = tc.check(cstr).restriction(EnumSet.allOf(Restriction.class));
    f.restriction(restrictions);
    if (transitions) {
        f.vms(scale).nodes(scale).srcOffNodes(0.1).srcVMs(30, 70, 0).dstVMs(30, 70, 0);
    } else {
        f.vms(scale).nodes(scale).srcOffNodes(0).dstOffNodes(0).srcVMs(0, 1, 0).dstVMs(0, 1, 0);
    }
    f.with("nb", 1, 10);
    if (mode == Mode.SAVE) {
        f.save(Paths.get(source, cstr + ".json").toString());
    }
    return tc;
}
Also used : Restriction(org.btrplace.safeplace.testing.fuzzer.Restriction) ConfigurableFuzzer(org.btrplace.safeplace.testing.fuzzer.ConfigurableFuzzer)

Aggregations

ConfigurableFuzzer (org.btrplace.safeplace.testing.fuzzer.ConfigurableFuzzer)2 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 List (java.util.List)1 Optional (java.util.Optional)1 Consumer (java.util.function.Consumer)1 Collectors (java.util.stream.Collectors)1 SatConstraint (org.btrplace.model.constraint.SatConstraint)1 ReconfigurationPlan (org.btrplace.plan.ReconfigurationPlan)1 Constraint (org.btrplace.safeplace.spec.Constraint)1 DefaultFuzzer (org.btrplace.safeplace.testing.fuzzer.DefaultFuzzer)1 Fuzzer (org.btrplace.safeplace.testing.fuzzer.Fuzzer)1 Replay (org.btrplace.safeplace.testing.fuzzer.Replay)1 Restriction (org.btrplace.safeplace.testing.fuzzer.Restriction)1 Limits (org.btrplace.safeplace.testing.limit.Limits)1 Counting (org.btrplace.safeplace.testing.reporting.Counting)1 Report (org.btrplace.safeplace.testing.reporting.Report)1 Verifier (org.btrplace.safeplace.testing.verification.Verifier)1 VerifierResult (org.btrplace.safeplace.testing.verification.VerifierResult)1 CSchedule (org.btrplace.safeplace.testing.verification.btrplace.CSchedule)1