Module: check_mk
Branch: master
Commit: 822522b53f6fd1d5ad9cc3440b273d50db26e203
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=822522b53f6fd1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 12 20:51:53 2017 +0200
Finally fixed GUI crawl test after starting with CME
Change-Id: Id431395b5bf1ad6ef298ddc078f1e6c9cf27d515
---
tests/testlib/__init__.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 2a26a3a..6160dfa 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -345,7 +345,11 @@ class Site(object):
execute("sudo chrpath -r %s/lib %s/bin/python" %
(self.root, self.version.version_path()))
- execute("sudo sed -i 's|^initialize()$|sys.path.insert(0,
\"%s/lib/python\")\\ninitialize()|g' " \
+ self._add_version_path_to_index_py()
+
+
+ def _add_version_path_to_index_py(self):
+ os.system("sudo sed -i '0,/^$/s|^$|import sys ; sys.path.insert(0,
\"%s/lib/python\")\\n|' " \
"%s/share/check_mk/web/htdocs/index.py" %
(self.version.version_path(), self.version.version_path()))
@@ -399,6 +403,8 @@ class Site(object):
print("Executing .f12 in \"%s\" DONE" % path)
sys.stdout.flush()
+ self._add_version_path_to_index_py()
+
def _enable_mod_python_debug(self):
path = "etc/check_mk/apache.conf"
@@ -741,7 +747,7 @@ class WebSession(requests.Session):
if allow_errors and matches:
print "Found error message, but it's allowed: %s" %
matches.groups()
else:
- assert not matches, "Found error message(s): %s" %
"\n".join(matches.groups())
+ assert not matches, "Found error message: %s" % matches.groups()
def _check_html_page_resources(self, response):