Пример #1
0
 def test_driver_passthru_mixin_unsupported(self):
     mixed_vendor = driver_utils.MixinVendorInterface({}, {})
     self.assertRaises(exception.UnsupportedDriverExtension,
                       mixed_vendor.driver_vendor_passthru,
                       'context',
                       'fake_method',
                       param='p1')
 def __init__(self):
     self.power = ipmitool.IPMIPower()
     self.boot = pxe.PXEBoot()
     self.deploy = agent.AgentDeploy()
     self.management = ipmitool.IPMIManagement()
     self.console = ipmitool.IPMIShellinaboxConsole()
     self.ipmi_vendor = ipmitool.VendorPassthru()
     self.nm_vendor = nm_vendor.IntelNMVendorPassthru()
     self.mapping = {
         'send_raw': self.ipmi_vendor,
         'bmc_reset': self.ipmi_vendor,
         'control_nm_policy': self.nm_vendor,
         'set_nm_policy': self.nm_vendor,
         'get_nm_policy': self.nm_vendor,
         'remove_nm_policy': self.nm_vendor,
         'set_nm_policy_suspend': self.nm_vendor,
         'get_nm_policy_suspend': self.nm_vendor,
         'remove_nm_policy_suspend': self.nm_vendor,
         'get_nm_capabilities': self.nm_vendor,
         'get_nm_version': self.nm_vendor,
         'get_nm_statistics': self.nm_vendor,
         'reset_nm_statistics': self.nm_vendor
     }
     self.vendor = utils.MixinVendorInterface(self.mapping)
     self.raid = agent.AgentRAID()
     self.inspect = inspector.Inspector.create_if_enabled(
         'AgentAndIPMIToolDriver')
Пример #3
0
 def __init__(self):
     if not importutils.try_import('pyghmi'):
         raise exception.DriverLoadError(
             driver=self.__class__.__name__,
             reason=_("Unable to import pyghmi library"))
     self.power = ipminative.NativeIPMIPower()
     self.console = ipminative.NativeIPMIShellinaboxConsole()
     self.boot = pxe.PXEBoot()
     self.deploy = iscsi_deploy.ISCSIDeploy()
     self.management = ipminative.NativeIPMIManagement()
     self.iscsi_vendor = iscsi_deploy.VendorPassthru()
     self.ipminative_vendor = ipminative.VendorPassthru()
     self.mapping = {
         'send_raw': self.ipminative_vendor,
         'bmc_reset': self.ipminative_vendor,
         'heartbeat': self.iscsi_vendor,
         'pass_bootloader_install_info': self.iscsi_vendor,
         'pass_deploy_info': self.iscsi_vendor,
     }
     self.driver_passthru_mapping = {'lookup': self.iscsi_vendor}
     self.vendor = utils.MixinVendorInterface(self.mapping,
                                              self.driver_passthru_mapping)
     self.inspect = inspector.Inspector.create_if_enabled(
         'PXEAndIPMINativeDriver')
     self.raid = agent.AgentRAID()
