Beispiel #1
0
 def setUp(self):
     super(IronicDriverFieldsTestCase, self).setUp()
     self.image_meta = ironic_utils.get_test_image_meta()
     self.flavor = ironic_utils.get_test_flavor()
     self.ctx = nova_context.get_admin_context()
     self.instance = fake_instance.fake_instance_obj(self.ctx)
     self.instance.flavor = self.flavor
     self.node = ironic_utils.get_test_node(driver='fake')
     # Generic expected patches
     self._expected_deploy_patch = [
         {'path': '/instance_info/image_source',
          'value': self.image_meta.id,
          'op': 'add'},
         {'path': '/instance_info/root_gb',
          'value': str(self.instance.flavor.root_gb),
          'op': 'add'},
         {'path': '/instance_info/swap_mb',
          'value': str(self.flavor['swap']),
          'op': 'add'},
         {'path': '/instance_info/display_name',
          'value': self.instance['display_name'],
          'op': 'add'},
         {'path': '/instance_info/vcpus',
          'value': str(self.instance.flavor.vcpus),
          'op': 'add'},
         {'path': '/instance_info/memory_mb',
          'value': str(self.instance.flavor.memory_mb),
          'op': 'add'},
         {'path': '/instance_info/local_gb',
          'value': str(self.node.properties.get('local_gb', 0)),
          'op': 'add'}
     ]
