From f79e842601dc2fa909372d2f4e2274e52985b87e Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Ollivier?= Date: Fri, 14 Sep 2018 07:11:13 +0200 Subject: [PATCH] Update get_openstack_version() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It takes Rocky maximum version into account. Change-Id: I55469de4a63f1f824222660130a20d7fd8fa42c3 Signed-off-by: Cédric Ollivier (cherry picked from commit 2098c49184b1c97b89b4d88dffa2e2a9b3571f04) --- functest/tests/unit/utils/test_functest_utils.py | 4 ++-- functest/utils/functest_utils.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index 2b98267c4..ab90de595 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -261,7 +261,7 @@ class FunctestUtilsTesting(unittest.TestCase): def test_openstack_version1(self, *args): cloud = mock.Mock() self.assertEqual(functest_utils.get_openstack_version( - cloud), "Rocky or newer") + cloud), "Rocky") args[0].assert_called_once_with(cloud) @mock.patch('functest.utils.functest_utils.get_nova_version', @@ -327,7 +327,7 @@ class FunctestUtilsTesting(unittest.TestCase): def test_openstack_version10(self, *args): cloud = mock.Mock() self.assertEqual( - functest_utils.get_openstack_version(cloud), "Rocky or newer") + functest_utils.get_openstack_version(cloud), "Master") args[0].assert_called_once_with(cloud) @mock.patch('functest.utils.functest_utils.get_nova_version', diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 1993f1e83..dd2bf1932 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -109,8 +109,10 @@ def get_openstack_version(cloud): version = get_nova_version(cloud) try: assert version - if version > (2, 60): - osversion = "Rocky or newer" + if version > (2, 65): + osversion = "Master" + elif version > (2, 60): + osversion = "Rocky" elif version > (2, 53): osversion = "Queens" elif version > (2, 42): -- 2.16.6