Пример #4
0
    def __init__(self):
        if not importutils.try_import('dracclient'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import python-dracclient library'))

        self.power = power.DracPower()
        self.boot = pxe.PXEBoot()
        self.deploy = deploy.DracDeploy()
        self.management = management.DracManagement()
        self.raid = raid.DracRAID()
        self.iscsi_vendor = iscsi_deploy.VendorPassthru()
        self.drac_vendor = vendor_passthru.DracVendorPassthru()
        self.mapping = {
            'heartbeat': self.iscsi_vendor,
            'get_bios_config': self.drac_vendor,
            'set_bios_config': self.drac_vendor,
            'commit_bios_config': self.drac_vendor,
            'abandon_bios_config': self.drac_vendor,
            'list_unfinished_jobs': self.drac_vendor,
        }
        self.driver_passthru_mapping = {'lookup': self.iscsi_vendor}
        self.vendor = utils.MixinVendorInterface(self.mapping,
                                                 self.driver_passthru_mapping)
        self.inspect = drac_inspect.DracInspect()
Пример #5
0
    def __init__(self):
        if not importutils.try_import('pywsman'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import pywsman library'))

        if not importutils.try_import('dracclient'):
            raise exception.DriverLoadError(
                driver=self.__class__.__name__,
                reason=_('Unable to import python-dracclient library'))

        self.power = power.DracPower()
        self.boot = pxe.PXEBoot()
        self.deploy = iscsi_deploy.ISCSIDeploy()
        self.management = management.DracManagement()
        self.iscsi_vendor = iscsi_deploy.VendorPassthru()
        self.drac_vendor = vendor_passthru.DracVendorPassthru()
        self.mapping = {
            'pass_deploy_info': self.iscsi_vendor,
            'heartbeat': self.iscsi_vendor,
            'pass_bootloader_install_info': self.iscsi_vendor,
            'get_bios_config': self.drac_vendor,
            'set_bios_config': self.drac_vendor,
            'commit_bios_config': self.drac_vendor,
            'abandon_bios_config': self.drac_vendor,
        }
        self.vendor = utils.MixinVendorInterface(self.mapping)
        self.inspect = inspector.Inspector.create_if_enabled('PXEDracDriver')
Пример #6
0
    def __init__(self):
        self.power = fake.FakePower()
        self.deploy = fake.FakeDeploy()

        self.a = fake.FakeVendorA()
        self.b = fake.FakeVendorB()
        self.mapping = {'first_method': self.a, 'second_method': self.b}
        self.vendor = utils.MixinVendorInterface(self.mapping)
        self.console = fake.FakeConsole()
Пример #7
0
 def __init__(self):
     self.power = ipminative.NativeIPMIPower()
     self.deploy = pxe.PXEDeploy()
     self.pxe_vendor = pxe.VendorPassthru()
     self.ipmi_vendor = ipminative.VendorPassthru()
     self.mapping = {
         'pass_deploy_info': self.pxe_vendor,
         'set_boot_device': self.ipmi_vendor
     }
     self.vendor = utils.MixinVendorInterface(self.mapping)
Пример #8
0
 def setUp(self):
     super(MixinVendorInterfaceTestCase, self).setUp()
     self.a = fake.FakeVendorA()
     self.b = fake.FakeVendorB()
     self.mapping = {'first_method': self.a,
                     'second_method': self.b,
                     'third_method_sync': self.b,
                     'fourth_method_shared_lock': self.b}
     self.vendor = driver_utils.MixinVendorInterface(self.mapping)
     self.node = obj_utils.create_test_node(self.context,
                                            driver='fake-hardware')
Пример #9
0
 def __init__(self):
     self.power = ipmitool.IPMIPower()
     self.console = ipmitool.IPMIShellinaboxConsole()
     self.deploy = pxe.PXEDeploy()
     self.pxe_vendor = pxe.VendorPassthru()
     self.ipmi_vendor = ipmitool.VendorPassthru()
     self.mapping = {
         'pass_deploy_info': self.pxe_vendor,
         'set_boot_device': self.ipmi_vendor
     }
     self.vendor = utils.MixinVendorInterface(self.mapping)
Пример #10
0
 def __init__(self):
     if not importutils.try_import('pyghmi'):
         raise exception.DriverLoadError(
                 driver=self.__class__.__name__,
                 reason=_("Unable to import pyghmi library"))
     self.power = ipminative.NativeIPMIPower()
     self.deploy = pxe.PXEDeploy()
     self.pxe_vendor = pxe.VendorPassthru()
     self.ipmi_vendor = ipminative.VendorPassthru()
     self.mapping = {'pass_deploy_info': self.pxe_vendor,
                     'set_boot_device': self.ipmi_vendor}
     self.vendor = utils.MixinVendorInterface(self.mapping)
Пример #11
0
    def __init__(self):
        print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>"
        print "our driver is working........."
        print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>"
        self.power = ipmitool.IPMIPower()
        self.deploy = fake.FakeDeploy()

        self.a = fake.FakeVendorA()
        self.b = fake.FakeVendorB()
        self.mapping = {'first_method': self.a,
                        'second_method': self.b}
        self.vendor = utils.MixinVendorInterface(self.mapping)
        self.console = fake.FakeConsole()
        self.management = ipmitool.IPMIManagement()
Пример #12
0
 def __init__(self):
     if not importutils.try_import('seamicroclient'):
         raise exception.DriverNotFound('PXEAndSeaMicroDriver')
     self.power = seamicro.Power()
     self.deploy = pxe.PXEDeploy()
     self.seamicro_vendor = seamicro.VendorPassthru()
     self.pxe_vendor = pxe.VendorPassthru()
     self.mapping = {
         'pass_deploy_info': self.pxe_vendor,
         'attach_volume': self.seamicro_vendor,
         'set_boot_device': self.seamicro_vendor,
         'set_node_vlan_id': self.seamicro_vendor
     }
     self.vendor = utils.MixinVendorInterface(self.mapping)
Пример #13
0
 def __init__(self):
     if not importutils.try_import('seamicroclient'):
         raise exception.DriverLoadError(
                 driver=self.__class__.__name__,
                 reason="Unable to import seamicroclient library")
     self.power = seamicro.Power()
     self.deploy = pxe.PXEDeploy()
     self.management = seamicro.Management()
     self.seamicro_vendor = seamicro.VendorPassthru()
     self.pxe_vendor = pxe.VendorPassthru()
     self.mapping = {'pass_deploy_info': self.pxe_vendor,
                     'attach_volume': self.seamicro_vendor,
                     'set_node_vlan_id': self.seamicro_vendor}
     self.vendor = utils.MixinVendorInterface(self.mapping)
Пример #14
0
    def __init__(self):
        self.power = fake.FakePower()
        self.deploy = fake.FakeDeploy()
        self.boot = fake.FakeBoot()

        self.a = fake.FakeVendorA()
        self.b = fake.FakeVendorB()
        self.mapping = {'first_method': self.a,
                        'second_method': self.b,
                        'third_method_sync': self.b}
        self.vendor = utils.MixinVendorInterface(self.mapping)
        self.console = fake.FakeConsole()
        self.management = fake.FakeManagement()
        self.inspect = fake.FakeInspect()
Пример #15
0
 def test_driver_passthru_mixin_success(self):
     vendor_a = fake.FakeVendorA()
     vendor_a.driver_vendor_passthru = mock.Mock()
     vendor_b = fake.FakeVendorB()
     vendor_b.driver_vendor_passthru = mock.Mock()
     driver_vendor_mapping = {
         'method_a': vendor_a,
         'method_b': vendor_b,
     }
     mixed_vendor = driver_utils.MixinVendorInterface({},
                                                      driver_vendor_mapping)
     mixed_vendor.driver_vendor_passthru('context', 'method_a', param1='p1')
     vendor_a.driver_vendor_passthru.assert_called_once_with('context',
                                                             'method_a',
                                                             param1='p1')
Пример #16
0
 def __init__(self):
     self.power = ipmitool.IPMIPower()
     self.boot = pxe.PXEBoot()
     self.deploy = agent.AgentDeploy()
     self.management = ipmitool.IPMIManagement()
     self.console = ipmitool.IPMIShellinaboxConsole()
     self.agent_vendor = agent.AgentVendorInterface()
     self.ipmi_vendor = ipmitool.VendorPassthru()
     self.mapping = {'send_raw': self.ipmi_vendor,
                     'bmc_reset': self.ipmi_vendor,
                     'heartbeat': self.agent_vendor}
     self.driver_passthru_mapping = {'lookup': self.agent_vendor}
     self.vendor = utils.MixinVendorInterface(
         self.mapping,
         driver_passthru_mapping=self.driver_passthru_mapping)
     self.raid = agent.AgentRAID()
     self.inspect = inspector.Inspector.create_if_enabled(
         'AgentAndIPMIToolDriver')
Пример #17
0
 def __init__(self):
     self.power = ipmitool.IPMIPower()
     self.console = ipmitool.IPMIShellinaboxConsole()
     self.boot = pxe.PXEBoot()
     self.deploy = iscsi_deploy.ISCSIDeploy()
     self.management = ipmitool.IPMIManagement()
     self.inspect = inspector.Inspector.create_if_enabled(
         'PXEAndIPMIToolDriver')
     self.iscsi_vendor = iscsi_deploy.VendorPassthru()
     self.ipmi_vendor = ipmitool.VendorPassthru()
     self.mapping = {'send_raw': self.ipmi_vendor,
                     'bmc_reset': self.ipmi_vendor,
                     'heartbeat': self.iscsi_vendor,
                     'pass_deploy_info': self.iscsi_vendor,
                     'pass_bootloader_install_info': self.iscsi_vendor}
     self.driver_passthru_mapping = {'lookup': self.iscsi_vendor}
     self.vendor = utils.MixinVendorInterface(
         self.mapping,
         driver_passthru_mapping=self.driver_passthru_mapping)
Пример #18
0
 def __init__(self):
     if not importutils.try_import('UcsSdk'):
         raise exception.DriverNotFound('PXEAndCiscoUCSMDriver')
     self.power = cisco.Power()
     self.deploy = pxe.PXEDeploy()
     self.ucsm_vendor = cisco.VendorPassthru()
     self.pxe_vendor = pxe.VendorPassthru()
     self.mapping = {
         'pass_deploy_info': self.pxe_vendor,
         'launch_kvm': self.ucsm_vendor,
         'get_location': self.ucsm_vendor,
         'get_inventory': self.ucsm_vendor,
         'get_faults': self.ucsm_vendor,
         'get_temperature_stats': self.ucsm_vendor,
         'get_power_stats': self.ucsm_vendor,
         'get_firmware_version': self.ucsm_vendor
     }
     self.driver_vendor_mapping = {'enroll_nodes': self.ucsm_vendor}
     self.vendor = utils.MixinVendorInterface(self.mapping,
                                              self.driver_vendor_mapping)
Пример #19
0
 def __init__(self):
     if not importutils.try_import('seamicroclient'):
         raise exception.DriverLoadError(
             driver=self.__class__.__name__,
             reason=_("Unable to import seamicroclient library"))
     self.power = seamicro.Power()
     self.boot = pxe.PXEBoot()
     self.deploy = iscsi_deploy.ISCSIDeploy()
     self.management = seamicro.Management()
     self.seamicro_vendor = seamicro.VendorPassthru()
     self.iscsi_vendor = iscsi_deploy.VendorPassthru()
     self.mapping = {
         'heartbeat': self.iscsi_vendor,
         'attach_volume': self.seamicro_vendor,
         'set_node_vlan_id': self.seamicro_vendor
     }
     self.driver_passthru_mapping = {'lookup': self.iscsi_vendor}
     self.vendor = utils.MixinVendorInterface(self.mapping,
                                              self.driver_passthru_mapping)
     self.console = seamicro.ShellinaboxConsole()