swift_dr.SwiftBackupDriver,
self.ctxt)
+ @ddt.data(
+ {'auth': 'single_user', 'insecure': True},
+ {'auth': 'single_user', 'insecure': False},
+ {'auth': 'per_user', 'insecure': True},
+ {'auth': 'per_user', 'insecure': False},
+ )
+ @ddt.unpack
+ def test_backup_swift_auth_insecure(self, auth, insecure):
+ self.override_config("backup_swift_auth_insecure", insecure)
+ self.override_config('backup_swift_auth', auth)
+ if auth == 'single_user':
+ self.override_config('backup_swift_user', 'swift-user')
+
+ mock_connection = self.mock_object(swift, 'Connection')
+
+ swift_dr.SwiftBackupDriver(self.ctxt)
+
+ if auth == 'single_user':
+ mock_connection.assert_called_once_with(insecure=insecure,
+ authurl=ANY,
+ auth_version=ANY,
+ tenant_name=ANY,
+ user=ANY,
+ key=ANY,
+ retries=ANY,
+ starting_backoff=ANY,
+ cacert=ANY)
+ else:
+ mock_connection.assert_called_once_with(insecure=insecure,
+ retries=ANY,
+ preauthurl=ANY,
+ preauthtoken=ANY,
+ starting_backoff=ANY,
+ cacert=ANY)
+
def test_backup_uncompressed(self):
- self._create_backup_db_entry()
+ volume_id = '2b9f10a3-42b4-4fdf-b316-000000ceb039'
+ self._create_backup_db_entry(volume_id=volume_id)
self.flags(backup_compression_algorithm='none')
service = swift_dr.SwiftBackupDriver(self.ctxt)
self.volume_file.seek(0)