Module: check_mk
Branch: master
Commit: c2711471219590d960930effe5e764ba2fde90c9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c2711471219590…
Author: Andreas Umbreit <au(a)mathias-kettner.de>
Date: Tue Dec 11 15:36:37 2018 +0100
CMK-1429: cmk-update-agent: Remove unnecessary test for python
Change-Id: I05026ae185c2d56a119e8f0a5a0efa0554235d0d
---
tests/git/test_find_debug_print.py | 9 +++++++++
tests/git/test_permissions.py | 41 ++++++++++++++++++++++----------------
2 files changed, 33 insertions(+), 17 deletions(-)
diff --git a/tests/git/test_find_debug_print.py b/tests/git/test_find_debug_print.py
index 1c8b824..5536b41 100644
--- a/tests/git/test_find_debug_print.py
+++ b/tests/git/test_find_debug_print.py
@@ -23,6 +23,13 @@ check_paths = [
"agents/plugins",
]
+
+exclude_folders = [
+ "plugins/build",
+ "plugins/build_32",
+ "chroot"
+]
+
def test_find_debug_code():
scanned = 0
for base_path in [ cmk_path(), cmc_path(), cme_path() ]:
@@ -35,6 +42,8 @@ def test_find_debug_code():
scanned += 1
for filename in filenames:
file_path = "%s/%s" % (dirpath, filename)
+ if [folder in file_path for folder in exclude_folders]:
+ continue
for nr, line in enumerate(open(file_path)):
if nr == 0 and ("bash" in line or "php" in
line):
diff --git a/tests/git/test_permissions.py b/tests/git/test_permissions.py
index 33c5a43..84c6492 100644
--- a/tests/git/test_permissions.py
+++ b/tests/git/test_permissions.py
@@ -5,34 +5,41 @@ import os
import glob
from testlib import cmk_path
+
def is_executable(path):
return os.path.isfile(path) and os.access(path, os.X_OK)
+
def is_not_executable(path):
return os.path.isfile(path) and not os.access(path, os.X_OK)
+
permissions = [
# globbing pattern check function, excludes
- ('active_checks/*', is_executable, ['Makefile',
'check_mkevents.cc']),
- ('agents/special/agent_*', is_executable, []),
- ('agents/special/lib/*', is_not_executable, []),
- ('agents/check_mk_agent.*', is_executable,
['check_mk_agent.spec']),
- ('agents/plugins/*', is_executable, ['README']),
- ('checks/*', is_not_executable, []),
- ('checkman/*', is_not_executable, []),
- ('inventory/*', is_not_executable, []),
- ('pnp-templates/*', is_not_executable, []),
- ('notifications/*', is_executable, ['README',
'debug']),
- ('bin/*', is_executable, ['Makefile',
'mkevent.cc', 'mkeventd_open514.cc']),
+ ('active_checks/*', is_executable, ['Makefile',
'check_mkevents.cc']),
+ ('agents/special/agent_*', is_executable, []),
+ ('agents/special/lib/*', is_not_executable, []),
+ ('agents/check_mk_agent.*', is_executable, ['check_mk_agent.spec']),
+ ('agents/plugins/*', is_executable, ['README']),
+ ('checks/*', is_not_executable, []),
+ ('checkman/*', is_not_executable, []),
+ ('inventory/*', is_not_executable, []),
+ ('pnp-templates/*', is_not_executable, []),
+ ('notifications/*', is_executable, ['README', 'debug']),
+ ('bin/*', is_executable, ['Makefile', 'mkevent.cc',
'mkeventd_open514.cc']),
# Enterprise specific
- ('enterprise/bin/*', is_executable, []),
- ('enterprise/active_checks/*', is_executable, []),
- ('enterprise/agents/bakery/*', is_not_executable, []),
- ('enterprise/agents/plugins/*', is_executable, ["chroot_version",
"Makefile", "pyinstaller-deps.make", "chroot",
"src", "cmk_update_agent.pyc", "pip-deps-32.make",
"pip-deps.make"]),
- ('enterprise/alert_handlers/*', is_executable, []),
- ('enterprise/alert_handlers/*', is_executable, []),
+ ('enterprise/bin/*', is_executable, []),
+ ('enterprise/active_checks/*', is_executable, []),
+ ('enterprise/agents/bakery/*', is_not_executable, []),
+ ('enterprise/agents/plugins/*', is_executable, [
+ "chroot_version", "Makefile",
"pyinstaller-deps.make", "chroot", "src",
+ "cmk_update_agent.pyc", "pip-deps-32.make",
"pip-deps.make", "dist", "cmk-update-agent.spec",
"cmk-update-agent-32.spec", "build"
+ ]),
+ ('enterprise/alert_handlers/*', is_executable, []),
+ ('enterprise/alert_handlers/*', is_executable, []),
]
+
def test_permissions():
for pattern, check_func, excludes in permissions:
for f in glob.glob("%s/%s" % (cmk_path(), pattern)):