Beispiel #2
0
 def test_generic_get_deploy_patch_image_flavor_traits_none(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.image_meta.properties = objects.ImageMetaProps()
     expected = self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(
         self.instance, self.image_meta, self.flavor)
     self.assertPatchEqual(expected, patch)
 def test_macs_for_instance(self, mock_node):
     node = ironic_utils.get_test_node()
     mock_node.get.return_value = node
     instance = fake_instance.fake_instance_obj(self.ctx,
                                                node=node.uuid)
     result = self.driver.macs_for_instance(instance)
     self.assertIsNone(result)
 def test_unplug_vifs_no_network_info(self, mock_vp):
     node = ironic_utils.get_test_node()
     instance = fake_instance.fake_instance_obj(self.ctx,
                                                node=node.uuid)
     network_info = []
     self.driver._unplug_vifs(node, instance, network_info)
     self.assertFalse(mock_vp.called)
Beispiel #5
0
    def test_show_ironic_no_properties(self, mock_get, mock_list_ports):
        properties = {}
        node = ironic_utils.get_test_node(properties=properties)
        port = ironic_utils.get_test_port()
        mock_get.return_value = node
        mock_list_ports.return_value = [port]

        res_dict = self.controller.show(self.request, node.uuid)
        expected_output = {
            'node': {
                'memory_mb': 0,
                'instance_uuid': None,
                'host': 'IRONIC MANAGED',
                'disk_gb': 0,
                'interfaces': [{
                    'address': port.address
                }],
                'task_state': None,
                'id': node.uuid,
                'cpus': 0
            }
        }
        self.assertEqual(expected_output, res_dict)
        mock_get.assert_called_once_with(node.uuid)
        mock_list_ports.assert_called_once_with(node.uuid)
 def test_unplug_vifs(self, mock_vp):
     node = ironic_utils.get_test_node()
     instance = fake_instance.fake_instance_obj(self.ctx, node=node.uuid)
     network_info = utils.get_test_network_info()
     expected_info = {"uuid": network_info[0]["id"]}
     self.driver._unplug_vifs(node, instance, network_info)
     mock_vp.assert_called_once_with(node.uuid, "delete_vnic", args=expected_info)
Beispiel #7
0
 def test_generic_get_deploy_patch_traits_ignores_not_required(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.flavor['extra_specs']['trait:CUSTOM_FOO'] = 'invalid'
     expected = self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, self.flavor)
     self.assertPatchEqual(expected, patch)
Beispiel #8
0
 def test_pxe_get_cleanup_patch_no_flavor_kernel_ramdisk_ids(self):
     self.flavor = ironic_utils.get_test_flavor(extra_specs={})
     node = ironic_utils.get_test_node(driver='pxe_fake')
     patch = patcher.create(node).get_cleanup_patch(self.instance, None,
                                                    self.flavor)
     # If there's no extra_specs patch should be exactly like a
     # generic patch
     self.assertEqual(self._expected_cleanup_patch, patch)
Beispiel #9
0
 def test_generic_get_deploy_patch_image_flavor_traits_none(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.image_meta.properties = objects.ImageMetaProps()
     expected = self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(self.instance,
                                                   self.image_meta,
                                                   self.flavor)
     self.assertPatchEqual(expected, patch)
Beispiel #10
0
 def test_pxe_get_cleanup_patch_no_flavor_kernel_ramdisk_ids(self):
     self.flavor = ironic_utils.get_test_flavor(extra_specs={})
     node = ironic_utils.get_test_node(driver='pxe_fake')
     patch = patcher.create(node).get_cleanup_patch(self.instance, None,
                                                    self.flavor)
     # If there's no extra_specs patch should be exactly like a
     # generic patch
     self.assertEqual(self._expected_cleanup_patch, patch)
Beispiel #11
0
 def test_generic_get_deploy_patch_traits_ignores_not_required(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.flavor['extra_specs']['trait:CUSTOM_FOO'] = 'invalid'
     expected = self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(self.instance,
                                                   self.image_meta,
                                                   self.flavor)
     self.assertPatchEqual(expected, patch)
Beispiel #12
0
 def test_generic_get_deploy_patch_boot_from_volume(self):
     node = ironic_utils.get_test_node(driver='fake')
     expected = [patch for patch in self._expected_deploy_patch
                 if patch['path'] != '/instance_info/image_source']
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, self.flavor,
             boot_from_volume=True)
     self.assertPatchEqual(expected, patch)
Beispiel #13
0
 def test_pxe_get_deploy_patch_no_flavor_kernel_ramdisk_ids(self):
     flavor = ironic_utils.get_test_flavor(extra_specs={})
     node = ironic_utils.get_test_node(driver='pxe_fake')
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, flavor)
     # If there's no extra_specs patch should be exactly like a
     # generic patch
     self.assertEqual(sorted(self._expected_deploy_patch), sorted(patch))
Beispiel #14
0
 def test_pxe_get_deploy_patch_no_flavor_kernel_ramdisk_ids(self):
     flavor = ironic_utils.get_test_flavor(extra_specs={})
     node = ironic_utils.get_test_node(driver='pxe_fake')
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, flavor)
     # If there's no extra_specs patch should be exactly like a
     # generic patch
     self.assertEqual(sorted(self._expected_deploy_patch), sorted(patch))
    def test_plug_vifs_with_port(self, mock_vp, mock_neutron):
        node = ironic_utils.get_test_node()
        instance = fake_instance.fake_instance_obj(self.ctx, node=node.uuid)
        network_info = utils.get_test_network_info()
        mock_neutron.return_value.show_network.return_value = {"network": {"provider:segmentation_id": 600}}

        self.driver._plug_vifs(node, instance, network_info)
        expected_info = {"vlan": 600, "mac": network_info[0]["address"], "uuid": network_info[0]["id"], "pxe": False}
        mock_vp.assert_called_once_with(node.uuid, "add_vnic", args=expected_info)
    def test_show_ironic_no_interfaces(self, mock_get, mock_list_ports):
        properties = {"cpus": 1, "memory_mb": 512, "local_gb": 10}
        node = ironic_utils.get_test_node(properties=properties)
        mock_get.return_value = node
        mock_list_ports.return_value = []

        res_dict = self.controller.show(self.request, node.uuid)
        self.assertEqual([], res_dict["node"]["interfaces"])
        mock_get.assert_called_once_with(node.uuid)
        mock_list_ports.assert_called_once_with(node.uuid)
Beispiel #17
0
    def test_show_ironic_no_interfaces(self, mock_get, mock_list_ports):
        properties = {'cpus': 1, 'memory_mb': 512, 'local_gb': 10}
        node = ironic_utils.get_test_node(properties=properties)
        mock_get.return_value = node
        mock_list_ports.return_value = []

        res_dict = self.controller.show(self.request, node.uuid)
        self.assertEqual([], res_dict['node']['interfaces'])
        mock_get.assert_called_once_with(node.uuid)
        mock_list_ports.assert_called_once_with(node.uuid)
