コード例 #1
0
ファイル: test_helper.py プロジェクト: michaeltchapman/ironic
 def setUp(self):
     super(BaseUcsTest, self).setUp()
     self.config(enabled_hardware_types=['cisco-ucs-managed',
                                         'fake-hardware'],
                 enabled_power_interfaces=['ucsm', 'fake'],
                 enabled_management_interfaces=['ucsm', 'fake'])
     self.info = db_utils.get_test_ucs_info()
     self.node = obj_utils.create_test_node(self.context,
                                            driver='cisco-ucs-managed',
                                            driver_info=self.info)
コード例 #2
0
ファイル: test_helper.py プロジェクト: openshift/ironic
 def setUp(self):
     super(BaseUcsTest, self).setUp()
     self.config(
         enabled_hardware_types=['cisco-ucs-managed', 'fake-hardware'],
         enabled_power_interfaces=['ucsm', 'fake'],
         enabled_management_interfaces=['ucsm', 'fake'])
     self.info = db_utils.get_test_ucs_info()
     self.node = obj_utils.create_test_node(self.context,
                                            driver='cisco-ucs-managed',
                                            driver_info=self.info)
コード例 #3
0
ファイル: test_helper.py プロジェクト: SahilTikale/ironic
import mock
from oslo_config import cfg
from oslo_utils import importutils

from ironic.common import exception
from ironic.conductor import task_manager
from ironic.db import api as dbapi
from ironic.drivers.modules.ucs import helper as ucs_helper
from ironic.tests.unit.conductor import mgr_utils
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.objects import utils as obj_utils

ucs_error = importutils.try_import('UcsSdk.utils.exception')

INFO_DICT = db_utils.get_test_ucs_info()
CONF = cfg.CONF


class UcsValidateParametersTestCase(db_base.DbTestCase):

    def setUp(self):
        super(UcsValidateParametersTestCase, self).setUp()
        mgr_utils.mock_the_extension_manager(driver="fake_ucs")
        self.node = obj_utils.create_test_node(self.context,
                                               driver='fake_ucs',
                                               driver_info=INFO_DICT)
        with task_manager.acquire(self.context, self.node.uuid,
                                  shared=True) as task:
            self.helper = ucs_helper.CiscoUcsHelper(task)
コード例 #4
0
ファイル: test_power.py プロジェクト: bestjie/ironic
import mock
from oslo_config import cfg
from oslo_utils import importutils

from ironic.common import exception
from ironic.common import states
from ironic.conductor import task_manager
from ironic.drivers.modules.ucs import helper as ucs_helper
from ironic.drivers.modules.ucs import power as ucs_power
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.objects import utils as obj_utils

ucs_error = importutils.try_import('UcsSdk.utils.exception')

INFO_DICT = db_utils.get_test_ucs_info()
CONF = cfg.CONF


class UcsPowerTestCase(db_base.DbTestCase):
    def setUp(self):
        super(UcsPowerTestCase, self).setUp()
        driver_info = INFO_DICT
        self.config(enabled_drivers=['fake_ucs'])
        self.node = obj_utils.create_test_node(self.context,
                                               driver='fake_ucs',
                                               driver_info=driver_info)
        CONF.set_override('max_retry', 2, 'cisco_ucs')
        CONF.set_override('action_interval', 0, 'cisco_ucs')
        self.interface = ucs_power.Power()