From b32064cdf2d5c70140a84e2497931941c4ee6887 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Tue, 30 Jul 2019 13:49:30 -0700 Subject: [PATCH] Fix a unit test for new octavia-lib A patch[1] introduced a startup check for the socket paths that impacted a unit test checking debtcollector is finding the new octavia-lib location of the DriverLibrary. This patch correctly mocks out this check for this unit test. [1] https://review.opendev.org/#/c/665027/ Change-Id: Ife93834654385430d6a333d3d6ee67b719b6c37e --- lower-constraints.txt | 4 ++-- octavia/tests/unit/api/drivers/test_driver_lib.py | 6 +++++- requirements.txt | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 92189084bd..9ef40ac0a3 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -72,7 +72,7 @@ munch==2.2.0 netaddr==0.7.19 netifaces==0.10.4 networkx==1.11 -octavia-lib==1.2.0 +octavia-lib==1.3.1 openstacksdk==0.12.0 os-client-config==1.29.0 os-service-types==1.2.0 @@ -155,7 +155,7 @@ stevedore==1.20.0 taskflow==2.16.0 tempest==17.1.0 Tempita==0.5.2 -tenacity==4.9.0 +tenacity==5.0.4 testrepository==0.0.18 testresources==2.0.0 testscenarios==0.4 diff --git a/octavia/tests/unit/api/drivers/test_driver_lib.py b/octavia/tests/unit/api/drivers/test_driver_lib.py index c94616e335..9a7cf9ecf3 100644 --- a/octavia/tests/unit/api/drivers/test_driver_lib.py +++ b/octavia/tests/unit/api/drivers/test_driver_lib.py @@ -26,6 +26,8 @@ # License for the specific language governing permissions and limitations # under the License. +import mock + import octavia_lib.api.drivers.driver_lib as lib_driver_lib from octavia.api.drivers import driver_lib @@ -38,6 +40,8 @@ class TestDriverLib(base.TestCase): super(TestDriverLib, self).setUp() # Silly test to check that debtcollector moves is working - def test_driver_lib_exists(self): + @mock.patch('octavia_lib.api.drivers.driver_lib.DriverLibrary.' + '_check_for_socket_ready') + def test_driver_lib_exists(self, mock_ready): driver_lib_class = driver_lib.DriverLibrary() self.assertIsInstance(driver_lib_class, lib_driver_lib.DriverLibrary) diff --git a/requirements.txt b/requirements.txt index c4469bb81b..5f90455d3e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -41,11 +41,11 @@ taskflow>=2.16.0 # Apache-2.0 diskimage-builder!=1.6.0,!=1.7.0,!=1.7.1,>=1.1.2 # Apache-2.0 futures>=3.0.0;python_version=='2.7' or python_version=='2.6' # BSD castellan>=0.16.0 # Apache-2.0 -tenacity>=4.9.0 # Apache-2.0 +tenacity>=5.0.4 # Apache-2.0 distro>=1.2.0 # Apache-2.0 jsonschema>=2.6.0 # MIT debtcollector>=1.19.0 # Apache-2.0 -octavia-lib>=1.2.0 # Apache-2.0 +octavia-lib>=1.3.1 # Apache-2.0 #for the amphora api Flask!=0.11,>=0.10 # BSD