Module: check_mk
Branch: master
Commit: c56efc119f0374654715a9252c22bddd0179133b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c56efc119f0374…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 21 11:28:55 2016 +0100
Crawl tests now really do not use system apache
Change-Id: Ibea790cfc2cec6a4a755e3eb0ca3e80822caf00f
---
tests/testlib/__init__.py | 11 ++++++++++-
tests/web/test_crawl.py | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index b9cc888..d213fea 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -436,9 +436,14 @@ class WebSession(requests.Session):
self.transids = []
# Resources are
self.verified_resources = set()
+ self.via_system_apache = True
super(WebSession, self).__init__()
+ def dont_use_system_apache(self):
+ self.via_system_apache = False
+
+
def check_redirect(self, path, proto="http", expected_code=302,
expected_target=None):
url = self.url(proto, path)
@@ -626,7 +631,11 @@ class CMKWebSession(WebSession):
if "/" not in urlparse(path).path:
path = "/%s/check_mk/%s" % (self.site.id, path)
- return '%s://%s%s' % (self.site.http_proto, self.site.http_address,
path)
+ if self.via_system_apache:
+ return '%s://%s%s' % (self.site.http_proto, self.site.http_address,
path)
+ else:
+ return '%s://%s:%d%s' % (self.site.http_proto,
self.site.http_address,
+ self.site.apache_port, path)
def login(self, username="omdadmin", password="omd"):
diff --git a/tests/web/test_crawl.py b/tests/web/test_crawl.py
index 9fc2aa3..6c10fd6 100644
--- a/tests/web/test_crawl.py
+++ b/tests/web/test_crawl.py
@@ -57,6 +57,7 @@ class Worker(threading.Thread):
self.idle = True
self.client = CMKWebSession(self.crawler.site)
+ self.client.dont_use_system_apache()
self.client.login()
self.client.set_language("en")