Search in sources :

Example 1 with Restriction

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

the class DSN method discreteVsContinuous.

// @Test
public void discreteVsContinuous() throws Exception {
    TestScanner sc = newScanner();
    Bench.population = 500;
    Bench.scale = 10;
    Path path = Paths.get(root, "restriction_stable.csv");
    Files.deleteIfExists(path);
    boolean first = true;
    for (Restriction r : EnumSet.allOf(Restriction.class)) {
        if (first) {
            Bench.mode = Bench.Mode.SAVE;
            first = !first;
        } else {
            Bench.mode = Bench.Mode.REPLAY;
        }
        System.out.println("--- Restriction: " + r + "; replay= " + first + " ---");
        Bench.report = new CSVReport(path, r.toString());
        sc.testGroups("bi").forEach(x -> {
            Bench.restrictions = EnumSet.of(r);
            System.out.println(x.go());
        });
    }
    // restore
    Bench.restrictions = EnumSet.allOf(Restriction.class);
}
Also used : Path(java.nio.file.Path) Restriction(org.btrplace.safeplace.testing.fuzzer.Restriction) TestScanner(org.btrplace.safeplace.testing.TestScanner) CSVReport(org.btrplace.safeplace.testing.reporting.CSVReport)

Example 2 with Restriction

use of org.btrplace.safeplace.testing.fuzzer.Restriction 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

Restriction (org.btrplace.safeplace.testing.fuzzer.Restriction)2 Path (java.nio.file.Path)1 TestScanner (org.btrplace.safeplace.testing.TestScanner)1 ConfigurableFuzzer (org.btrplace.safeplace.testing.fuzzer.ConfigurableFuzzer)1 CSVReport (org.btrplace.safeplace.testing.reporting.CSVReport)1