コード例 #1
0
 def setUp(self):
     super(IloCommonMethodsTestCase, self).setUp()
     mgr_utils.mock_the_extension_manager(driver="fake_ilo")
     self.info = db_utils.get_test_ilo_info()
     self.node = obj_utils.create_test_node(self.context,
                                            driver='fake_ilo',
                                            driver_info=self.info)
コード例 #2
0
ファイル: test_raid.py プロジェクト: younkun/ironic
from unittest import mock

from oslo_utils import importutils

from ironic.common import exception
from ironic.conductor import task_manager
from ironic.drivers.modules.ilo import raid as ilo_raid
from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.drivers.modules.ibmc import base

constants = importutils.try_import('ibmc_client.constants')
ibmc_client = importutils.try_import('ibmc_client')
ibmc_error = importutils.try_import('ibmc_client.exceptions')

INFO_DICT = db_utils.get_test_ilo_info()


class IbmcRAIDTestCase(base.IBMCTestCase):
    def setUp(self):
        super(IbmcRAIDTestCase, self).setUp()
        self.driver = mock.Mock(raid=ilo_raid.Ilo5RAID())
        self.target_raid_config = {
            "logical_disks": [{
                'size_gb': 200,
                'raid_level': 0,
                'is_root_volume': True
            }, {
                'size_gb': 'MAX',
                'raid_level': 5
            }]
コード例 #3
0
ファイル: test_deploy.py プロジェクト: bharathshetty4/ironic
from ironic.drivers.modules import deploy_utils
from ironic.drivers.modules.ilo import common as ilo_common
from ironic.drivers.modules.ilo import deploy as ilo_deploy
from ironic.drivers.modules import iscsi_deploy
from ironic.drivers import utils as driver_utils
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


if six.PY3:
    import io
    file = io.BytesIO

INFO_DICT = db_utils.get_test_ilo_info()


class IloDeployPrivateMethodsTestCase(db_base.DbTestCase):

    def setUp(self):
        super(IloDeployPrivateMethodsTestCase, self).setUp()
        mgr_utils.mock_the_extension_manager(driver="iscsi_ilo")
        self.node = obj_utils.create_test_node(
            self.context, driver='iscsi_ilo', driver_info=INFO_DICT)

    @mock.patch.object(ilo_common, 'set_secure_boot_mode', spec_set=True,
                       autospec=True)
    @mock.patch.object(ilo_common, 'get_secure_boot_mode', spec_set=True,
                       autospec=True)
    def test__disable_secure_boot_false(self,
コード例 #4
0
 def setUp(self):
     super(IloValidateParametersTestCase, self).setUp()
     self.node = obj_utils.create_test_node(
         self.context,
         driver='fake_ilo',
         driver_info=db_utils.get_test_ilo_info())
コード例 #5
0
ファイル: test_common.py プロジェクト: cargonza2016/ironic
 def setUp(self):
     super(IloValidateParametersTestCase, self).setUp()
     self.node = obj_utils.create_test_node(
         self.context, driver='fake_ilo',
         driver_info=db_utils.get_test_ilo_info())
コード例 #6
0
ファイル: test_common.py プロジェクト: cargonza2016/ironic
 def setUp(self):
     super(IloCommonMethodsTestCase, self).setUp()
     mgr_utils.mock_the_extension_manager(driver="fake_ilo")
     self.info = db_utils.get_test_ilo_info()
     self.node = obj_utils.create_test_node(
         self.context, driver='fake_ilo', driver_info=self.info)