Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronise yoga with upstream #42

Open
wants to merge 6 commits into
base: stackhpc/yoga
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- ^doc/.*$
- ^releasenotes/.*$
- cinder-plugin-ceph-tempest:
voting: false
irrelevant-files: &gate-irrelevant-files
- ^(test-|)requirements.txt$
- ^.*\.rst$
Expand Down Expand Up @@ -90,6 +91,7 @@
- cinder-grenade-mn-sub-volbak:
irrelevant-files: *gate-irrelevant-files
- cinder-plugin-ceph-tempest:
voting: false
irrelevant-files: *gate-irrelevant-files
- tempest-integrated-storage:
irrelevant-files: *gate-irrelevant-files
Expand Down
17 changes: 10 additions & 7 deletions cinder/tests/unit/image/test_format_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,16 @@ def test_qcow2_safety_checks(self):
self.assertTrue(inspector.safety_check_allow_backing_file())

# A data-file makes it unsafe
fn = self._create_img('qcow2', 5 * units.Mi,
options={'data_file': data_fn,
'data_file_raw': 'on'})
inspector = format_inspector.QcowInspector.from_file(fn)
self.assertFalse(inspector.safety_check())
# ... and it remains unsafe even if we allow a backing file
self.assertFalse(inspector.safety_check_allow_backing_file())
# Note(lajoskatona): This image create fails on bionic due to
# old qemu-img utilities, let's skip this only test from yoga
# A data-file makes it unsafe
# fn = self._create_img('qcow2', 5 * units.Mi,
# options={'data_file': data_fn,
# 'data_file_raw': 'on'})
# inspector = format_inspector.QcowInspector.from_file(fn)
# self.assertFalse(inspector.safety_check())
# # ... and it remains unsafe even if we allow a backing file
# self.assertFalse(inspector.safety_check_allow_backing_file())

# Trying to load a non-QCOW file is an error
self.assertRaises(format_inspector.ImageFormatError,
Expand Down
40 changes: 12 additions & 28 deletions cinder/tests/unit/volume/drivers/test_quobyte.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@ def test_extend_volume(self, is_attached, mock_remote_attached):

img_info = imageutils.QemuImgInfo(qemu_img_info_output, format='json')

image_utils.qemu_img_info = mock.Mock(return_value=img_info)
image_utils.resize_image = mock.Mock()
self.mock_object(image_utils, 'qemu_img_info', return_value=img_info)
self.mock_object(image_utils, 'resize_image')

mock_remote_attached.return_value = is_attached

Expand All @@ -979,7 +979,6 @@ def test_copy_volume_from_snapshot(self):

vol_dir = os.path.join(self.TEST_MNT_POINT_BASE,
drv._get_hash_str(self.TEST_QUOBYTE_VOLUME))
src_vol_path = os.path.join(vol_dir, src_volume['name'])
dest_vol_path = os.path.join(vol_dir, dest_volume['name'])
info_path = os.path.join(vol_dir, src_volume['name']) + '.info'

Expand All @@ -1000,11 +999,11 @@ def test_copy_volume_from_snapshot(self):
img_info = imageutils.QemuImgInfo(qemu_img_output, format='json')

# mocking and testing starts here
image_utils.convert_image = mock.Mock()
self.mock_object(image_utils, 'convert_image')
drv._read_info_file = mock.Mock(return_value=
{'active': snap_file,
snapshot['id']: snap_file})
image_utils.qemu_img_info = mock.Mock(return_value=img_info)
self.mock_object(image_utils, 'qemu_img_info', return_value=img_info)
drv._set_rw_permissions = mock.Mock()

drv._copy_volume_from_snapshot(snapshot, dest_volume, size)
Expand All @@ -1015,11 +1014,6 @@ def test_copy_volume_from_snapshot(self):
force_share=True,
run_as_root=False,
allow_qcow2_backing_file=True)
(mock_convert.
assert_called_once_with(src_vol_path,
dest_vol_path,
'raw',
run_as_root=self._driver._execute_as_root))
drv._set_rw_permissions.assert_called_once_with(dest_vol_path)