Beispiel #18
0
 def test_generic_get_deploy_patch_preserve_ephemeral(self):
     node = ironic_utils.get_test_node(driver='fake')
     for preserve in [True, False]:
         patch = patcher.create(node).get_deploy_patch(
                 self.instance, self.image_meta, self.flavor,
                 preserve_ephemeral=preserve)
         expected = [{'path': '/instance_info/preserve_ephemeral',
                      'value': str(preserve), 'op': 'add', }]
         expected += self._expected_deploy_patch
         self.assertEqual(sorted(expected), sorted(patch))
Beispiel #19
0
 def test_generic_get_deploy_patch_traits_granular(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.flavor['extra_specs']['trait1:CUSTOM_FOO'] = 'required'
     expected = [{'path': '/instance_info/traits',
                  'value': ["CUSTOM_FOO"],
                  'op': 'add'}]
     expected += self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, self.flavor)
     self.assertPatchEqual(expected, patch)
Beispiel #20
0
 def test_generic_get_deploy_patch_capabilities_op(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.flavor['extra_specs']['capabilities:boot_mode'] = '<in> bios'
     expected = [{'path': '/instance_info/capabilities',
                  'value': '{"boot_mode": "<in> bios"}',
                  'op': 'add'}]
     expected += self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, self.flavor)
     self.assertPatchEqual(expected, patch)
Beispiel #21
0
    def test_show_node_policy(self, mock_get, mock_port):
        rule_name = "os_compute_api:os-baremetal-nodes"
        properties = {'cpus': 1, 'memory_mb': 512, 'local_gb': 10}
        node = ironic_utils.get_test_node(properties=properties)
        mock_get.return_value = node
        mock_port.return_value = []

        self.common_policy_check(self.admin_authorized_contexts,
                                 self.admin_unauthorized_contexts, rule_name,
                                 self.controller.show, self.req, uuids.fake_id)
Beispiel #22
0
 def test_generic_get_deploy_patch_preserve_ephemeral(self):
     node = ironic_utils.get_test_node(driver='fake')
     for preserve in [True, False]:
         patch = patcher.create(node).get_deploy_patch(
                 self.instance, self.image_meta, self.flavor,
                 preserve_ephemeral=preserve)
         expected = [{'path': '/instance_info/preserve_ephemeral',
                      'value': str(preserve), 'op': 'add', }]
         expected += self._expected_deploy_patch
         self.assertPatchEqual(expected, patch)
Beispiel #23
0
 def test_generic_get_deploy_patch_capabilities_nested_key(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.flavor['extra_specs']['capabilities:key1:key2'] = '<in> bios'
     expected = [{'path': '/instance_info/capabilities',
                  'value': '{"key1:key2": "<in> bios"}',
                  'op': 'add'}]
     expected += self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, self.flavor)
     self.assertEqual(sorted(expected), sorted(patch))
