diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2023-03-13 10:59:26 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2023-03-13 11:43:04 +0100 |
commit | 7ab98485aa07f688b4e53caf84e766f6644cc6f5 (patch) | |
tree | 6dcc336de360d64089a73a60d71bd488798873d5 | |
parent | 37fc5eb150077eff9a509a31ee2afeaca4055718 (diff) |
Detect OpenStack Zed
Change-Id: I3b0c9e030f2d31a6151d9ba44f2a06a627b3d913
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r-- | functest/tests/unit/utils/test_functest_utils.py | 16 | ||||
-rw-r--r-- | functest/utils/functest_utils.py | 6 |
2 files changed, 21 insertions, 1 deletions
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 @@ -336,6 +336,22 @@ class FunctestUtilsTesting(unittest.TestCase): 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): cloud = mock.Mock() 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): |