Merge "An alternate way to fix retype notifier test case"

This commit is contained in:
Zuul 2018-12-12 18:28:03 +00:00 committed by Gerrit Code Review
commit 0b70bd7046
2 changed files with 12 additions and 0 deletions

View File

@ -177,6 +177,12 @@ class GoogleBackupDriverTestCase(test.TestCase):
for _i in range(0, 64):
self.volume_file.write(os.urandom(units.Ki))
self.size_volume_file += 1024
# 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)
@gcs_client
def test_backup(self):

View File

@ -67,6 +67,12 @@ class BackupNFSShareTestCase(test.TestCase):
super(BackupNFSShareTestCase, self).setUp()
self.ctxt = context.get_admin_context()
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):
self.override_config('backup_share', None)