From 8a74d608e6300b698b469a5202539f59a65707b5 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 13 Mar 2023 10:59:26 +0100 Subject: Detect OpenStack Zed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3b0c9e030f2d31a6151d9ba44f2a06a627b3d913 Signed-off-by: Cédric Ollivier --- functest/tests/unit/utils/test_functest_utils.py | 16 ++++++++++++++++ functest/utils/functest_utils.py | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index 07a57a49a..4f10d9f48 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -335,6 +335,22 @@ class FunctestUtilsTesting(unittest.TestCase): cloud), "Wallaby") args[0].assert_called_once_with(cloud) + @mock.patch('functest.utils.functest_utils.get_nova_version', + return_value=(2, 92)) + def test_openstack_version14(self, *args): + cloud = mock.Mock() + self.assertEqual(functest_utils.get_openstack_version( + cloud), "Zed") + args[0].assert_called_once_with(cloud) + + @mock.patch('functest.utils.functest_utils.get_nova_version', + return_value=(2, 89)) + def test_openstack_version14(self, *args): + cloud = mock.Mock() + self.assertEqual(functest_utils.get_openstack_version( + cloud), "Xena") + 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 4078fb121..eec544489 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -112,8 +112,12 @@ def get_openstack_version(cloud): version = get_nova_version(cloud) try: assert version - if version > (2, 88): + if version > (2, 93): osversion = "Master" + elif version > (2, 90): + osversion = "Zed" + elif version > (2, 88): + osversion = "Xena" elif version > (2, 87): osversion = "Wallaby" elif version > (2, 79): -- cgit 1.2.3-korg