Module: check_mk
Branch: master
Commit: 3e24b46e9b00556665b335fe4836bbce14ef4380
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e24b46e9b0055…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 26 17:39:02 2017 +0100
tests: Fixed permission issues during site creation
Change-Id: Id3947a975a99f3d50a3c84d4ae2fa65ebd16d594
---
tests/testlib/__init__.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 845281a..392beb4 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -268,8 +268,9 @@ class Site(object):
raise Exception("The site %s already exists." % self.id)
if not self.exists():
- p = self.execute(["/usr/bin/omd", "-V",
self.version.version_directory(),
- "create", "--apache-reload", self.id])
+ p = subprocess.Popen(["/usr/bin/sudo", "/usr/bin/omd",
+ "-V", self.version.version_directory(),
+ "create", "--apache-reload",
self.id])
assert p.wait() == 0
assert os.path.exists("/omd/sites/%s" % self.id)
@@ -324,7 +325,8 @@ class Site(object):
def rm(self, site_id=None):
if site_id == None:
site_id = self.id
- assert self.execute(["/usr/bin/omd", "-f", "rm",
"--kill", site_id]).wait() == 0
+ assert subprocess.Popen(["/usr/bin/sudo", "/usr/bin/omd",
+ "-f", "rm", "--kill",
site_id]).wait() == 0
def cleanup_old_sites(self, cleanup_pattern):