Module: check_mk
Branch: master
Commit: 562df33c7a36c68a3638c6575200c8c93d68a172
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=562df33c7a36c6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 10 16:42:35 2017 +0100
GUI crawl: Hand over WORKSPACE path for storing the results
Change-Id: Ic4573b440deb7e1b8ca5290900fc92d0e810a1aa
---
tests/testlib/__init__.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 9edf9c7..493adb5 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -458,7 +458,11 @@ class Site(object):
# Check_MK is now the site, so all tests that somehow rely on the environment should
be
# executed this way.
def switch_to_site_user(self):
- cmd = subprocess.list2cmdline(sys.argv + [ cmk_path() + "/tests" ])
+ env_vars = []
+ if "WORKSPACE" in os.environ:
+ env_vars.append("WORKSPACE=%s" %
os.environ["WORKSPACE"])
+
+ cmd = subprocess.list2cmdline(env_vars + sys.argv + [ cmk_path() +
"/tests" ])
args = [ "/usr/bin/sudo", "--", "/bin/su",
"-l", self.id, "-c", cmd ]
return subprocess.call(args)