diff options
-rw-r--r-- | functest/tests/unit/utils/test_functest_utils.py | 8 | ||||
-rw-r--r-- | functest/utils/functest_utils.py | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/functest/tests/unit/utils/test_functest_utils.py b/functest/tests/unit/utils/test_functest_utils.py index f6a80e264..4f3f16f23 100644 --- a/functest/tests/unit/utils/test_functest_utils.py +++ b/functest/tests/unit/utils/test_functest_utils.py @@ -309,6 +309,14 @@ class FunctestUtilsTesting(unittest.TestCase): args[0].assert_called_once_with(cloud) @mock.patch('functest.utils.functest_utils.get_nova_version', + return_value=(2, 78)) + def test_openstack_version12(self, *args): + cloud = mock.Mock() + self.assertEqual(functest_utils.get_openstack_version( + cloud), "Train") + 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 ef5dac72a..a1434adc2 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -110,11 +110,14 @@ def get_openstack_version(cloud): - OpenStack release - Unknown on operation error """ + # pylint: disable=too-many-branches version = get_nova_version(cloud) try: assert version - if version > (2, 72): + if version > (2, 79): osversion = "Master" + elif version > (2, 72): + osversion = "Train" elif version > (2, 65): osversion = "Stein" elif version > (2, 60): |