Module: check_mk
Branch: master
Commit: 0b32949f1c12412ce2f8f28e0f24f1dfe639d9c3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0b32949f1c1241…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri Oct 20 12:16:54 2017 +0200
Windows agent: add integration tests
Add pytest-based integration tests. The purpose is to offer basic
regression tests to ensure that basic functionality remains intact
across refactorings etc.
The test setup requires a local Linux machine to run the tests on. The
user at the Linux machine must have ssh RSA key pair specifically
generated for this purpose as ~/.ssh/id_rsa_windows_test[.pub]. A
dedicated Windows server must be available for remote access over SSH
with the public key in its authorized keys.
Each pytest test case will be initiated on local Linux machine but
switch over SSH to the remote Windows server and run the actual test
case there. Per-session setup and teardown, e.g. copying files over SSH
is done with the help of per-session pytest fixtures defined in
conftest.py.
The tests cover most of the sections in the output of the Windows
agent. Currently excluded are the sections MS Exchange and Skype as
these require the installations of these commercial software products.
The output is verified against expected patterns and is likely to find
the vast majority of missing or malformatted output. Substantial errors
resulting from broken functionality but that are formatted and output
correctly are likely to go unnoticed.
The sections 'plugins' and 'local' are tested with the plugins
netstat_an.bat and wmic_if.bat. The target is to ensure the correct
functionality of the plugin execution framework of the Windows agent.
The tests can be later extended to test the execution of other plugins,
if necessary.
Besides the output of agent sections during normal execution, the start
parameters of the Windows agent are tested. These tests would interfere
with possibly existing Check_MK_Agent service on the system. This is why
a possibly existing installation is removed during test setup.
Inter-process synchronized access to lock file is used in order to
prevent simultaneous execution of tests in several processes.
PENDING CHANGES:
The build target integrationtest will be committed separately later when
the build server(s) support the test-specific SSH keys. Before that, a
premature commit of the build changes would break the build.
Change-Id: I26e5543924e07acff56be16f9fe6724a8f78358a
---
agents/windows/it/conftest.py | 77 +++++++
agents/windows/it/lock.py | 50 +++++
agents/windows/it/remote.py | 186 ++++++++++++++++
agents/windows/it/test_agent_start_parameters.py | 242 +++++++++++++++++++++
agents/windows/it/test_section_check_mk.py | 120 ++++++++++
agents/windows/it/test_section_df.py | 32 +++
agents/windows/it/test_section_dotnet_clrmemory.py | 44 ++++
agents/windows/it/test_section_eventlog.py | 194 +++++++++++++++++
agents/windows/it/test_section_fileinfo.py | 76 +++++++
agents/windows/it/test_section_logfiles.py | 202 +++++++++++++++++
agents/windows/it/test_section_mem.py | 35 +++
agents/windows/it/test_section_mrpe.py | 64 ++++++
.../windows/it/test_section_openhardwaremonitor.py | 95 ++++++++
agents/windows/it/test_section_plugin_group.py | 120 ++++++++++
agents/windows/it/test_section_ps.py | 42 ++++
agents/windows/it/test_section_services.py | 33 +++
agents/windows/it/test_section_spool.py | 61 ++++++
agents/windows/it/test_section_systemtime.py | 26 +++
agents/windows/it/test_section_uptime.py | 25 +++
agents/windows/it/test_section_winperf.py | 31 +++
agents/windows/it/test_section_wmi_cpuload.py | 64 ++++++
agents/windows/it/test_section_wmi_webservices.py | 83 +++++++
22 files changed, 1902 insertions(+)
Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=0b32949f1c…