Merge "Add tempest plugin API tests for driver"
This commit is contained in:
commit
c02fa7193f
@ -150,7 +150,11 @@ class BaremetalClient(rest_client.RestClient):
|
||||
|
||||
return resp, self.deserialize(body)
|
||||
|
||||
def _show_request(self, resource, uuid, permanent=False, **kwargs):
|
||||
def _show_request(self,
|
||||
resource,
|
||||
uuid=None,
|
||||
permanent=False,
|
||||
**kwargs):
|
||||
"""Gets a specific object of the specified type.
|
||||
|
||||
:param uuid: Unique identifier of the object in UUID format.
|
||||
|
@ -493,3 +493,30 @@ class BaremetalClient(base.BaremetalClient):
|
||||
resp, body = self._delete_request('nodes/%s/vifs' % node_uuid, vif_id)
|
||||
self.expected_success(http_client.NO_CONTENT, resp.status)
|
||||
return resp, body
|
||||
|
||||
@base.handle_errors
|
||||
def get_driver_properties(self, driver_name):
|
||||
"""Get properties information about driver.
|
||||
|
||||
:param driver_name: Name of driver.
|
||||
:return: tuple of response and serialized properties as a dictionary.
|
||||
|
||||
"""
|
||||
uri = 'drivers/%s/properties' % driver_name
|
||||
resp, body = self.get(uri)
|
||||
self.expected_success(200, resp.status)
|
||||
return resp, self.deserialize(body)
|
||||
|
||||
@base.handle_errors
|
||||
def get_driver_logical_disk_properties(self, driver_name):
|
||||
"""Get driver logical disk properties.
|
||||
|
||||
:param driver_name: Name of driver.
|
||||
:return: tuple of response and serialized logical disk properties as
|
||||
a dictionary.
|
||||
|
||||
"""
|
||||
uri = 'drivers/%s/raid/logical_disk_properties' % driver_name
|
||||
resp, body = self.get(uri)
|
||||
self.expected_success(200, resp.status)
|
||||
return resp, self.deserialize(body)
|
||||
|
@ -15,6 +15,7 @@
|
||||
from tempest import config
|
||||
from tempest.lib import decorators
|
||||
|
||||
from ironic_tempest_plugin.tests.api.admin import api_microversion_fixture
|
||||
from ironic_tempest_plugin.tests.api.admin import base
|
||||
|
||||
CONF = config.CONF
|
||||
@ -22,6 +23,7 @@ CONF = config.CONF
|
||||
|
||||
class TestDrivers(base.BaseBaremetalTest):
|
||||
"""Tests for drivers."""
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(TestDrivers, cls).resource_setup()
|
||||
@ -37,3 +39,16 @@ class TestDrivers(base.BaseBaremetalTest):
|
||||
def test_show_driver(self):
|
||||
_, driver = self.client.show_driver(self.driver_name)
|
||||
self.assertEqual(self.driver_name, driver['name'])
|
||||
|
||||
@decorators.idempotent_id('6efa976f-78a2-4859-b3aa-97d960d6e5e5')
|
||||
def test_driver_properties(self):
|
||||
_, properties = self.client.get_driver_properties(self.driver_name)
|
||||
self.assertNotEmpty(properties)
|
||||
|
||||
@decorators.idempotent_id('fdf61f5a-f59d-4235-ad6c-cc718740e3e3')
|
||||
def test_driver_logical_disk_properties(self):
|
||||
self.useFixture(
|
||||
api_microversion_fixture.APIMicroversionFixture('1.12'))
|
||||
_, properties = self.client.get_driver_logical_disk_properties(
|
||||
self.driver_name)
|
||||
self.assertNotEmpty(properties)
|
||||
|
Loading…
x
Reference in New Issue
Block a user