Module: check_mk
Branch: master
Commit: edc67bf777a54421e04d02ead36202b31fbe487f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=edc67bf777a544…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 11 15:36:46 2017 +0200
test with git version: Only deploy CEE files to CEE editions and CME files to CME edition
Change-Id: I8b9403ec89b0f431b2c7d6abc9902be7b46ae31a
---
tests/conftest.py | 3 ++-
tests/testlib/__init__.py | 24 +++++++++++++++++++++---
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/tests/conftest.py b/tests/conftest.py
index 748d2ef..d719250 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -60,6 +60,7 @@ def setup_site_and_switch_user():
sys.stdout.write("===============================================\n")
sys.stdout.write("Switching to site context\n")
sys.stdout.write("===============================================\n")
+ sys.stdout.flush()
exit_code = site.switch_to_site_user()
@@ -79,7 +80,7 @@ def _get_site_object():
return os.environ.get("EDITION", testlib.CMKVersion.CEE)
def site_branch():
- return os.environ.get("BRANCH", "master")
+ return os.environ.get("BRANCH", "1.4.0")
def reuse_site():
return os.environ.get("REUSE", "1") == "1"
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index bad0811..d32fd7b 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -65,6 +65,7 @@ class CMKVersion(object):
CEE = "cee"
CME = "cme"
CRE = "cre"
+ CME = "cme"
def __init__(self, version, edition, branch):
self._version = version
@@ -111,7 +112,24 @@ class CMKVersion(object):
def edition(self):
- return self.edition_short == CMKVersion.CRE and "raw" or
"enterprise"
+ if self.edition_short == CMKVersion.CRE:
+ return "raw"
+ elif self.edition_short == CMKVersion.CEE:
+ return "enterprise"
+ elif self.edition_short == CMKVersion.CME:
+ return "managed"
+
+
+ def is_managed_edition(self):
+ return self.edition_short == CMKVersion.CME
+
+
+ def is_enterprise_edition(self):
+ return self.edition_short == CMKVersion.CEE
+
+
+ def is_raw_edition(self):
+ return self.edition_short == CMKVersion.CRE
def _needed_distro(self):
@@ -407,7 +425,7 @@ class Site(object):
cmk_path() + "/.werks",
]
- if os.path.exists(cmc_path()):
+ if os.path.exists(cmc_path()) and not self.version.is_raw_edition():
paths += [
cmc_path() + "/bin",
cmc_path() + "/modules",
@@ -422,7 +440,7 @@ class Site(object):
cmc_path() + "/agents",
]
- if os.path.exists(cme_path()):
+ if os.path.exists(cme_path()) and self.version.is_managed_edition():
paths += [
cme_path(),
cme_path() + "/cmk_base",