Module: check_mk
Branch: master
Commit: 355e515d63f67199b5ac2c0041df6dd33d687ce1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=355e515d63f671…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri Jan 19 14:35:56 2018 +0100
Windows agent: build check_mk_agent.a library
Link this lib to both check_mk_agent.exe and WindowsAgentTest.exe. The
target was to allow different compile options (include path) for test
sources than for the rest of the sources but reuse same object files /
libraries for both the exe and tests without the need to compile them
twice.
Fix linkage by replacing global extern variables with_stderr and
g_workers_job_object with member variables in Environment.
Change-Id: Ic77e14c1d252adae674de37009b53d7f8d1500b3
---
agents/windows/Environment.cc | 7 ++++--
agents/windows/Environment.h | 13 ++++++++++-
agents/windows/ExternalCmd.cc | 13 +++++------
agents/windows/ExternalCmd.h | 9 +++++---
agents/windows/Makefile.am | 27 ++++++----------------
agents/windows/check_mk_agent.cc | 23 ++++--------------
agents/windows/configure.ac | 1 +
agents/windows/test/EnvironmentTest.cc | 20 ++++++++++------
.../windows/test/sections/SectionEventlogTest.cc | 20 ++++++++--------
.../windows/test/sections/SectionLogwatchTest.cc | 24 +++++++++----------
10 files changed, 75 insertions(+), 82 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=355e515d63…
Module: check_mk
Branch: master
Commit: abfdddda6a1b4f607bbc9dfc2dd2aab19aca025e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abfdddda6a1b4f…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Wed Jan 17 11:51:43 2018 +0100
Windows agent: refactor section MRPE
* Struct mrpe_entry: std::string members instead of C char arrays.
* Do not store mrpe_entry pointers in std::vector.
* Refactor updateIncludes and from_string.
* Use file streams instead of old C file pointers.
* Replace buggy PathIsRelative from Win API with correct and
unit-tested implementation that works also with unix-style paths
with forward slashes and UNC paths.
Change-Id: Ib116b49f4f5a4fe12615395aa7aa90b3ed693800
---
agents/windows/WinApi.cc | 4 -
agents/windows/WinApi.h | 1 -
agents/windows/WinApiAdaptor.h | 1 -
agents/windows/sections/SectionMRPE.cc | 147 +++++++++++----------------------
agents/windows/sections/SectionMRPE.h | 26 ++++--
agents/windows/stringutil.h | 17 ++++
agents/windows/test/MockWinApi.h | 1 -
agents/windows/test/stringutilTest.cc | 56 +++++++++++++
8 files changed, 138 insertions(+), 115 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=abfdddda6a…
Module: check_mk
Branch: master
Commit: aac0e510bda6288bca53cc4b66327fa88fa16008
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aac0e510bda628…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 19 19:17:55 2018 +0100
Tests: Not try to clean up versions when no version is installed
Change-Id: I5f8dfdfc378af8f3fc216bdfb1160c07423f76b0
---
tests/testlib/__init__.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index d5b3570..19612fa 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -585,6 +585,9 @@ class Site(object):
def cleanup_old_sites(self, cleanup_pattern):
+ if not os.path.exists("/omd/sites"):
+ return
+
for site_id in os.listdir("/omd/sites"):
if site_id != self.id and site_id.startswith(cleanup_pattern):
print "Cleaning up old site: %s" % site_id
Module: check_mk
Branch: master
Commit: 69357eb52eb6ec4e7ee49325ea9406566bf4e0d0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69357eb52eb6ec…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Jan 19 14:02:16 2018 +0100
test_statgrab_cpu_check: Remove monkeypatching of time module, as it doesn't work this way and is unnecessary
Change-Id: Ic86f0871393cc57d199699855b33209ed9466b54
---
tests/checks/test_statgrab_cpu_check.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/checks/test_statgrab_cpu_check.py b/tests/checks/test_statgrab_cpu_check.py
index e43b017..e001129 100644
--- a/tests/checks/test_statgrab_cpu_check.py
+++ b/tests/checks/test_statgrab_cpu_check.py
@@ -22,12 +22,13 @@ info_statgrab_cpu_hpux = lambda t: [[u'idle', u'%d' % int(t*5)],
),
])
def test_statgrab_cpu_check(check_manager, monkeypatch, time_to_info, params, predicate):
- import time
check = check_manager.get_check("statgrab_cpu")
+ # NOTE: We do not mock the time module here, because the check does not depend on any
+ # absolute rates. The mocking that was included in this test previously had no
+ # effect, which went unnoticed because it doesn't matter in this case.
try:
list(check.run_check(None, params, time_to_info(0)))
except MKCounterWrapped:
pass
- monkeypatch.setattr("time.time", lambda: 60)
result = checktestlib.CheckResult(check.run_check(None, params, time_to_info(60)))
assert predicate(result)