diff --git a/cinder/tests/unit/backup/drivers/test_backup_google.py b/cinder/tests/unit/backup/drivers/test_backup_google.py index e39369d6719..61e9fd51817 100644 --- a/cinder/tests/unit/backup/drivers/test_backup_google.py +++ b/cinder/tests/unit/backup/drivers/test_backup_google.py @@ -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): diff --git a/cinder/tests/unit/backup/drivers/test_backup_nfs.py b/cinder/tests/unit/backup/drivers/test_backup_nfs.py index c65d0131fcc..eeafc9809ce 100644 --- a/cinder/tests/unit/backup/drivers/test_backup_nfs.py +++ b/cinder/tests/unit/backup/drivers/test_backup_nfs.py @@ -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)