How to use colin - 10 common examples

To help you get started, we’ve selected a few colin 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 user-cont / colin / tests / integration / test_ruleset_file.py View on Github external
def get_results_from_colin_labels_image(image, ruleset_name=None, ruleset_file=None, ruleset=None):
    return colin.run(image.target_name, image.target_type, ruleset_name=ruleset_name,
                     ruleset_file=ruleset_file, ruleset=ruleset)
github user-cont / colin / tests / integration / test_labels.py View on Github external
def get_results_from_colin_labels_image(target, parent_target=None):
    return colin.run(target=target.target_name,
                     parent_target=parent_target,
                     target_type=target.target_type,
                     ruleset_name="fedora",
                     logging_level=logging.DEBUG, pull=False)
github user-cont / colin / tests / integration / colin_tests.py View on Github external
def get_colin_test_image():
    return colin.run("colin-test")
github user-cont / colin / tests / integration / test_targets.py View on Github external
def test_podman_image_target(ruleset):
    results = colin.run(LABELS_IMAGE, "image", ruleset=ruleset, logging_level=10, pull=False)
    assert results.ok
    assert results.results_per_check["url_label"].ok
github user-cont / colin / tests / integration / test_ruleset_file.py View on Github external
def test_unknown_check(ruleset_unknown_check):
    with pytest.raises(ColinRulesetException) as ex:
        colin.get_checks(ruleset=ruleset_unknown_check)
    assert str(ex.value) == "Check i_forgot_the_name can't be loaded, we couldn't find it."
github user-cont / colin / tests / unit / test_ruleset.py View on Github external
def test_ruleset_version(version, should_raise):
    if version == "":
        r = {"banana": 123}
    else:
        r = {"version": version}
    if should_raise:
        with pytest.raises(ColinRulesetException):
            Ruleset(ruleset=r)
    else:
        assert Ruleset(ruleset=r)
github user-cont / colin / tests / unit / test_utils.py View on Github external
def bad_fce():
    raise ColinException("Error")
github user-cont / colin / tests / unit / test_utils.py View on Github external
@exit_after(1)
def slow_fce():
    time.sleep(2)
github user-cont / colin / tests / unit / test_utils.py View on Github external
@exit_after(1)
def bad_fce():
    raise ColinException("Error")
github user-cont / colin / tests / unit / test_utils.py View on Github external
def test_timeout_dirrect():
    with pytest.raises(TimeoutError):
        exit_after(1)(time.sleep)(2)