Module: check_mk
Branch: master
Commit: 38880e8938da5ba333cf682eff4b2e171b390a5a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=38880e8938da5b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 22 15:29:53 2016 +0100
Added structure for packaging tests
Change-Id: I0973a0a1627c2ad1d924b0874e6768058bf40c67
---
pytest.ini | 6 +++++-
tests/packaging/test_setuid_bits.py | 20 ++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/pytest.ini b/pytest.ini
index a43d447..b4e450f 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -3,4 +3,8 @@ testpaths = tests
# Fail on first error and enable stepwise plugin to track steps and
# be able to continue with the failed test after analyzing and fixing
# the issue
-addopts = -rs -v --maxfail=1
+addopts = -rs -v --maxfail=1 -m "not packaging"
+# Register some markers to classify the tests
+markers =
+ pylint: Mark a test as pylint test.
+ packaging: This is a test to execute to verify the packaging of the testbuilds.
diff --git a/tests/packaging/test_setuid_bits.py b/tests/packaging/test_setuid_bits.py
new file mode 100644
index 0000000..f2a0052
--- /dev/null
+++ b/tests/packaging/test_setuid_bits.py
@@ -0,0 +1,20 @@
+import pytest
+import os
+
+pytestmark = pytest.mark.packaging
+
+def version_path():
+ path = os.environ.get("VERSION_PATH")
+ if not path:
+ raise Exception("VERSION_PATH environment variable pointing to the version "
+ "directory (e.g. /bauwelt/download/2016.12.22) is missing")
+ return path
+
+
+def test_setuid_bits():
+ print version_path()
+ print os.listdir(version_path())
+
+
+def test_files_not_in_version_path():
+ pass
Module: check_mk
Branch: master
Commit: 4b01135599c9c1507e059e24c8c128e3ca45b912
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b01135599c9c1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 22 13:55:23 2016 +0100
It is now possible to explicitly search for enabled/disabled and ineffective/effective rules
Change-Id: I638a2f6739e2ea0fd5ddab206a974ac46a492c4a
---
web/htdocs/valuespec.py | 4 +++-
web/htdocs/wato.py | 14 ++++++++++----
web/htdocs/watolib.py | 4 ++--
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 91c797a..260b9ac 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -30,7 +30,9 @@
# and rename to better name
# - Consolidate RadioChoice and DropdownChoice to use same class
# and rename to better name
-# - Checkbox -> rename to Boolean
+# - Checkbox
+# -> rename to Boolean
+# -> Add alternative rendering "dropdown"
import math, os, time, re, sre_constants, urlparse, forms, tempfile
import base64
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index eb1dac4..2749b18 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -12857,13 +12857,19 @@ class ModeRuleSearch(WatoMode):
("rule_hosttags", HostTagCondition(
title = _("Used host tags"))
),
- ("rule_disabled", FixedValue(False,
+ ("rule_disabled", DropdownChoice(
title = _("Disabled"),
- totext = _("Search for disabled rules"),
+ choices = [
+ (True, _("Search for disabled rules")),
+ (False, _("Search for enabled rules")),
+ ],
)),
- ("rule_ineffective", FixedValue(False,
+ ("rule_ineffective", DropdownChoice(
title = _("Ineffective"),
- totext = _("Search for ineffective rules (not matching any host or service)"),
+ choices = [
+ (True, _("Search for ineffective rules (not matching any host or service)")),
+ (False, _("Search for effective rules")),
+ ],
)),
],
)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 776fc0f..9f7a1df 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -6770,10 +6770,10 @@ class Rule(object):
def matches_search(self, search_options):
- if "rule_disabled" in search_options and not self.is_disabled():
+ if "rule_disabled" in search_options and search_options["rule_disabled"] != self.is_disabled():
return False
- if "rule_ineffective" in search_options and not self.is_ineffective():
+ if "rule_ineffective" in search_options and search_options["rule_ineffective"] != self.is_ineffective():
return False
if not match_search_expression(search_options, "rule_description", self.description()):