Module: check_mk
Branch: master
Commit: f9c6e3407e6c73920a977fb81f2836f69372e025
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f9c6e3407e6c73…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 29 14:39:35 2016 +0200
Not using TCP for livestatus
---
tests/testlib/__init__.py | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 7eec516..5b1d9e9 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -146,7 +146,7 @@ class Site(object):
@property
def live(self):
- return livestatus.SingleSiteConnection("tcp:127.0.0.1:9123")
+ return livestatus.SingleSiteConnection("unix:%s/tmp/run/live" %
self.root)
def execute(self, cmd, *args, **kwargs):
@@ -197,7 +197,7 @@ class Site(object):
def start(self):
if not self.is_running():
assert omd(["start", self.id]) == 0
- assert self.is_running()
+ assert self.is_running() == True
def exists(self):
@@ -232,16 +232,12 @@ def site(request):
site = Site(site_id=site_id(), version=site_version(),
edition=site_edition())
site.cleanup_if_wrong_version()
-
- existed = site.exists()
site.create()
-
- if not existed:
- site.set_config("LIVESTATUS_TCP", "on")
- site.set_config("LIVESTATUS_TCP_PORT", "9123") # Need
multiple? Make it configurable!
-
site.start()
+ # Hack: Make livestatus port read/writable for all to make tests possible without TCP
ports
+ site.execute(["chmod", "0666", "%s/tmp/run/live" %
site.root ])
+
def fin():
site.rm_if_not_reusing()
request.addfinalizer(fin)