From: Jenkins Date: Fri, 9 Oct 2015 01:51:43 +0000 (+0000) Subject: Merge "Add insecure option for swift backup" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=95fd3df486897bae192b93d8a568f301809baeb8;p=openstack-build%2Fcinder-build.git Merge "Add insecure option for swift backup" --- 95fd3df486897bae192b93d8a568f301809baeb8 diff --cc cinder/tests/unit/test_backup_swift.py index ca1eef6ce,5c57b2b28..faa4b9db1 --- a/cinder/tests/unit/test_backup_swift.py +++ b/cinder/tests/unit/test_backup_swift.py @@@ -139,9 -129,43 +143,44 @@@ class BackupSwiftTestCase(test.TestCase 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)