From e79cf7bf3302aadc0031806c964bab077f64994b Mon Sep 17 00:00:00 2001 From: vponomaryov Date: Thu, 2 Mar 2017 14:53:59 +0200 Subject: [PATCH] Fix 3 CI breakages 1) Increase default RAM value in manila flavor to be able to use manila service image with new 64bit architecture. 2) Fix test requirement on "hacking" lib to avoid pep8 breakage. 3) Fix unstable maprfs driver unit test that depends on local hostnames and IPs. Change-Id: Ib36113e33e3616984be5864fbaf73c1fc5d7a315 Closes-Bug: #1669412 Closes-Bug: #1659162 --- devstack/settings | 2 +- .../tests/share/drivers/maprfs/test_maprfs.py | 25 ++++++++++--------- test-requirements.txt | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/devstack/settings b/devstack/settings index a5b72e3d2f..cc3c68c369 100644 --- a/devstack/settings +++ b/devstack/settings @@ -117,7 +117,7 @@ MANILA_SERVICE_INSTANCE_PASSWORD=${MANILA_SERVICE_INSTANCE_PASSWORD:-"manila"} MANILA_SERVICE_VM_FLAVOR_REF=${MANILA_SERVICE_VM_FLAVOR_REF:-100} MANILA_SERVICE_VM_FLAVOR_NAME=${MANILA_SERVICE_VM_FLAVOR_NAME:-"manila-service-flavor"} -MANILA_SERVICE_VM_FLAVOR_RAM=${MANILA_SERVICE_VM_FLAVOR_RAM:-128} +MANILA_SERVICE_VM_FLAVOR_RAM=${MANILA_SERVICE_VM_FLAVOR_RAM:-192} MANILA_SERVICE_VM_FLAVOR_DISK=${MANILA_SERVICE_VM_FLAVOR_DISK:-0} MANILA_SERVICE_VM_FLAVOR_VCPUS=${MANILA_SERVICE_VM_FLAVOR_VCPUS:-1} diff --git a/manila/tests/share/drivers/maprfs/test_maprfs.py b/manila/tests/share/drivers/maprfs/test_maprfs.py index 77a718940f..34c6837d68 100644 --- a/manila/tests/share/drivers/maprfs/test_maprfs.py +++ b/manila/tests/share/drivers/maprfs/test_maprfs.py @@ -14,8 +14,6 @@ """Unit tests for MapRFS native protocol driver module.""" -import socket - import mock from oslo_concurrency import processutils from oslo_config import cfg @@ -50,9 +48,6 @@ class MapRFSNativeShareDriverTestCase(test.TestCase): self.fake_conf = config.Configuration(None) self.cluster_name = 'fake' - self._driver = maprfs.MapRFSNativeShareDriver( - configuration=self.fake_conf) - self._driver.do_setup(self._context) export_locations = {0: {'path': '/share-0'}} export_locations[0]['el_metadata'] = { 'volume-name': 'share-0'} @@ -78,14 +73,20 @@ class MapRFSNativeShareDriverTestCase(test.TestCase): self.hadoop_bin = '/usr/bin/hadoop' self.maprcli_bin = '/usr/bin/maprcli' + self.mock_object(utils, 'execute') + self.mock_object( + mapru.socket, 'gethostname', mock.Mock(return_value='testserver')) + self.mock_object( + mapru.socket, 'gethostbyname_ex', mock.Mock(return_value=( + 'localhost', + ['localhost.localdomain', + mapru.socket.gethostname.return_value], + ['127.0.0.1', self.local_ip]))) + self._driver = maprfs.MapRFSNativeShareDriver( + configuration=self.fake_conf) + self._driver.do_setup(self._context) self._driver.api.get_share_metadata = mock.Mock(return_value={}) self._driver.api.update_share_metadata = mock.Mock() - utils.execute = mock.Mock() - socket.gethostname = mock.Mock(return_value='testserver') - socket.gethostbyname_ex = mock.Mock(return_value=( - 'localhost', - ['localhost.localdomain', 'testserver'], - ['127.0.0.1', self.local_ip])) def test_do_setup(self): self._driver.do_setup(self._context) @@ -638,7 +639,7 @@ class MapRFSNativeShareDriverTestCase(test.TestCase): self._driver._maprfs_util._execute, "fake", "cmd") def test__execute_local(self): - utils.execute = mock.Mock(return_value=("fake", 0)) + self.mock_object(utils, 'execute', mock.Mock(return_value=("fake", 0))) self._driver._maprfs_util._execute("fake", "cmd") diff --git a/test-requirements.txt b/test-requirements.txt index 6dedd23614..b43c0d832a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. # hacking should be first -hacking<0.11,>=0.10.2 +hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0 bashate>=0.2 # Apache-2.0 coverage>=4.0 # Apache-2.0