Module: check_mk
Branch: master
Commit: 8660dc4b848670a98c4892e838bfb9ba8ac96e59
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8660dc4b848670…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 24 16:38:39 2018 +0200
Add some ruleset to the test site to find config load related issues
Change-Id: Ib78b944dff5fc9636a3982d52056b653269d2e7e
---
tests/testlib/__init__.py | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 6e6a1b4..42bbd2f 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -798,6 +798,33 @@ class Site(object):
"Failed to initialize WATO data structures " \
"(Still missing: %s)" % missing_files
+ self._add_wato_test_config(web)
+
+
+ # Add some test configuration that is not test specific. These settings are set only
to have a
+ # bit more complex Check_MK config.
+ def _add_wato_test_config(self, web):
+ # This entry is interesting because it is a check specific setting. These
+ # settings are only registered during check loading. In case one tries to
+ # load the config without loading the checks in advance, this leads into an
+ # exception.
+ # We set this config option here trying to catch this kind of issue.
+ web.set_ruleset("fileinfo_groups", {
+ "ruleset": {
+ "": [ # "" -> folder
+ {
+ 'conditions': {
+ 'host_specs': ['@all'],
+ 'host_tags': []
+ },
+ 'options': {},
+ 'path': '',
+ 'value': [('TESTGROUP', ('*gwia*',
''))]
+ },
+ ],
+ }
+ })
+
def _missing_but_required_wato_files(self):
required_files = [