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
(cherry picked from commit e79cf7bf33)
This commit is contained in:
vponomaryov 2017-03-02 14:53:59 +02:00 committed by Valeriy Ponomaryov
parent 8d3185e6b5
commit 5d31673094
3 changed files with 15 additions and 14 deletions

View File

@ -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}

View File

@ -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")

View File

@ -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