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 16:49:41 +0100 |
commit | 8a74d608e6300b698b469a5202539f59a65707b5 (patch) | |
tree | 9aa7abbce52f08c788b87fc47b90a360dd9a4c98 | |
parent | 0914270da35fdd3db7d58ac250edd258a5d55c40 (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): |