How to use the chaostoolkit.probes.apply_probe function in chaostoolkit

To help you get started, we’ve selected a few chaostoolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chaostoolkit / chaostoolkit / tests / test_probes.py View on Github external
def test_cannot_apply_an_unamed_probe():
    step = {}

    with pytest.raises(ValueError) as excinfo:
        apply_probe(step.get("name"), step, None)

    assert "missing probe name" in str(excinfo)
github chaostoolkit / chaostoolkit / chaostoolkit / plan.py View on Github external
"""
    probe = get_probe_from_step(step, "steady")
    if probe is None:
        return

    if "name" not in probe:
        raise InvalidPlan("steady probe requires a probe name to apply")

    if "layer" not in probe:
        raise InvalidPlan("steady probe requires the target layer to be set")

    if probe:
        probe_name = probe.pop("name")
        layer = layers.get(probe["layer"])
        logger.info(" Applying steady probe '{name}'".format(name=probe_name))
        apply_probe(probe_name, probe, layer)
github chaostoolkit / chaostoolkit / chaostoolkit / plan.py View on Github external
"""
    probe = get_probe_from_step(step, "close")
    if probe is None:
        return

    if "name" not in probe:
        raise InvalidPlan("close probe requires a probe name to apply")

    if "layer" not in probe:
        raise InvalidPlan("close probe requires the target layer to be set")

    if probe:
        probe_name = probe.pop("name")
        layer = layers.get(probe["layer"])
        logger.info(" Applying close probe '{name}'".format(name=probe_name))
        apply_probe(probe_name, probe, layer)