From bf61d78d13df0927f2098b6f7ebeb16959a86ff2 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 17 May 2021 16:02:52 +0200 Subject: Detect OpenStack ussuri MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I645913aba06fc87a89fbb5a1a7c090777ca1be7f Signed-off-by: Cédric Ollivier (cherry picked from commit 924674dca42f832ee33128ac51b3d9c5a0ed92c0) --- functest/tests/unit/utils/test_functest_utils.py | 16 ++++++++++++++++ functest/utils/functest_utils.py | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index 4f3f16f23..b22670f76 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -316,6 +316,22 @@ class FunctestUtilsTesting(unittest.TestCase): cloud), "Train") args[0].assert_called_once_with(cloud) + @mock.patch('functest.utils.functest_utils.get_nova_version', + return_value=(2, 87)) + def test_openstack_version13(self, *args): + cloud = mock.Mock() + self.assertEqual(functest_utils.get_openstack_version( + cloud), "Ussuri") + args[0].assert_called_once_with(cloud) + + @mock.patch('functest.utils.functest_utils.get_nova_version', + return_value=(2, 88)) + def test_openstack_version14(self, *args): + cloud = mock.Mock() + self.assertEqual(functest_utils.get_openstack_version( + cloud), "Wallaby") + 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): diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index c48acd3b9..9a5cd410e 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -114,8 +114,10 @@ def get_openstack_version(cloud): version = get_nova_version(cloud) try: assert version - if version > (2, 87): + if version > (2, 88): osversion = "Master" + elif version > (2, 87): + osversion = "Wallaby" elif version > (2, 79): osversion = "Ussuri" elif version > (2, 72): -- cgit 1.2.3-korg