Merge "Add hardware type 'irmc' for FUJITSU PRIMERGY servers"
This commit is contained in:
commit
217ad9d2c1
@ -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]
|
||||
|
@ -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)
|
||||
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Adds new hardware type 'irmc' for FUJITSU PRIMERGY servers.
|
@ -92,6 +92,7 @@ ironic.drivers =
|
||||
ironic.hardware.interfaces.boot =
|
||||
fake = ironic.drivers.modules.fake:FakeBoot
|
||||
pxe = ironic.drivers.modules.pxe:PXEBoot
|
||||
irmc-virtual-media = ironic.drivers.modules.irmc.boot:IRMCVirtualMediaBoot
|
||||
|
||||
ironic.hardware.interfaces.console =
|
||||
fake = ironic.drivers.modules.fake:FakeConsole
|
||||
@ -108,10 +109,12 @@ ironic.hardware.interfaces.inspect =
|
||||
fake = ironic.drivers.modules.fake:FakeInspect
|
||||
inspector = ironic.drivers.modules.inspector:Inspector
|
||||
no-inspect = ironic.drivers.modules.noop:NoInspect
|
||||
irmc = ironic.drivers.modules.irmc.inspect:IRMCInspect
|
||||
|
||||
ironic.hardware.interfaces.management =
|
||||
fake = ironic.drivers.modules.fake:FakeManagement
|
||||
ipmitool = ironic.drivers.modules.ipmitool:IPMIManagement
|
||||
irmc = ironic.drivers.modules.irmc.management:IRMCManagement
|
||||
|
||||
ironic.hardware.interfaces.network =
|
||||
flat = ironic.drivers.modules.network.flat:FlatNetwork
|
||||
@ -121,6 +124,7 @@ ironic.hardware.interfaces.network =
|
||||
ironic.hardware.interfaces.power =
|
||||
fake = ironic.drivers.modules.fake:FakePower
|
||||
ipmitool = ironic.drivers.modules.ipmitool:IPMIPower
|
||||
irmc = ironic.drivers.modules.irmc.power:IRMCPower
|
||||
|
||||
ironic.hardware.interfaces.raid =
|
||||
agent = ironic.drivers.modules.agent:AgentRAID
|
||||
@ -142,6 +146,7 @@ ironic.hardware.types =
|
||||
fake-hardware = ironic.drivers.fake_hardware:FakeHardware
|
||||
manual-management = ironic.drivers.generic:ManualManagementHardware
|
||||
ipmi = ironic.drivers.ipmi:IPMIHardware
|
||||
irmc = ironic.drivers.irmc:IRMCHardware
|
||||
|
||||
ironic.database.migration_backend =
|
||||
sqlalchemy = ironic.db.sqlalchemy.migration
|
||||
|
Loading…
Reference in New Issue
Block a user