"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/tests/unit/backup/drivers/test_backup_nfs.py" between
cinder-13.0.2.tar.gz and cinder-13.0.3.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Rocky" series (latest release).

test_backup_nfs.py  (cinder-13.0.2):test_backup_nfs.py  (cinder-13.0.3)
skipping to change at line 69 skipping to change at line 69
FAKE_BACKUP_ID) FAKE_BACKUP_ID)
FAKE_EGID = 1234 FAKE_EGID = 1234
@ddt.ddt @ddt.ddt
class BackupNFSShareTestCase(test.TestCase): class BackupNFSShareTestCase(test.TestCase):
def setUp(self): def setUp(self):
super(BackupNFSShareTestCase, self).setUp() super(BackupNFSShareTestCase, self).setUp()
self.ctxt = context.get_admin_context() self.ctxt = context.get_admin_context()
self.mock_object(nfs, 'LOG') self.mock_object(nfs, 'LOG')
# Note(yikun): It mocks out the backup notifier to avoid to leak
# notifications into other test.
notify_patcher = mock.patch(
'cinder.volume.utils.notify_about_backup_usage')
notify_patcher.start()
self.addCleanup(notify_patcher.stop)
def test_check_configuration_no_backup_share(self): def test_check_configuration_no_backup_share(self):
self.override_config('backup_share', None) self.override_config('backup_share', None)
self.mock_object(nfs.NFSBackupDriver, '_init_backup_repo_path', self.mock_object(nfs.NFSBackupDriver, '_init_backup_repo_path',
return_value=FAKE_BACKUP_PATH) return_value=FAKE_BACKUP_PATH)
driver = nfs.NFSBackupDriver(self.ctxt) driver = nfs.NFSBackupDriver(self.ctxt)
self.assertRaises(exception.InvalidConfigurationValue, self.assertRaises(exception.InvalidConfigurationValue,
driver.check_for_setup_error) driver.check_for_setup_error)
skipping to change at line 121 skipping to change at line 127
self.assertEqual(FAKE_BACKUP_PATH, path) self.assertEqual(FAKE_BACKUP_PATH, path)
mock_remotefsclient.mount.assert_called_once_with(FAKE_BACKUP_SHARE) mock_remotefsclient.mount.assert_called_once_with(FAKE_BACKUP_SHARE)
mock_remotefsclient.get_mount_point.assert_called_once_with( mock_remotefsclient.get_mount_point.assert_called_once_with(
FAKE_BACKUP_SHARE) FAKE_BACKUP_SHARE)
mock_execute_calls = [] mock_execute_calls = []
if file_gid != FAKE_EGID: if file_gid != FAKE_EGID:
mock_execute_calls.append( mock_execute_calls.append(
mock.call('chgrp', mock.call('chgrp',
'-R',
FAKE_EGID, FAKE_EGID,
path, path,
root_helper=driver._root_helper, root_helper=driver._root_helper,
run_as_root=True)) run_as_root=True))
if not (file_mode & stat.S_IWGRP): if not (file_mode & stat.S_IWGRP):
mock_execute_calls.append( mock_execute_calls.append(
mock.call('chmod', mock.call('chmod',
'-R',
'g+w', 'g+w',
path, path,
root_helper=driver._root_helper, root_helper=driver._root_helper,
run_as_root=True)) run_as_root=True))
mock_execute.assert_has_calls(mock_execute_calls, any_order=True) mock_execute.assert_has_calls(mock_execute_calls, any_order=True)
self.assertEqual(len(mock_execute_calls), mock_execute.call_count) self.assertEqual(len(mock_execute_calls), mock_execute.call_count)
def fake_md5(arg): def fake_md5(arg):
class result(object): class result(object):
 End of changes. 3 change blocks. 
0 lines changed or deleted 8 lines changed or added

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