aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/functest_utils.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-04-22 11:18:36 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2016-04-22 13:55:19 +0200
commitade54b8ec63fc674cfd7d7e0a893b7e34f6b44b1 (patch)
tree6e3cd547ecba1cb1ab3a9d90ad08209291b49cc9 /testcases/functest_utils.py
parente452376fbc44df9cf0688571e1882498f456f3a4 (diff)
Affect version field in results for all the testcases
Previously version was scenario JIRA: FUNCTEST-225 Change-Id: Ia86f83dbe98ad5f9dbced60c46e57f58eccba7e9 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r--testcases/functest_utils.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index 1fccdca8d..ded740e0d 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -98,9 +98,19 @@ def get_version(logger=None):
"""
Get version
"""
- # TODO
-
- return ""
+ # Use the build tag to retrieve the version
+ # By default version is unknown
+ # if launched through CI the build tag has the following format
+ # jenkins-<project>-<installer>-<pod>-<job>-<branch>-<id>
+ # e.g. jenkins-functest-fuel-opnfv-jump-2-daily-master-190
+ # use regex to match branch info
+ rule = "daily-(.+?)-[0-9]*"
+ build_tag = get_build_tag(logger)
+ m = re.search(rule, build_tag)
+ if m:
+ return m.group(1)
+ else:
+ return "unknown"
def get_pod_name(logger=None):