aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2019-09-29 11:59:55 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2019-09-29 17:42:46 +0200
commit5e76e17399232c26987b6e0af78c969797f940ae (patch)
treed51118b8bfce783cd4578a06ba8e99a4e95816fa
parent07f4468978fdc43d7a9885f6e4efa87b5e83d2a9 (diff)
Detect OpenStack Train
It takes into account latest max nova microversions [1] [1] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html Change-Id: Icb9838b09ad22f6e87e9d8fb3c47525bdc1e3307 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--functest/tests/unit/utils/test_functest_utils.py8
-rw-r--r--functest/utils/functest_utils.py5
2 files changed, 12 insertions, 1 deletions
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py
index f6a80e264..4f3f16f23 100644
--- a/functest/tests/unit/utils/test_functest_utils.py
+++ b/functest/tests/unit/utils/test_functest_utils.py
@@ -309,6 +309,14 @@ class FunctestUtilsTesting(unittest.TestCase):
args[0].assert_called_once_with(cloud)
@mock.patch('functest.utils.functest_utils.get_nova_version',
+ return_value=(2, 78))
+ def test_openstack_version12(self, *args):
+ cloud = mock.Mock()
+ self.assertEqual(functest_utils.get_openstack_version(
+ cloud), "Train")
+ args[0].assert_called_once_with(cloud)
+
+ @mock.patch('functest.utils.functest_utils.get_nova_version',
return_value=None)
def test_openstack_version_exc(self, *args):
cloud = mock.Mock()
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py
index ef5dac72a..a1434adc2 100644
--- a/functest/utils/functest_utils.py
+++ b/functest/utils/functest_utils.py
@@ -110,11 +110,14 @@ def get_openstack_version(cloud):
- OpenStack release
- Unknown on operation error
"""
+ # pylint: disable=too-many-branches
version = get_nova_version(cloud)
try:
assert version
- if version > (2, 72):
+ if version > (2, 79):
osversion = "Master"
+ elif version > (2, 72):
+ osversion = "Train"
elif version > (2, 65):
osversion = "Stein"
elif version > (2, 60):