Merge "Add CinderVolumeTypes.create_and_list_encryption_type"
This commit is contained in:
commit
dc4dce22d8
@ -887,6 +887,26 @@
|
|||||||
failure_rate:
|
failure_rate:
|
||||||
max: 0
|
max: 0
|
||||||
|
|
||||||
|
CinderVolumeTypes.create_and_list_encryption_type:
|
||||||
|
-
|
||||||
|
args:
|
||||||
|
specs:
|
||||||
|
provider: "LuksEncryptor"
|
||||||
|
cipher: "aes-xts-plain64"
|
||||||
|
key_size: 512
|
||||||
|
control_location: "front-end"
|
||||||
|
runner:
|
||||||
|
type: "constant"
|
||||||
|
times: 4
|
||||||
|
concurrency: 2
|
||||||
|
context:
|
||||||
|
users:
|
||||||
|
tenants: 2
|
||||||
|
users_per_tenant: 2
|
||||||
|
sla:
|
||||||
|
failure_rate:
|
||||||
|
max: 0
|
||||||
|
|
||||||
CinderVolumes.list_transfers:
|
CinderVolumes.list_transfers:
|
||||||
-
|
-
|
||||||
args:
|
args:
|
||||||
|
@ -453,3 +453,13 @@ class CinderScenario(scenario.OpenStackScenario):
|
|||||||
"""
|
"""
|
||||||
return self.admin_clients("cinder").volume_encryption_types.create(
|
return self.admin_clients("cinder").volume_encryption_types.create(
|
||||||
volume_type, specs)
|
volume_type, specs)
|
||||||
|
|
||||||
|
@atomic.action_timer("cinder.list_encryption_type")
|
||||||
|
def _list_encryption_type(self, search_opts=None):
|
||||||
|
"""List all volume encryption types.
|
||||||
|
|
||||||
|
:param search_opts: Options used when search for encryption types
|
||||||
|
:return: a list of :class: VolumeEncryptionType instances
|
||||||
|
"""
|
||||||
|
return self.admin_clients("cinder").volume_encryption_types.list(
|
||||||
|
search_opts)
|
||||||
|
@ -56,3 +56,27 @@ class CreateVolumeTypeAndEncryptionType(cinder_utils.CinderScenario):
|
|||||||
"""
|
"""
|
||||||
volume_type = self._create_volume_type(**kwargs)
|
volume_type = self._create_volume_type(**kwargs)
|
||||||
self._create_encryption_type(volume_type, specs)
|
self._create_encryption_type(volume_type, specs)
|
||||||
|
|
||||||
|
|
||||||
|
@validation.required_services(consts.Service.CINDER)
|
||||||
|
@validation.required_openstack(admin=True)
|
||||||
|
@scenario.configure(context={"admin_cleanup": ["cinder"]},
|
||||||
|
name="CinderVolumeTypes.create_and_list_"
|
||||||
|
"encryption_type")
|
||||||
|
class CreateAndListEncryptionType(cinder_utils.CinderScenario):
|
||||||
|
|
||||||
|
def run(self, specs, search_opts=None, **kwargs):
|
||||||
|
"""Create and list encryption type
|
||||||
|
|
||||||
|
This scenario firstly creates a volume type, secondly creates an
|
||||||
|
encryption type for the volume type, thirdly lists all encryption
|
||||||
|
types.
|
||||||
|
|
||||||
|
:param specs: the encryption type specifications to add
|
||||||
|
:param search_opts: Options used when search for encryption types
|
||||||
|
:param kwargs: Optional parameters used during volume
|
||||||
|
type creation.
|
||||||
|
"""
|
||||||
|
volume_type = self._create_volume_type(**kwargs)
|
||||||
|
self._create_encryption_type(volume_type, specs)
|
||||||
|
self._list_encryption_type(search_opts)
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"CinderVolumeTypes.create_and_list_encryption_type": [
|
||||||
|
{
|
||||||
|
"args": {
|
||||||
|
"specs": {
|
||||||
|
"provider": "LuksEncryptor",
|
||||||
|
"cipher": "aes-xts-plain64",
|
||||||
|
"key_size": 512,
|
||||||
|
"control_location": "front-end"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runner": {
|
||||||
|
"type": "constant",
|
||||||
|
"times": 4,
|
||||||
|
"concurrency": 2
|
||||||
|
},
|
||||||
|
"context": {
|
||||||
|
"users": {
|
||||||
|
"tenants": 2,
|
||||||
|
"users_per_tenant": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sla": {
|
||||||
|
"failure_rate": {
|
||||||
|
"max": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
CinderVolumeTypes.create_and_list_encryption_type:
|
||||||
|
-
|
||||||
|
args:
|
||||||
|
specs:
|
||||||
|
provider: "LuksEncryptor"
|
||||||
|
cipher: "aes-xts-plain64"
|
||||||
|
key_size: 512
|
||||||
|
control_location: "front-end"
|
||||||
|
runner:
|
||||||
|
type: "constant"
|
||||||
|
times: 4
|
||||||
|
concurrency: 2
|
||||||
|
context:
|
||||||
|
users:
|
||||||
|
tenants: 2
|
||||||
|
users_per_tenant: 2
|
||||||
|
sla:
|
||||||
|
failure_rate:
|
||||||
|
max: 0
|
@ -400,6 +400,14 @@ class CinderScenarioTestCase(test.ScenarioTestCase):
|
|||||||
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
||||||
"cinder.create_encryption_type")
|
"cinder.create_encryption_type")
|
||||||
|
|
||||||
|
def test__list_encryption_type(self):
|
||||||
|
return_encryption_types_list = self.scenario._list_encryption_type()
|
||||||
|
client = self.admin_clients("cinder")
|
||||||
|
self.assertEqual(client.volume_encryption_types.list.return_value,
|
||||||
|
return_encryption_types_list)
|
||||||
|
self._test_atomic_action_timer(self.scenario.atomic_actions(),
|
||||||
|
"cinder.list_encryption_type")
|
||||||
|
|
||||||
def test__delete_volume_type(self):
|
def test__delete_volume_type(self):
|
||||||
volume_type = mock.Mock()
|
volume_type = mock.Mock()
|
||||||
self.scenario._delete_volume_type(volume_type)
|
self.scenario._delete_volume_type(volume_type)
|
||||||
|
@ -43,3 +43,17 @@ class CinderVolumeTypesTestCase(test.ScenarioTestCase):
|
|||||||
fakeargs="fakeargs")
|
fakeargs="fakeargs")
|
||||||
scenario._create_encryption_type.assert_called_once_with(
|
scenario._create_encryption_type.assert_called_once_with(
|
||||||
scenario._create_volume_type.return_value, "fakespecs")
|
scenario._create_volume_type.return_value, "fakespecs")
|
||||||
|
|
||||||
|
def test_create_and_list_encryption_type(self):
|
||||||
|
scenario = volume_types.CreateAndListEncryptionType(self.context)
|
||||||
|
scenario._create_volume_type = mock.Mock()
|
||||||
|
scenario._create_encryption_type = mock.Mock()
|
||||||
|
scenario._list_encryption_type = mock.Mock()
|
||||||
|
scenario.run(specs="fakespecs", search_opts="fakeopts",
|
||||||
|
fakeargs="fakeargs")
|
||||||
|
scenario._create_volume_type.assert_called_once_with(
|
||||||
|
fakeargs="fakeargs")
|
||||||
|
scenario._create_encryption_type.assert_called_once_with(
|
||||||
|
scenario._create_volume_type.return_value, "fakespecs")
|
||||||
|
scenario._list_encryption_type.assert_called_once_with(
|
||||||
|
"fakeopts")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user