Beispiel #24
0
 def test_generic_get_deploy_patch_image_traits_required(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.image_meta.properties = objects.ImageMetaProps(
         traits_required=['CUSTOM_TRUSTED'])
     expected = [{'path': '/instance_info/traits',
                  'value': ["CUSTOM_TRUSTED"],
                  'op': 'add'}]
     expected += self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(
         self.instance, self.image_meta, self.flavor)
     self.assertPatchEqual(expected, patch)
Beispiel #25
0
 def test_pxe_get_cleanup_patch(self):
     driver_info = {'pxe_deploy_kernel': 'fake-kernel-id',
                    'pxe_deploy_ramdisk': 'fake-ramdisk-id'}
     node = ironic_utils.get_test_node(driver='pxe_fake',
                                       driver_info=driver_info)
     patch = patcher.create(node).get_cleanup_patch(self.instance, None,
                                                    self.flavor)
     expected = [{'path': '/driver_info/pxe_deploy_kernel',
                  'op': 'remove'},
                 {'path': '/driver_info/pxe_deploy_ramdisk',
                  'op': 'remove'}]
     self.assertEqual(sorted(expected), sorted(patch))
Beispiel #26
0
 def test_pxe_get_cleanup_patch(self):
     driver_info = {'pxe_deploy_kernel': 'fake-kernel-id',
                    'pxe_deploy_ramdisk': 'fake-ramdisk-id'}
     node = ironic_utils.get_test_node(driver='pxe_fake',
                                       driver_info=driver_info)
     patch = patcher.create(node).get_cleanup_patch(self.instance, None,
                                                    self.flavor)
     expected = [{'path': '/driver_info/pxe_deploy_kernel',
                  'op': 'remove'},
                 {'path': '/driver_info/pxe_deploy_ramdisk',
                  'op': 'remove'}]
     self.assertEqual(sorted(expected), sorted(patch))
Beispiel #27
0
 def test_pxe_get_deploy_patch(self):
     node = ironic_utils.get_test_node(driver='pxe_fake')
     extra_specs = self.flavor['extra_specs']
     expected = [{'path': '/driver_info/pxe_deploy_kernel',
                  'value': extra_specs['baremetal:deploy_kernel_id'],
                  'op': 'add'},
                 {'path': '/driver_info/pxe_deploy_ramdisk',
                  'value': extra_specs['baremetal:deploy_ramdisk_id'],
                  'op': 'add'}]
     expected += self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, self.flavor)
     self.assertEqual(sorted(expected), sorted(patch))
Beispiel #28
0
 def test_pxe_get_deploy_patch(self):
     node = ironic_utils.get_test_node(driver='pxe_fake')
     extra_specs = self.flavor['extra_specs']
     expected = [{'path': '/driver_info/pxe_deploy_kernel',
                  'value': extra_specs['baremetal:deploy_kernel_id'],
                  'op': 'add'},
                 {'path': '/driver_info/pxe_deploy_ramdisk',
                  'value': extra_specs['baremetal:deploy_ramdisk_id'],
                  'op': 'add'}]
     expected += self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, self.flavor)
     self.assertEqual(sorted(expected), sorted(patch))
