summaryrefslogtreecommitdiff
path: root/ironic
diff options
context:
space:
mode:
authorDao Cong Tien <tiendc@vn.fujitsu.com>2017-01-26 17:02:40 +0700
committerDao Cong Tien <tiendc@vn.fujitsu.com>2017-02-01 00:09:22 +0700
commit6855ab17a3d23810728828299b268a2d5fba057a (patch)
tree55a38e9364505c1517fce207e21c94d6bb7f15c8 /ironic
parent2427c7b59463e53b8f0257b604371587ecc47966 (diff)
downloadironic-6855ab17a3d23810728828299b268a2d5fba057a.tar.gz
Add hardware type 'irmc' for FUJITSU PRIMERGY servers
Added IRMCHardware type for FUJITSU PRIMERGY servers which have iRMC S4 management system. Change-Id: I92c62a1680d4662dce5b1158b323192f35af7e9c Closes-Bug:#1659209
Diffstat (limited to 'ironic')
-rw-r--r--ironic/drivers/irmc.py39
-rw-r--r--ironic/tests/unit/drivers/test_irmc.py63
2 files changed, 102 insertions, 0 deletions
diff --git a/ironic/drivers/irmc.py b/ironic/drivers/irmc.py
index bde978a0d..f721c3109 100644
--- a/ironic/drivers/irmc.py
+++ b/ironic/drivers/irmc.py
@@ -21,13 +21,17 @@ from oslo_utils import importutils
from ironic.common import exception
from ironic.common.i18n import _
from ironic.drivers import base
+from ironic.drivers import generic
from ironic.drivers.modules import agent
+from ironic.drivers.modules import inspector
from ironic.drivers.modules import ipmitool
from ironic.drivers.modules.irmc import boot
from ironic.drivers.modules.irmc import inspect
from ironic.drivers.modules.irmc import management
from ironic.drivers.modules.irmc import power
from ironic.drivers.modules import iscsi_deploy
+from ironic.drivers.modules import noop
+from ironic.drivers.modules import pxe
class IRMCVirtualMediaIscsiDriver(base.BaseDriver):
@@ -75,3 +79,38 @@ class IRMCVirtualMediaAgentDriver(base.BaseDriver):
self.console = ipmitool.IPMIShellinaboxConsole()
self.management = management.IRMCManagement()
self.inspect = inspect.IRMCInspect()
+
+
+class IRMCHardware(generic.GenericHardware):
+ """iRMC hardware type.
+
+ iRMC hardware type is targeted for FUJITSU PRIMERGY servers which
+ have iRMC S4 management system.
+ """
+
+ @property
+ def supported_boot_interfaces(self):
+ """List of supported boot interfaces."""
+ return [boot.IRMCVirtualMediaBoot, pxe.PXEBoot]
+
+ @property
+ def supported_console_interfaces(self):
+ """List of supported console interfaces."""
+ return [ipmitool.IPMISocatConsole, ipmitool.IPMIShellinaboxConsole,
+ noop.NoConsole]
+
+ @property
+ def supported_inspect_interfaces(self):
+ """List of supported inspect interfaces."""
+ return [inspect.IRMCInspect, inspector.Inspector,
+ noop.NoInspect]
+
+ @property
+ def supported_management_interfaces(self):
+ """List of supported management interfaces."""
+ return [management.IRMCManagement]
+
+ @property
+ def supported_power_interfaces(self):
+ """List of supported power interfaces."""
+ return [power.IRMCPower]
diff --git a/ironic/tests/unit/drivers/test_irmc.py b/ironic/tests/unit/drivers/test_irmc.py
index a07da8105..6970b9f2a 100644
--- a/ironic/tests/unit/drivers/test_irmc.py
+++ b/ironic/tests/unit/drivers/test_irmc.py
@@ -20,9 +20,15 @@ import mock
import testtools
from ironic.common import exception
+from ironic.conductor import task_manager
from ironic.drivers import irmc
from ironic.drivers.modules import agent
+from ironic.drivers.modules import inspector
+from ironic.drivers.modules import ipmitool
from ironic.drivers.modules import iscsi_deploy
+from ironic.drivers.modules import noop
+from ironic.tests.unit.db import base as db_base
+from ironic.tests.unit.objects import utils as obj_utils
class IRMCVirtualMediaIscsiTestCase(testtools.TestCase):
@@ -107,3 +113,60 @@ class IRMCVirtualMediaAgentTestCase(testtools.TestCase):
self.assertRaises(exception.IRMCSharedFileSystemNotMounted,
irmc.IRMCVirtualMediaAgentDriver)
+
+
+class IRMCHardwareTestCase(db_base.DbTestCase):
+
+ def setUp(self):
+ irmc.boot.check_share_fs_mounted_patcher.start()
+ self.addCleanup(irmc.boot.check_share_fs_mounted_patcher.stop)
+ super(IRMCHardwareTestCase, self).setUp()
+ self.config(enabled_hardware_types=['irmc'],
+ enabled_boot_interfaces=['irmc-virtual-media'],
+ enabled_console_interfaces=['ipmitool-socat'],
+ enabled_deploy_interfaces=['iscsi', 'direct'],
+ enabled_inspect_interfaces=['irmc'],
+ enabled_management_interfaces=['irmc'],
+ enabled_power_interfaces=['irmc'],
+ enabled_raid_interfaces=['no-raid', 'agent'])
+
+ def test_default_interfaces(self):
+ node = obj_utils.create_test_node(self.context, driver='irmc')
+ with task_manager.acquire(self.context, node.id) as task:
+ self.assertIsInstance(task.driver.boot,
+ irmc.boot.IRMCVirtualMediaBoot)
+ self.assertIsInstance(task.driver.console,
+ ipmitool.IPMISocatConsole)
+ self.assertIsInstance(task.driver.deploy,
+ iscsi_deploy.ISCSIDeploy)
+ self.assertIsInstance(task.driver.inspect,
+ irmc.inspect.IRMCInspect)
+ self.assertIsInstance(task.driver.management,
+ irmc.management.IRMCManagement)
+ self.assertIsInstance(task.driver.power,
+ irmc.power.IRMCPower)
+ self.assertIsInstance(task.driver.raid,
+ noop.NoRAID)
+
+ def test_override_with_inspector(self):
+ self.config(enabled_inspect_interfaces=['inspector', 'irmc'])
+ node = obj_utils.create_test_node(
+ self.context, driver='irmc',
+ deploy_interface='direct',
+ inspect_interface='inspector',
+ raid_interface='agent')
+ with task_manager.acquire(self.context, node.id) as task:
+ self.assertIsInstance(task.driver.boot,
+ irmc.boot.IRMCVirtualMediaBoot)
+ self.assertIsInstance(task.driver.console,
+ ipmitool.IPMISocatConsole)
+ self.assertIsInstance(task.driver.deploy,
+ agent.AgentDeploy)
+ self.assertIsInstance(task.driver.inspect,
+ inspector.Inspector)
+ self.assertIsInstance(task.driver.management,
+ irmc.management.IRMCManagement)
+ self.assertIsInstance(task.driver.power,
+ irmc.power.IRMCPower)
+ self.assertIsInstance(task.driver.raid,
+ agent.AgentRAID)