"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "manila/tests/share/drivers/test_lvm.py" between
manila-11.0.0.tar.gz and manila-11.0.1.tar.gz

About: OpenStack Manila provides “Shared Filesystems as a service”.
The "Victoria" series (latest release).

test_lvm.py  (manila-11.0.0):test_lvm.py  (manila-11.0.1)
skipping to change at line 466 skipping to change at line 466
self.assertEqual(self._driver._get_helper(share_cifs), self.assertEqual(self._driver._get_helper(share_cifs),
self._helper_cifs) self._helper_cifs)
self.assertEqual(self._driver._get_helper(share_nfs), self.assertEqual(self._driver._get_helper(share_nfs),
self._helper_nfs) self._helper_nfs)
self.assertRaises(exception.InvalidShare, self._driver._get_helper, self.assertRaises(exception.InvalidShare, self._driver._get_helper,
share_fake) share_fake)
def _get_mount_path(self, share): def _get_mount_path(self, share):
return os.path.join(CONF.lvm_share_export_root, share['name']) return os.path.join(CONF.lvm_share_export_root, share['name'])
def test__unmount_device(self): @ddt.data(True, False)
def test__unmount_device_with_retry_busy_device(self, retry_busy_device):
execute_sideeffects = [
exception.ProcessExecutionError(stderr='device is busy'),
exception.ProcessExecutionError(stderr='target is busy'),
None, None
] if retry_busy_device else [None, None]
mount_path = self._get_mount_path(self.share) mount_path = self._get_mount_path(self.share)
self._os.path.exists.return_value = True self._os.path.exists.return_value = True
self.mock_object(self._driver, '_execute') self.mock_object(self._driver, '_execute', mock.Mock(
self._driver._unmount_device(self.share) side_effect=execute_sideeffects))
self._driver._execute.assert_any_call('umount', '-f', mount_path,
run_as_root=True) self._driver._unmount_device(self.share,
self._driver._execute.assert_any_call('rmdir', mount_path, retry_busy_device=retry_busy_device)
run_as_root=True)
num_of_times_umount_is_called = 3 if retry_busy_device else 1
self._os.path.exists.assert_called_with(mount_path) self._os.path.exists.assert_called_with(mount_path)
self._driver._execute.assert_has_calls([
mock.call('umount', '-f', mount_path, run_as_root=True),
] * num_of_times_umount_is_called + [
mock.call('rmdir', mount_path, run_as_root=True)
])
def test_extend_share(self): def test_extend_share(self):
local_path = self._driver._get_local_path(self.share) local_path = self._driver._get_local_path(self.share)
self.mock_object(self._driver, '_extend_container') self.mock_object(self._driver, '_extend_container')
self.mock_object(self._driver, '_execute') self.mock_object(self._driver, '_execute')
self._driver.extend_share(self.share, 3) self._driver.extend_share(self.share, 3)
self._driver._extend_container.assert_called_once_with(self.share, self._driver._extend_container.assert_called_once_with(self.share,
local_path, 3) local_path, 3)
def test_ssh_exec_as_root(self): def test_ssh_exec_as_root(self):
 End of changes. 3 change blocks. 
7 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)