Exemplo n.º 1
0
    def test_run_healthrule_absolute_open(self):
        alert_info = get_alert_info('POLICY_OPEN_WARNING', 'ABSOLUTE')
        script_args = mkargs(alert_info)

        script = run_script(script_args)

        assert script.returncode == 0
        body = server.to_json(httpd.request_info)

        assert body == alert_info
Exemplo n.º 2
0
    def test_run_healthrule_baseline_custom(self):
        alert_info = get_alert_info('POLICY_OPEN_WARNING',
                                    'BASELINE_PERCENTAGE', ['baseline', 1234])
        script_args = mkargs(alert_info)

        script = run_script(script_args)

        assert script.returncode == 0
        body = server.to_json(httpd.request_info)

        assert body == alert_info
Exemplo n.º 3
0
    def test_run_healthrule_absolute_cancel(self):
        alert_info = get_alert_info('POLICY_CANCELED_WARNING',
                                    'ABSOLUTE',
                                    num_entities=0)
        script_args = mkargs(alert_info)

        script = run_script(script_args)

        assert script.returncode == 0
        body = server.to_json(httpd.request_info)

        assert body == alert_info