Missing baremetal driver API test
As a part of blueprint, this patch implements following API test -
Driver APIs -
1. Retrieve a list of drivers.
'fake' driver is created by default during ironic installation.
For this please have a look on -
https://github.com/openstack/ironic/blob/master/setup.cfg#L33
part of blueprint: missing-baremetal-api-test
Change-Id: I5abe62f2fb9aec103ce4e127a28f488ef1f342df
diff --git a/tempest/api/baremetal/test_drivers.py b/tempest/api/baremetal/test_drivers.py
new file mode 100644
index 0000000..445ca60
--- /dev/null
+++ b/tempest/api/baremetal/test_drivers.py
@@ -0,0 +1,26 @@
+# Copyright 2014 NEC Corporation. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from tempest.api.baremetal import base
+from tempest import test
+
+
+class TestDrivers(base.BaseBaremetalTest):
+ """Tests for drivers."""
+
+ @test.attr(type="smoke")
+ def test_list_drivers(self):
+ resp, drivers = self.client.list_drivers()
+ self.assertEqual('200', resp['status'])
+ self.assertIn('fake', [d['name'] for d in drivers['drivers']])
diff --git a/tempest/services/baremetal/v1/base_v1.py b/tempest/services/baremetal/v1/base_v1.py
index 3f4c509..89d62ee 100644
--- a/tempest/services/baremetal/v1/base_v1.py
+++ b/tempest/services/baremetal/v1/base_v1.py
@@ -42,6 +42,11 @@
return self._list_request('ports')
@base.handle_errors
+ def list_drivers(self):
+ """List all existing drivers."""
+ return self._list_request('drivers')
+
+ @base.handle_errors
def show_node(self, uuid):
"""
Gets a specific node.