aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils/env.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-12-21 15:42:54 +0800
committerjose.lausuch <jose.lausuch@ericsson.com>2016-12-21 12:55:44 +0100
commita59fea1046d167b4609c9b86836d178e799dc688 (patch)
tree64972a06ba7d10bbde13e63345136126dfa10a6e /functest/utils/env.py
parent3592444c8abcaca3312d831fd610d82bffd627ea (diff)
Refactor test run related modules using new constants provider
JIRA: FUNCTEST-673 Change-Id: Ia37fb5a08c8fbc4a8acb666565ea887f9ae48b83 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'functest/utils/env.py')
-rw-r--r--functest/utils/env.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/functest/utils/env.py b/functest/utils/env.py
index 86b2be3d..19c6099c 100644
--- a/functest/utils/env.py
+++ b/functest/utils/env.py
@@ -1,4 +1,5 @@
import os
+import re
default_envs = {
'NODE_NAME': 'unknown_pod',
@@ -19,6 +20,20 @@ class Environment(object):
for k, v in default_envs.iteritems():
if k not in os.environ:
self.__setattr__(k, v)
+ self._set_ci_run()
+ self._set_ci_loop()
+
+ def _set_ci_run(self):
+ if self.BUILD_TAG:
+ self.IS_CI_RUN = True
+ else:
+ self.IS_CI_RUN = False
+
+ def _set_ci_loop(self):
+ if self.BUILD_TAG and re.search("daily", self.BUILD_TAG):
+ self.CI_LOOP = "daily"
+ else:
+ self.CI_LOOP = "weekly"
ENV = Environment()