Beispiel #29
0
 def test_generic_get_deploy_patch_traits_granular(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.flavor['extra_specs']['trait1:CUSTOM_FOO'] = 'required'
     expected = [{
         'path': '/instance_info/traits',
         'value': '["CUSTOM_FOO"]',
         'op': 'add'
     }]
     expected += self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(self.instance,
                                                   self.image_meta,
                                                   self.flavor)
     self.assertPatchEqual(expected, patch)
Beispiel #30
0
 def test_generic_get_deploy_patch_image_traits_required(self):
     node = ironic_utils.get_test_node(driver='fake')
     self.image_meta.properties = objects.ImageMetaProps(
         traits_required=['CUSTOM_TRUSTED'])
     expected = [{
         'path': '/instance_info/traits',
         'value': ["CUSTOM_TRUSTED"],
         'op': 'add'
     }]
     expected += self._expected_deploy_patch
     patch = patcher.create(node).get_deploy_patch(self.instance,
                                                   self.image_meta,
                                                   self.flavor)
     self.assertPatchEqual(expected, patch)
Beispiel #31
0
 def test_generic_get_deploy_patch_ephemeral(self):
     CONF.set_override('default_ephemeral_format', 'testfmt')
     node = ironic_utils.get_test_node(driver='fake')
     instance = fake_instance.fake_instance_obj(self.ctx,
                                                ephemeral_gb=10)
     patch = patcher.create(node).get_deploy_patch(
             instance, self.image_meta, self.flavor)
     expected = [{'path': '/instance_info/ephemeral_gb',
                  'value': str(instance.ephemeral_gb),
                  'op': 'add'},
                 {'path': '/instance_info/ephemeral_format',
                  'value': 'testfmt',
                  'op': 'add'}]
     expected += self._expected_deploy_patch
     self.assertEqual(sorted(expected), sorted(patch))
Beispiel #32
0
 def test_generic_get_deploy_patch_ephemeral(self):
     CONF.set_override('default_ephemeral_format', 'testfmt')
     node = ironic_utils.get_test_node(driver='fake')
     instance = fake_instance.fake_instance_obj(self.ctx,
                                                ephemeral_gb=10)
     patch = patcher.create(node).get_deploy_patch(
             instance, self.image_meta, self.flavor)
     expected = [{'path': '/instance_info/ephemeral_gb',
                  'value': str(instance.ephemeral_gb),
                  'op': 'add'},
                 {'path': '/instance_info/ephemeral_format',
                  'value': 'testfmt',
                  'op': 'add'}]
     expected += self._expected_deploy_patch
     self.assertEqual(sorted(expected), sorted(patch))
Beispiel #33
0
    def test_index_ironic(self, mock_list):
        properties = {'cpus': 2, 'memory_mb': 1024, 'local_gb': 20}
        node = ironic_utils.get_test_node(properties=properties)
        mock_list.return_value = [node]

        res_dict = self.controller.index(self.request)
        expected_output = {'nodes':
                            [{'memory_mb': properties['memory_mb'],
                             'host': 'IRONIC MANAGED',
                             'disk_gb': properties['local_gb'],
                             'interfaces': [],
                             'task_state': None,
                             'id': node.uuid,
                             'cpus': properties['cpus']}]}
        self.assertEqual(expected_output, res_dict)
        mock_list.assert_called_once_with(detail=True)
Beispiel #34
0
 def test_generic_get_deploy_patch_boot_from_volume_image_traits_required(
         self):
     node = ironic_utils.get_test_node(driver='fake')
     self.image_meta.properties = objects.ImageMetaProps(
         traits_required=['CUSTOM_TRUSTED'])
     expected_deploy_patch_volume = [patch for patch in
                                     self._expected_deploy_patch
                                     if patch['path'] !=
                                     '/instance_info/image_source']
     expected = [{'path': '/instance_info/traits',
                  'value': ["CUSTOM_TRUSTED"],
                  'op': 'add'}]
     expected += expected_deploy_patch_volume
     patch = patcher.create(node).get_deploy_patch(
         self.instance, self.image_meta, self.flavor,
         boot_from_volume=True)
     self.assertPatchEqual(expected, patch)
Beispiel #35
0
 def test_generic_get_deploy_patch_boot_from_volume_image_traits_required(
         self):
     node = ironic_utils.get_test_node(driver='fake')
     self.image_meta.properties = objects.ImageMetaProps(
         traits_required=['CUSTOM_TRUSTED'])
     expected_deploy_patch_volume = [
         patch for patch in self._expected_deploy_patch
         if patch['path'] != '/instance_info/image_source'
     ]
     expected = [{
         'path': '/instance_info/traits',
         'value': ["CUSTOM_TRUSTED"],
         'op': 'add'
     }]
     expected += expected_deploy_patch_volume
     patch = patcher.create(node).get_deploy_patch(self.instance,
                                                   self.image_meta,
                                                   self.flavor,
                                                   boot_from_volume=True)
     self.assertPatchEqual(expected, patch)
Beispiel #36
0
    def test_show_ironic_no_properties(self, mock_get, mock_list_ports):
        properties = {}
        node = ironic_utils.get_test_node(properties=properties)
        port = ironic_utils.get_test_port()
        mock_get.return_value = node
        mock_list_ports.return_value = [port]

        res_dict = self.controller.show(self.request, node.uuid)
        expected_output = {'node':
                            {'memory_mb': 0,
                             'instance_uuid': None,
                             'host': 'IRONIC MANAGED',
                             'disk_gb': 0,
                             'interfaces': [{'address': port.address}],
                             'task_state': None,
                             'id': node.uuid,
                             'cpus': 0}}
        self.assertEqual(expected_output, res_dict)
        mock_get.assert_called_once_with(node.uuid)
        mock_list_ports.assert_called_once_with(node.uuid)
    def test_plug_vifs_with_port(self, mock_address, mock_vp, mock_neutron):
        node = ironic_utils.get_test_node()
        instance = fake_instance.fake_instance_obj(self.ctx,
                                                   node=node.uuid)
        network_info = utils.get_test_network_info()
        mock_neutron.return_value.show_network.return_value = {
            'network': {
                'provider:segmentation_id': 600}}
        mock_address.return_value = ironic_utils.get_test_port(
            extra={'state': 'UP'})

        self.driver._plug_vifs(node, instance, network_info)
        expected_info = {
            'vlan': 600,
            'mac': network_info[0]['address'],
            'uuid': network_info[0]['id'],
            'pxe': False
        }
        mock_vp.assert_called_once_with(node.uuid, 'add_vnic',
                                        args=expected_info)
        mock_address.assert_called_once_with(network_info[0]['address'])
    def test_index_ironic(self, mock_list):
        properties = {"cpus": 2, "memory_mb": 1024, "local_gb": 20}
        node = ironic_utils.get_test_node(properties=properties)
        mock_list.return_value = [node]

        res_dict = self.controller.index(self.request)
        expected_output = {
            "nodes": [
                {
                    "memory_mb": properties["memory_mb"],
                    "host": "IRONIC MANAGED",
                    "disk_gb": properties["local_gb"],
                    "interfaces": [],
                    "task_state": None,
                    "id": node.uuid,
                    "cpus": properties["cpus"],
                }
            ]
        }
        self.assertEqual(expected_output, res_dict)
        mock_list.assert_called_once_with(detail=True)
    def test_show_ironic(self, mock_get, mock_list_ports):
        properties = {"cpus": 1, "memory_mb": 512, "local_gb": 10}
        node = ironic_utils.get_test_node(properties=properties)
        port = ironic_utils.get_test_port()
        mock_get.return_value = node
        mock_list_ports.return_value = [port]

        res_dict = self.controller.show(self.request, node.uuid)
        expected_output = {
            "node": {
                "memory_mb": properties["memory_mb"],
                "instance_uuid": None,
                "host": "IRONIC MANAGED",
                "disk_gb": properties["local_gb"],
                "interfaces": [{"address": port.address}],
                "task_state": None,
                "id": node.uuid,
                "cpus": properties["cpus"],
            }
        }
        self.assertEqual(expected_output, res_dict)
        mock_get.assert_called_once_with(node.uuid)
        mock_list_ports.assert_called_once_with(node.uuid)
Beispiel #40
0
 def test_show_ironic_not_implemented(self):
     with mock.patch.object(self.mod, 'ironic_client', None):
         properties = {'cpus': 1, 'memory_mb': 512, 'local_gb': 10}
         node = ironic_utils.get_test_node(properties=properties)
         self.assertRaises(exc.HTTPNotImplemented, self.controller.show,
                           self.request, node.uuid)
Beispiel #41
0
 def test_generic_get_cleanup_patch(self):
     node = ironic_utils.get_test_node(driver='fake')
     patch = patcher.create(node).get_cleanup_patch(self.instance, None,
                                                    self.flavor)
     self.assertEqual(self._expected_cleanup_patch, patch)
Beispiel #42
0
 def test_generic_get_deploy_patch(self):
     node = ironic_utils.get_test_node(driver='fake')
     patch = patcher.create(node).get_deploy_patch(
             self.instance, self.image_meta, self.flavor)
     self.assertEqual(sorted(self._expected_deploy_patch), sorted(patch))
Beispiel #43
0
 def test_create_pxe(self):
     node = ironic_utils.get_test_node(driver='pxe_fake')
     patcher_obj = patcher.create(node)
     self.assertIsInstance(patcher_obj, patcher.PXEDriverFields)
Beispiel #44
0
 def test_generic_get_cleanup_patch(self):
     node = ironic_utils.get_test_node(driver='fake')
     patch = patcher.create(node).get_cleanup_patch(self.instance, None,
                                                    self.flavor)
     self.assertEqual(self._expected_cleanup_patch, patch)
Beispiel #45
0
 def test_generic_get_deploy_patch(self):
     node = ironic_utils.get_test_node(driver='fake')
     patch = patcher.create(node).get_deploy_patch(self.instance,
                                                   self.image_meta,
                                                   self.flavor)
     self.assertPatchEqual(self._expected_deploy_patch, patch)
Beispiel #46
0
 def test_create_generic(self):
     node = ironic_utils.get_test_node(driver='pxe_fake')
     patcher_obj = patcher.create(node)
     self.assertIsInstance(patcher_obj, patcher.GenericDriverFields)