Module: check_mk
Branch: master
Commit: 0686b5e3ba54ec314cb9c62535d3444b3f9cc43b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0686b5e3ba54ec…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 10 13:51:27 2017 +0100
Tests: Added basic hook/init script existance tests
Change-Id: I373960f2df066ae17ec756864d6b713382e22d34
---
tests/omd/test_hooks.py | 41 +++++++++++++++++++++++++++++++++++++++++
tests/omd/test_init_scripts.py | 31 +++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+)
diff --git a/tests/omd/test_hooks.py b/tests/omd/test_hooks.py
new file mode 100644
index 0000000..63eeb9f
--- /dev/null
+++ b/tests/omd/test_hooks.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# encoding: utf-8
+
+import os
+import stat
+
+def test_hooks(site):
+ hooks = [
+ "ADMIN_MAIL",
+ "APACHE_MODE",
+ "APACHE_TCP_ADDR",
+ "APACHE_TCP_PORT",
+ "AUTOSTART",
+ "CORE",
+ "CRONTAB",
+ "DEFAULT_GUI",
+ "DOKUWIKI_AUTH",
+ "LIVESTATUS_TCP",
+ "LIVESTATUS_TCP_PORT",
+ "MKEVENTD",
+ "MKEVENTD_SNMPTRAP",
+ "MKEVENTD_SYSLOG",
+ "MKEVENTD_SYSLOG_TCP",
+ "MULTISITE_AUTHORISATION",
+ "MULTISITE_COOKIE_AUTH",
+ "NAGIOS_THEME",
+ "NAGVIS_URLS",
+ "NSCA",
+ "NSCA_TCP_PORT",
+ "PNP4NAGIOS",
+ "TMPFS",
+ ]
+
+ if site.version.edition() == "enterprise":
+ hooks += [
+ "LIVEPROXYD",
+ ]
+
+ installed_hooks = os.listdir(os.path.join(site.root, "lib/omd/hooks"))
+
+ assert sorted(hooks) == sorted(installed_hooks)
diff --git a/tests/omd/test_init_scripts.py b/tests/omd/test_init_scripts.py
new file mode 100644
index 0000000..18e553b
--- /dev/null
+++ b/tests/omd/test_init_scripts.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# encoding: utf-8
+
+import os
+import stat
+
+def test_init_scripts(site):
+ scripts = [
+ "apache",
+ "core",
+ "crontab",
+ "icinga",
+ "mkeventd",
+ "nagios",
+ "npcd",
+ "nsca",
+ "pnp_gearman_worker",
+ "rrdcached",
+ "xinetd",
+ ]
+
+ if site.version.edition() == "enterprise":
+ scripts += [
+ "cmc",
+ "liveproxyd",
+ "mknotifyd",
+ ]
+
+ installed_scripts = os.listdir(os.path.join(site.root, "etc/init.d"))
+
+ assert sorted(scripts) == sorted(installed_scripts)