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 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)
     # 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 = []
Beispiel #3
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)
     # 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 = []