Merge "This adds a tempest test for creating a chassis with a specific UUID."
This commit is contained in:
commit
8e14f21c15
@ -157,6 +157,9 @@ class BaremetalClient(base.BaremetalClient):
|
||||
"""
|
||||
chassis = {'description': kwargs.get('description', 'test-chassis')}
|
||||
|
||||
if 'uuid' in kwargs:
|
||||
chassis.update({'uuid': kwargs.get('uuid')})
|
||||
|
||||
return self._create_request('chassis', chassis)
|
||||
|
||||
@base.handle_errors
|
||||
|
@ -147,7 +147,7 @@ class BaseBaremetalTest(api_version_utils.BaseMicroversionTest,
|
||||
|
||||
@classmethod
|
||||
@creates('chassis')
|
||||
def create_chassis(cls, description=None):
|
||||
def create_chassis(cls, description=None, **kwargs):
|
||||
"""Wrapper utility for creating test chassis.
|
||||
|
||||
:param description: A description of the chassis. If not supplied,
|
||||
@ -156,7 +156,8 @@ class BaseBaremetalTest(api_version_utils.BaseMicroversionTest,
|
||||
|
||||
"""
|
||||
description = description or data_utils.rand_name('test-chassis')
|
||||
resp, body = cls.client.create_chassis(description=description)
|
||||
resp, body = cls.client.create_chassis(description=description,
|
||||
**kwargs)
|
||||
return resp, body
|
||||
|
||||
@classmethod
|
||||
|
@ -75,3 +75,9 @@ class TestChassis(base.BaseBaremetalTest):
|
||||
_, node = self.create_node(self.chassis['uuid'])
|
||||
_, body = self.client.list_chassis_nodes(self.chassis['uuid'])
|
||||
self.assertIn(node['uuid'], [n['uuid'] for n in body['nodes']])
|
||||
|
||||
@decorators.idempotent_id('dd52bd5d-610c-4f2c-8fa3-d5e59269325f')
|
||||
def test_create_chassis_uuid(self):
|
||||
uuid = data_utils.rand_uuid()
|
||||
_, chassis = self.create_chassis(uuid=uuid)
|
||||
self.assertEqual(uuid, chassis['uuid'])
|
||||
|
Loading…
Reference in New Issue
Block a user