@mock.patch.object(quobyte.QuobyteDriver, "_fallocate_file")
Expand Down Expand Up @@ -1059,11 +1053,12 @@ def test_copy_volume_from_snapshot_cached(self, os_ac_mock,
img_info = imageutils.QemuImgInfo(qemu_img_output, format='json')

# mocking and testing starts here
mock_convert = self.mock_object(image_utils, 'convert_image')
image_utils.convert_image = mock.Mock()
drv._read_info_file = mock.Mock(return_value=
{'active': snap_file,
snapshot['id']: snap_file})
image_utils.qemu_img_info = mock.Mock(return_value=img_info)
self.mock_object(image_utils, 'qemu_img_info', return_value=img_info)
drv._set_rw_permissions = mock.Mock()
shutil.copyfile = mock.Mock()

Expand Down Expand Up @@ -1123,11 +1118,11 @@ def test_copy_volume_from_snapshot_not_cached_overlay(self, os_ac_mock,
img_info = imageutils.QemuImgInfo(qemu_img_output, format='json')

# mocking and testing starts here
image_utils.convert_image = mock.Mock()
self.mock_object(image_utils, 'convert_image')
drv._read_info_file = mock.Mock(return_value=
{'active': snap_file,
snapshot['id']: snap_file})
image_utils.qemu_img_info = mock.Mock(return_value=img_info)
self.mock_object(image_utils, 'qemu_img_info', return_value=img_info)
drv._set_rw_permissions = mock.Mock()
drv._create_overlay_volume_from_snapshot = mock.Mock()

Expand All @@ -1141,11 +1136,6 @@ def test_copy_volume_from_snapshot_not_cached_overlay(self, os_ac_mock,
force_share=True,
run_as_root=False,
allow_qcow2_backing_file=True)
(mock_convert.
assert_called_once_with(
src_vol_path,
drv._local_volume_from_snap_cache_path(snapshot), 'qcow2',
run_as_root=self._driver._execute_as_root))
os_sl_mock.assert_called_once_with(
src_vol_path,
drv._local_volume_from_snap_cache_path(snapshot) + '.parent-'
Expand All @@ -1166,7 +1156,6 @@ def test_copy_volume_from_snapshot_not_cached(self, qb_falloc_mock):

vol_dir = os.path.join(self.TEST_MNT_POINT_BASE,
drv._get_hash_str(self.TEST_QUOBYTE_VOLUME))
src_vol_path = os.path.join(vol_dir, src_volume['name'])
dest_vol_path = os.path.join(vol_dir, dest_volume['name'])
info_path = os.path.join(vol_dir, src_volume['name']) + '.info'

Expand All @@ -1190,13 +1179,13 @@ def test_copy_volume_from_snapshot_not_cached(self, qb_falloc_mock):
img_info = imageutils.QemuImgInfo(qemu_img_output, format='json')

# mocking and testing starts here
image_utils.convert_image = mock.Mock()
self.mock_object(image_utils, 'convert_image')
drv._read_info_file = mock.Mock(return_value=
{'active': snap_file,
snapshot['id']: snap_file})
image_utils.qemu_img_info = mock.Mock(return_value=img_info)
self.mock_object(image_utils, 'qemu_img_info', return_value=img_info)
drv._set_rw_permissions = mock.Mock()
shutil.copyfile = mock.Mock()
self.mock_object(shutil, 'copyfile')

drv._copy_volume_from_snapshot(snapshot, dest_volume, size)

Expand All @@ -1206,11 +1195,6 @@ def test_copy_volume_from_snapshot_not_cached(self, qb_falloc_mock):
force_share=True,
run_as_root=False,
allow_qcow2_backing_file=True)
(mock_convert.
assert_called_once_with(
src_vol_path,
drv._local_volume_from_snap_cache_path(snapshot), 'raw',
run_as_root=self._driver._execute_as_root))
qb_falloc_mock.assert_called_once_with(dest_vol_path, size)
shutil.copyfile.assert_called_once_with(cache_path, dest_vol_path)
drv._set_rw_permissions.assert_called_once_with(dest_vol_path)
Expand Down Expand Up @@ -1269,7 +1253,7 @@ def test_initialize_connection(self):
img_info = imageutils.QemuImgInfo(qemu_img_output, format='json')

drv.get_active_image_from_info = mock.Mock(return_value=volume['name'])
image_utils.qemu_img_info = mock.Mock(return_value=img_info)
self.mock_object(image_utils, 'qemu_img_info', return_value=img_info)

conn_info = drv.initialize_connection(volume, None)

Expand Down
6 changes: 6 additions & 0 deletions cinder/volume/drivers/dell_emc/powerflex/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,12 @@ def _initialize_connection(self, vol_or_snap, connector, vol_size):
connection_properties["scaleIO_volume_id"] = vol_or_snap.provider_id
connection_properties["config_group"] = self.configuration.config_group
connection_properties["failed_over"] = self._is_failed_over
connection_properties["verify_certificate"] = (
self._get_client().verify_certificate
)
connection_properties["certificate_path"] = (
self._get_client().certificate_path
)

if vol_size is not None:
extra_specs = self._get_volumetype_extraspecs(vol_or_snap)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
fixes:
- |
Dell PowerFlex driver `bug #1998136
<https://bugs.launchpad.net/cinder/+bug/1998136>`_:
When using self signed certificates, the option
sent to os-brick via the connection_properties was
not correctly handled. It has now been fixed by
adding the 'verify_certificate' and 'certificate_path'
to the driver when initializing the connection.
Loading