Merge "add unittest for volume encryption types"
This commit is contained in:
commit
ef47489dc1
@ -30,6 +30,15 @@ class TestEncryptionTypesClient(base.BaseServiceTest):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UPDATE_ENCRYPTION_TYPE = {
|
||||||
|
"encryption": {
|
||||||
|
"key_size": 64,
|
||||||
|
"provider": "LuksEncryptor",
|
||||||
|
"control_location": "front-end",
|
||||||
|
"cipher": "aes-xts-plain64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FAKE_INFO_ENCRYPTION_TYPE = {
|
FAKE_INFO_ENCRYPTION_TYPE = {
|
||||||
"encryption": {
|
"encryption": {
|
||||||
"name": "FakeEncryptionType",
|
"name": "FakeEncryptionType",
|
||||||
@ -50,10 +59,8 @@ class TestEncryptionTypesClient(base.BaseServiceTest):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestEncryptionTypesClient, self).setUp()
|
super(TestEncryptionTypesClient, self).setUp()
|
||||||
fake_auth = fake_auth_provider.FakeAuthProvider()
|
fake_auth = fake_auth_provider.FakeAuthProvider()
|
||||||
self.client = encryption_types_client.EncryptionTypesClient(fake_auth,
|
self.client = encryption_types_client.EncryptionTypesClient(
|
||||||
'volume',
|
fake_auth, 'volume', 'regionOne')
|
||||||
'regionOne'
|
|
||||||
)
|
|
||||||
|
|
||||||
def _test_create_encryption(self, bytes_body=False):
|
def _test_create_encryption(self, bytes_body=False):
|
||||||
self.check_service_client_function(
|
self.check_service_client_function(
|
||||||
@ -101,3 +108,16 @@ class TestEncryptionTypesClient(base.BaseServiceTest):
|
|||||||
{},
|
{},
|
||||||
volume_type_id="cbc36478b0bd8e67e89",
|
volume_type_id="cbc36478b0bd8e67e89",
|
||||||
status=202)
|
status=202)
|
||||||
|
|
||||||
|
def test_update_encryption_type_with_str_body(self):
|
||||||
|
self._test_update_encryption_type()
|
||||||
|
|
||||||
|
def test_update_encryption_type_with_bytes_body(self):
|
||||||
|
self._test_update_encryption_type(bytes_body=True)
|
||||||
|
|
||||||
|
def _test_update_encryption_type(self, bytes_body=False):
|
||||||
|
self.check_service_client_function(
|
||||||
|
self.client.update_encryption_type,
|
||||||
|
'tempest.lib.common.rest_client.RestClient.put',
|
||||||
|
self.UPDATE_ENCRYPTION_TYPE,
|
||||||
|
bytes_body, volume_type_id="cbc36478b0bd8e67e89")
|
||||||
|
Loading…
Reference in New Issue
Block a user