forked from Checkmk/checkmk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_mssql_instance.py
28 lines (20 loc) · 1.01 KB
/
test_mssql_instance.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
import pytest
from cmk.checkengine.checking import CheckPluginName
from cmk.base.api.agent_based.plugin_classes import CheckPlugin
from cmk.base.api.agent_based.register import AgentBasedPlugins
from cmk.agent_based.v2 import Result, State
@pytest.fixture
def check_plugin(agent_based_plugins: AgentBasedPlugins) -> CheckPlugin:
return agent_based_plugins.check_plugins[CheckPluginName("mssql_instance")]
def test_check_mssql_instance_vanished(
check_plugin: CheckPlugin, # pylint: disable=redefined-outer-name
) -> None:
assert list(check_plugin.check_function(item="MSSQL instance", params={}, section={})) == [
Result(
state=State.CRIT, summary="Database or necessary processes not running or login failed"
),
]