Add Ironic show driver API test
This patch adds Ironic show driver API.
The spec of this API is below:
GET /v1/drivers/(driver_name)
param driver_name: Name of driver.
return: Serialized driver as a dictionary.
Partially implements blueprint missing-baremetal-api-test
Change-Id: I0851546084471a13278f9119602e44b2824e7c0d
diff --git a/tempest/api/baremetal/test_drivers.py b/tempest/api/baremetal/test_drivers.py
index 5e1e310..852b6ab 100644
--- a/tempest/api/baremetal/test_drivers.py
+++ b/tempest/api/baremetal/test_drivers.py
@@ -33,3 +33,9 @@
self.assertEqual('200', resp['status'])
self.assertIn(self.driver_name,
[d['name'] for d in drivers['drivers']])
+
+ @test.attr(type="smoke")
+ def test_show_driver(self):
+ resp, driver = self.client.show_driver(self.driver_name)
+ self.assertEqual('200', resp['status'])
+ self.assertEqual(self.driver_name, driver['name'])
diff --git a/tempest/services/baremetal/v1/base_v1.py b/tempest/services/baremetal/v1/base_v1.py
index 61342eb..9c753c2 100644
--- a/tempest/services/baremetal/v1/base_v1.py
+++ b/tempest/services/baremetal/v1/base_v1.py
@@ -89,6 +89,15 @@
"""
return self._show_request('ports', uuid)
+ def show_driver(self, driver_name):
+ """
+ Gets a specific driver.
+
+ :param driver_name: Name of driver.
+ :return: Serialized driver as a dictionary.
+ """
+ return self._show_request('drivers', driver_name)
+
@base.handle_errors
def create_node(self, chassis_id, **kwargs):
"""