Module: check_mk
Branch: master
Commit: fcd1ee61c6b4ef0a2b779d30d6ee37f9a4bde349
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fcd1ee61c6b4ef…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 21 16:44:11 2016 +0200
Changed manpage tests to be executed in OMD site context
---
check_mk | 7 -------
defaults | 34 ----------------------------------
tests/checkman/test_manpages.py | 20 ++++++++++++++------
3 files changed, 14 insertions(+), 47 deletions(-)
diff --git a/check_mk b/check_mk
deleted file mode 100755
index ce29853..0000000
--- a/check_mk
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env python
-# Small wrapper for being able to start check_mk from git directory
-
-import sys
-sys.path.insert(0, "")
-
-execfile("modules/check_mk.py")
diff --git a/defaults b/defaults
deleted file mode 100644
index 05f2fd8..0000000
--- a/defaults
+++ /dev/null
@@ -1,34 +0,0 @@
-# These defaults are used for running check_mk directly
-# from the source directory without installing it.
-
-default_config_dir = '.'
-check_mk_configdir = 'conf.d'
-checks_dir = 'checks'
-notifications_dir = 'notifications'
-inventory_dir = 'inventory'
-check_manpages_dir = 'checkman'
-agents_dir = 'agents'
-modules_dir = 'modules'
-locale_dir = 'locale'
-var_dir = 'var'
-log_dir = 'var/log'
-autochecksdir = 'var/autochecks'
-precompiled_hostchecks_dir = 'var/precompiled'
-counters_directory = 'var/counters'
-tcp_cache_dir = 'var/cache'
-rrd_path = 'var/rrd'
-nagios_command_pipe_path = 'nagios/nagios.cmd'
-nagios_conf_dir = ''
-nagios_objects_file = 'var/check_mk_objects.cfg'
-nagios_user = 'nagios'
-web_dir = 'web'
-lib_dir = 'livestatus'
-python_lib_dir = '/usr/lib/python2.7'
-apache_config_dir = '/etc/apache2/conf.d/'
-nagios_status_file = '/var/lib/nagios/status.dat'
-htpasswd_file = 'webusers'
-livestatus_unix_socket = 'nagios/live'
-web_dir = 'web'
-pnp_templates_dir = 'pnp-templates'
-doc_dir = 'checkman'
-tmp_dir = 'var/tmp'
diff --git a/tests/checkman/test_manpages.py b/tests/checkman/test_manpages.py
index 8522abc..1437f73 100644
--- a/tests/checkman/test_manpages.py
+++ b/tests/checkman/test_manpages.py
@@ -3,6 +3,7 @@
import os
import sys
+import subprocess
from testlib import cmk_path
@@ -28,22 +29,29 @@ def _check_manpage(name):
assert found_catalog, "Did not find \"catalog:\" header in manpage
\"%s\"" % name
-def test_manpage_list():
- result = os.popen("cd %s ; ./check_mk --list-man 2>&1" %
cmk_path()).read()
+def test_manpage_list(site):
+ p = site.execute(["check_mk", "--list-man"],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ result = p.communicate()[0]
+
+ assert p.returncode == 0
assert result != ""
- assert not "ERROR" in result, "Manpage list broken \"./check_mk
--list-man\": %s\"" % result
+ assert not "ERROR" in result, "Manpage list broken \"check_mk
--list-man\": %s\"" % result
assert type(eval(result)) == dict
-def test_missing_manpage():
+def test_missing_manpage(site):
missing = []
+ p = site.execute(["check_mk", "--list-checks"],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ result = p.communicate()[0]
+ assert p.returncode == 0
+
checks = 0
- for line in os.popen('cd %s ; ./check_mk --list-checks' %
cmk_path()).readlines():
+ for line in result.split("\n"):
checks += 1
line = line.strip()
check_name = line.split(" ", 1)[0]
assert '(no man page present)' not in line, "Manpage missing:
%s" % check_name
if checks == 0:
- raise Exception("\"./check_mk --list-checks\" Did not output a
checks")
+ raise Exception("\"check_mk --list-checks\" Did not output a
checks")