Module: check_mk
Branch: master
Commit: 17be797e10473765f8448d760df00368c39c8f39
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17be797e104737…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 7 11:21:39 2017 +0100
pylint tests: Fixed paths to enterprise components
Change-Id: I6d7a35537dd877697efc32b6aef3fcea00f9e32f
---
tests/pylint/test_pylint_checks.py | 3 +--
tests/pylint/test_pylint_misc.py | 25 +++++++++++------------
tests/testlib/pylint_cmk.py | 41 +++++++++++++++++++-------------------
3 files changed, 33 insertions(+), 36 deletions(-)
diff --git a/tests/pylint/test_pylint_checks.py b/tests/pylint/test_pylint_checks.py
index 4bd3238..43ad6b0 100755
--- a/tests/pylint/test_pylint_checks.py
+++ b/tests/pylint/test_pylint_checks.py
@@ -29,8 +29,7 @@ def test_pylint_checks():
pylint_cmk.add_file(f, path)
# Also add bakery plugins
- for path in pylint_cmk.check_files(os.path.realpath(repo_path()
- + "/../cmc/agents/bakery")):
+ for path in pylint_cmk.check_files(cmc_path() + "/agents/bakery"):
pylint_cmk.add_file(f, path)
f.close()
diff --git a/tests/pylint/test_pylint_misc.py b/tests/pylint/test_pylint_misc.py
index 317e8ef..de6fd4e 100755
--- a/tests/pylint/test_pylint_misc.py
+++ b/tests/pylint/test_pylint_misc.py
@@ -5,7 +5,7 @@ import os
import sys
import pytest
-from testlib import repo_path
+from testlib import cmk_path, cmc_path
import testlib.pylint_cmk as pylint_cmk
# Mark all tests in this file to be pylint checks
@@ -13,21 +13,20 @@ pytestmark = pytest.mark.pylint
def test_pylint_misc():
search_paths = [
- "cmk_base",
- "../cmc/cmk_base",
- "lib",
- "bin",
- "notifications",
- "agents/plugins",
- "active_checks",
- "../cmc/agents/plugins",
- "../cmc/bin",
- "../cmc/misc",
+ cmk_path() + "/cmk_base",
+ cmc_path() + "/cmk_base",
+ cmk_path() + "/lib",
+ cmk_path() + "/bin",
+ cmk_path() + "/notifications",
+ cmk_path() + "/agents/plugins",
+ cmk_path() + "/active_checks",
+ cmc_path() + "/agents/plugins",
+ cmc_path() + "/bin",
+ cmc_path() + "/misc",
]
checked, worst = 0, 0
- for rel_path in search_paths:
- path = os.path.realpath(repo_path() + "/" + rel_path)
+ for path in search_paths:
worst = max(worst, pylint_cmk.run_pylint(path))
checked += 1
diff --git a/tests/testlib/pylint_cmk.py b/tests/testlib/pylint_cmk.py
index fd9a6bc..14168aa 100644
--- a/tests/testlib/pylint_cmk.py
+++ b/tests/testlib/pylint_cmk.py
@@ -16,27 +16,26 @@ from testlib import repo_path
def ordered_module_files():
ordered_modules = [
- "modules/check_mk_base.py",
- "modules/check_mk.py",
- "modules/config.py",
- "modules/discovery.py",
- "modules/snmp.py",
- "modules/notify.py",
- "modules/events.py",
- "modules/nagios.py",
- "modules/automation.py",
- "modules/inventory.py",
- "enterprise/modules/real_time_checks.py",
- "enterprise/modules/alert_handling.py",
- "enterprise/modules/keepalive.py",
- "enterprise/modules/cmc.py",
- "enterprise/modules/inline_snmp.py",
- "enterprise/modules/agent_bakery.py",
- "enterprise/modules/rrd.py",
+ cmk_path() + "/modules/check_mk_base.py",
+ cmk_path() + "/modules/check_mk.py",
+ cmk_path() + "/modules/config.py",
+ cmk_path() + "/modules/discovery.py",
+ cmk_path() + "/modules/snmp.py",
+ cmk_path() + "/modules/notify.py",
+ cmk_path() + "/modules/events.py",
+ cmk_path() + "/modules/nagios.py",
+ cmk_path() + "/modules/automation.py",
+ cmk_path() + "/modules/inventory.py",
+ cmc_path() + "/modules/real_time_checks.py",
+ cmc_path() + "/modules/alert_handling.py",
+ cmc_path() + "/modules/keepalive.py",
+ cmc_path() + "/modules/cmc.py",
+ cmc_path() + "/modules/inline_snmp.py",
+ cmc_path() + "/modules/agent_bakery.py",
+ cmc_path() + "/modules/rrd.py",
]
- modules = [ os.path.realpath(repo_path() + "/" + p)
- for p in ordered_modules ]
+ modules = ordered_modules
# Add modules which are not specified above
for path in module_files():
@@ -48,8 +47,8 @@ def ordered_module_files():
def module_files():
modules = []
- for base_path in [ repo_path() + "/modules",
- repo_path() + "/enterprise/modules" ]:
+ for base_path in [ cmk_path() + "/modules",
+ cmc_path() + "/modules" ]:
modules += [ base_path + "/" + f for f in os.listdir(base_path)
if not f.startswith(".") ]