Exemple #1
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)
Exemple #2
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))
Exemple #3
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)
Exemple #4
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))
Exemple #5
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 = patron_context.get_admin_context()
     self.instance = fake_instance.fake_instance_obj(self.ctx)
     # 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['root_gb']),
                                     'op': 'add'},
                                    {'path': '/instance_info/swap_mb',
                                     'value': str(self.flavor['swap']),
                                     'op': 'add'}]
     self._expected_cleanup_patch = []
Exemple #6
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 = patron_context.get_admin_context()
     self.instance = fake_instance.fake_instance_obj(self.ctx)
     # 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['root_gb']),
         'op': 'add'
     }, {
         'path': '/instance_info/swap_mb',
         'value': str(self.flavor['swap']),
         'op': 'add'
     }]
     self._expected_cleanup_patch = []