Exemplo n.º 1
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        FLAGS.target_host = '127.0.0.1'
        FLAGS.xenapi_connection_url = 'test_url'
        FLAGS.xenapi_connection_password = '******'
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        self.manager = manager.AuthManager()
        self.user = self.manager.create_user('fake', 'fake', 'fake',
                                             admin=True)
        self.project = self.manager.create_project('fake', 'fake', 'fake')
        self.values = {'name': 1, 'id': 1,
                  'project_id': self.project.id,
                  'user_id': self.user.id,
                  'image_id': 1,
                  'kernel_id': None,
                  'ramdisk_id': None,
                  'instance_type': 'm1.large',
                  'mac_address': 'aa:bb:cc:dd:ee:ff',
                  'os_type': 'linux'}

        stubs.stub_out_migration_methods(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs,
                                           glance_stubs.FakeGlance)
Exemplo n.º 2
0
 def setUp(self):
     super(XenAPIVMTestCase, self).setUp()
     self.network = utils.import_object(FLAGS.network_manager)
     self.stubs = stubout.StubOutForTesting()
     self.flags(xenapi_connection_url='test_url',
                xenapi_connection_password='******',
                instance_name_template='%d')
     xenapi_fake.reset()
     xenapi_fake.create_local_srs()
     xenapi_fake.create_local_pifs()
     db_fakes.stub_out_db_instance_api(self.stubs)
     xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
     stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
     stubs.stubout_get_this_vm_uuid(self.stubs)
     stubs.stubout_stream_disk(self.stubs)
     stubs.stubout_is_vdi_pv(self.stubs)
     self.stubs.Set(vmops.VMOps, 'reset_network', reset_network)
     self.stubs.Set(vmops.VMOps, '_find_rescue_vbd_ref',
             _find_rescue_vbd_ref)
     stubs.stub_out_vm_methods(self.stubs)
     glance_stubs.stubout_glance_client(self.stubs)
     fake_utils.stub_out_utils_execute(self.stubs)
     self.user_id = 'fake'
     self.project_id = 'fake'
     self.context = context.RequestContext(self.user_id, self.project_id)
     self.conn = xenapi_conn.get_connection(False)
Exemplo n.º 3
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        FLAGS.target_host = "127.0.0.1"
        FLAGS.xenapi_connection_url = "test_url"
        FLAGS.xenapi_connection_password = "******"
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        xenapi_fake.create_network("fake", FLAGS.flat_network_bridge)
        self.manager = manager.AuthManager()
        self.user = self.manager.create_user("fake", "fake", "fake", admin=True)
        self.project = self.manager.create_project("fake", "fake", "fake")
        self.context = context.RequestContext("fake", "fake", False)
        self.values = {
            "id": 1,
            "project_id": self.project.id,
            "user_id": self.user.id,
            "image_id": 1,
            "kernel_id": None,
            "ramdisk_id": None,
            "local_gb": 5,
            "instance_type_id": "3",  # m1.large
            "mac_address": "aa:bb:cc:dd:ee:ff",
            "os_type": "linux",
        }

        fake_utils.stub_out_utils_execute(self.stubs)
        stubs.stub_out_migration_methods(self.stubs)
        stubs.stubout_get_this_vm_uuid(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs, glance_stubs.FakeGlance)
Exemplo n.º 4
0
 def setUp(self):
     super(VMWareAPIVMTestCase, self).setUp()
     self.context = context.RequestContext('fake', 'fake', False)
     self.flags(vmwareapi_host_ip='test_url',
                vmwareapi_host_username='******',
                vmwareapi_host_password='******')
     self.user_id = 'fake'
     self.project_id = 'fake'
     self.context = context.RequestContext(self.user_id, self.project_id)
     self.network = utils.import_object(FLAGS.network_manager)
     vmwareapi_fake.reset()
     db_fakes.stub_out_db_instance_api(self.stubs)
     stubs.set_stubs(self.stubs)
     glance_stubs.stubout_glance_client(self.stubs)
     self.conn = vmwareapi_conn.get_connection(False)
     # NOTE(vish): none of the network plugging code is actually
     #             being tested
     self.network_info = [({'bridge': 'fa0',
                            'id': 0,
                            'vlan': None,
                            'bridge_interface': None,
                            'injected': True},
                       {'broadcast': '192.168.0.255',
                        'dns': ['192.168.0.1'],
                        'gateway': '192.168.0.1',
                        'gateway6': 'dead:beef::1',
                        'ip6s': [{'enabled': '1',
                                  'ip': 'dead:beef::dcad:beff:feef:0',
                                        'netmask': '64'}],
                        'ips': [{'enabled': '1',
                                 'ip': '192.168.0.100',
                                 'netmask': '255.255.255.0'}],
                        'label': 'fake',
                        'mac': 'DE:AD:BE:EF:00:00',
                        'rxtx_cap': 3})]
Exemplo n.º 5
0
 def setUp(self):
     super(XenAPIVMTestCase, self).setUp()
     self.manager = manager.AuthManager()
     self.user = self.manager.create_user("fake", "fake", "fake", admin=True)
     self.project = self.manager.create_project("fake", "fake", "fake")
     self.network = utils.import_object(FLAGS.network_manager)
     self.stubs = stubout.StubOutForTesting()
     self.flags(
         xenapi_connection_url="test_url", xenapi_connection_password="******", instance_name_template="%d"
     )
     xenapi_fake.reset()
     xenapi_fake.create_local_srs()
     xenapi_fake.create_local_pifs()
     db_fakes.stub_out_db_instance_api(self.stubs)
     xenapi_fake.create_network("fake", FLAGS.flat_network_bridge)
     stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
     stubs.stubout_get_this_vm_uuid(self.stubs)
     stubs.stubout_stream_disk(self.stubs)
     stubs.stubout_is_vdi_pv(self.stubs)
     self.stubs.Set(VMOps, "reset_network", reset_network)
     stubs.stub_out_vm_methods(self.stubs)
     glance_stubs.stubout_glance_client(self.stubs, glance_stubs.FakeGlance)
     fake_utils.stub_out_utils_execute(self.stubs)
     self.context = context.RequestContext("fake", "fake", False)
     self.conn = xenapi_conn.get_connection(False)
Exemplo n.º 6
0
 def setUp(self):
     super(XenAPIVMTestCase, self).setUp()
     self.network = utils.import_object(FLAGS.network_manager)
     self.stubs = stubout.StubOutForTesting()
     self.flags(xenapi_connection_url='test_url',
                xenapi_connection_password='******',
                instance_name_template='%d')
     xenapi_fake.reset()
     xenapi_fake.create_local_srs()
     xenapi_fake.create_local_pifs()
     db_fakes.stub_out_db_instance_api(self.stubs)
     xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
     stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
     stubs.stubout_get_this_vm_uuid(self.stubs)
     stubs.stubout_stream_disk(self.stubs)
     stubs.stubout_is_vdi_pv(self.stubs)
     self.stubs.Set(vmops.VMOps, 'reset_network', reset_network)
     self.stubs.Set(vmops.VMOps, '_find_rescue_vbd_ref',
                    _find_rescue_vbd_ref)
     stubs.stub_out_vm_methods(self.stubs)
     glance_stubs.stubout_glance_client(self.stubs)
     fake_utils.stub_out_utils_execute(self.stubs)
     self.user_id = 'fake'
     self.project_id = 'fake'
     self.context = context.RequestContext(self.user_id, self.project_id)
     self.conn = xenapi_conn.get_connection(False)
Exemplo n.º 7
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        FLAGS.target_host = '127.0.0.1'
        FLAGS.xenapi_connection_url = 'test_url'
        FLAGS.xenapi_connection_password = '******'
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
        self.manager = manager.AuthManager()
        self.user = self.manager.create_user('fake', 'fake', 'fake',
                                             admin=True)
        self.project = self.manager.create_project('fake', 'fake', 'fake')
        self.context = context.RequestContext('fake', 'fake', False)
        self.values = {'id': 1,
                  'project_id': self.project.id,
                  'user_id': self.user.id,
                  'image_id': 1,
                  'kernel_id': None,
                  'ramdisk_id': None,
                  'local_gb': 5,
                  'instance_type_id': '3',  # m1.large
                  'mac_address': 'aa:bb:cc:dd:ee:ff',
                  'os_type': 'linux'}

        fake_utils.stub_out_utils_execute(self.stubs)
        stubs.stub_out_migration_methods(self.stubs)
        stubs.stubout_get_this_vm_uuid(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs,
                                           glance_stubs.FakeGlance)
Exemplo n.º 8
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        FLAGS.target_host = '127.0.0.1'
        FLAGS.xenapi_connection_url = 'test_url'
        FLAGS.xenapi_connection_password = '******'
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
        self.manager = manager.AuthManager()
        self.user = self.manager.create_user('fake',
                                             'fake',
                                             'fake',
                                             admin=True)
        self.project = self.manager.create_project('fake', 'fake', 'fake')
        self.context = context.RequestContext('fake', 'fake', False)
        self.values = {
            'id': 1,
            'project_id': self.project.id,
            'user_id': self.user.id,
            'image_id': 1,
            'kernel_id': None,
            'ramdisk_id': None,
            'local_gb': 5,
            'instance_type_id': '3',  # m1.large
            'mac_address': 'aa:bb:cc:dd:ee:ff',
            'os_type': 'linux'
        }

        fake_utils.stub_out_utils_execute(self.stubs)
        stubs.stub_out_migration_methods(self.stubs)
        stubs.stubout_get_this_vm_uuid(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs, glance_stubs.FakeGlance)
Exemplo n.º 9
0
 def setUp(self):
     super(VMWareAPIVMTestCase, self).setUp()
     self.flags(vmwareapi_host_ip='test_url',
                vmwareapi_host_username='******',
                vmwareapi_host_password='******')
     self.user_id = 'fake'
     self.project_id = 'fake'
     self.context = context.RequestContext(self.user_id, self.project_id)
     self.network = utils.import_object(FLAGS.network_manager)
     vmwareapi_fake.reset()
     db_fakes.stub_out_db_instance_api(self.stubs)
     stubs.set_stubs(self.stubs)
     glance_stubs.stubout_glance_client(self.stubs)
     self.conn = vmwareapi_conn.get_connection(False)
     # NOTE(vish): none of the network plugging code is actually
     #             being tested
     self.network_info = [({'bridge': 'fa0',
                            'id': 0,
                            'vlan': None,
                            'bridge_interface': None,
                            'injected': True},
                       {'broadcast': '192.168.0.255',
                        'dns': ['192.168.0.1'],
                        'gateway': '192.168.0.1',
                        'gateway6': 'dead:beef::1',
                        'ip6s': [{'enabled': '1',
                                  'ip': 'dead:beef::dcad:beff:feef:0',
                                        'netmask': '64'}],
                        'ips': [{'enabled': '1',
                                 'ip': '192.168.0.100',
                                 'netmask': '255.255.255.0'}],
                        'label': 'fake',
                        'mac': 'DE:AD:BE:EF:00:00',
                        'rxtx_cap': 3})]
Exemplo n.º 10
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        FLAGS.target_host = '127.0.0.1'
        FLAGS.xenapi_connection_url = 'test_url'
        FLAGS.xenapi_connection_password = '******'
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
        self.user_id = 'fake'
        self.project_id = 'fake'
        self.context = context.RequestContext(self.user_id, self.project_id)
        self.values = {'id': 1,
                  'project_id': self.project_id,
                  'user_id': self.user_id,
                  'image_ref': 1,
                  'kernel_id': None,
                  'ramdisk_id': None,
                  'local_gb': 5,
                  'instance_type_id': '3',  # m1.large
                  'os_type': 'linux',
                  'architecture': 'x86-64'}

        fake_utils.stub_out_utils_execute(self.stubs)
        stubs.stub_out_migration_methods(self.stubs)
        stubs.stubout_get_this_vm_uuid(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs)
Exemplo n.º 11
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        FLAGS.target_host = '127.0.0.1'
        FLAGS.xenapi_connection_url = 'test_url'
        FLAGS.xenapi_connection_password = '******'
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        self.manager = manager.AuthManager()
        self.user = self.manager.create_user('fake',
                                             'fake',
                                             'fake',
                                             admin=True)
        self.project = self.manager.create_project('fake', 'fake', 'fake')
        self.values = {
            'name': 1,
            'id': 1,
            'project_id': self.project.id,
            'user_id': self.user.id,
            'image_id': 1,
            'kernel_id': None,
            'ramdisk_id': None,
            'instance_type': 'm1.large',
            'mac_address': 'aa:bb:cc:dd:ee:ff',
            'os_type': 'linux'
        }

        stubs.stub_out_migration_methods(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs, glance_stubs.FakeGlance)
Exemplo n.º 12
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        self.flags(target_host="127.0.0.1", xenapi_connection_url="test_url", xenapi_connection_password="******")
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        xenapi_fake.create_network("fake", FLAGS.flat_network_bridge)
        self.user_id = "fake"
        self.project_id = "fake"
        self.context = context.RequestContext(self.user_id, self.project_id)
        self.values = {
            "id": 1,
            "project_id": self.project_id,
            "user_id": self.user_id,
            "image_ref": 1,
            "kernel_id": None,
            "ramdisk_id": None,
            "local_gb": 5,
            "instance_type_id": "3",  # m1.large
            "os_type": "linux",
            "architecture": "x86-64",
        }

        fake_utils.stub_out_utils_execute(self.stubs)
        stubs.stub_out_migration_methods(self.stubs)
        stubs.stubout_get_this_vm_uuid(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs)
Exemplo n.º 13
0
    def setUp(self):
        super(XenAPIDetermineDiskImageTestCase, self).setUp()
        glance_stubs.stubout_glance_client(self.stubs, glance_stubs.FakeGlance)

        class FakeInstance(object):
            pass

        self.fake_instance = FakeInstance()
        self.fake_instance.id = 42
        self.fake_instance.os_type = 'linux'
Exemplo n.º 14
0
    def setUp(self):
        super(XenAPIDetermineDiskImageTestCase, self).setUp()
        glance_stubs.stubout_glance_client(self.stubs, glance_stubs.FakeGlance)

        class FakeInstance(object):
            pass

        self.fake_instance = FakeInstance()
        self.fake_instance.id = 42
        self.fake_instance.os_type = "linux"
Exemplo n.º 15
0
    def setUp(self):
        super(XenAPIDetermineDiskImageTestCase, self).setUp()
        glance_stubs.stubout_glance_client(self.stubs)

        class FakeInstance(object):
            pass

        self.fake_instance = FakeInstance()
        self.fake_instance.id = 42
        self.fake_instance.os_type = 'linux'
        self.fake_instance.architecture = 'x86-64'
Exemplo n.º 16
0
    def setUp(self):
        super(VMWareAPIVMTestCase, self).setUp()
        self.context = context.RequestContext('fake', 'fake', is_admin=False)
        self.flags(vmwareapi_host_ip='test_url',
                   vmwareapi_host_username='******',
                   vmwareapi_host_password='******')
        self.user_id = 'fake'
        self.project_id = 'fake'
        self.context = context.RequestContext(self.user_id, self.project_id)
        vmwareapi_fake.reset()
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.set_stubs(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs)
        self.conn = vmwareapi_conn.VMWareESXDriver(False)
        # NOTE(vish): none of the network plugging code is actually
        #             being tested
        self.network_info = [({
            'bridge': 'fa0',
            'id': 0,
            'vlan': None,
            'bridge_interface': None,
            'injected': True
        }, {
            'broadcast':
            '192.168.0.255',
            'dns': ['192.168.0.1'],
            'gateway':
            '192.168.0.1',
            'gateway_v6':
            'dead:beef::1',
            'ip6s': [{
                'enabled': '1',
                'ip': 'dead:beef::dcad:beff:feef:0',
                'netmask': '64'
            }],
            'ips': [{
                'enabled': '1',
                'ip': '192.168.0.100',
                'netmask': '255.255.255.0'
            }],
            'label':
            'fake',
            'mac':
            'DE:AD:BE:EF:00:00',
            'rxtx_cap':
            3
        })]

        self.image = {
            'id': 'c1c8ce3d-c2e0-4247-890c-ccf5cc1c004c',
            'disk_format': 'vhd',
            'size': 512,
        }
Exemplo n.º 17
0
 def setUp(self):
     super(VMWareAPIVMTestCase, self).setUp()
     self.flags(vmwareapi_host_ip='test_url',
                vmwareapi_host_username='******',
                vmwareapi_host_password='******')
     self.manager = manager.AuthManager()
     self.user = self.manager.create_user('fake', 'fake', 'fake',
                                          admin=True)
     self.project = self.manager.create_project('fake', 'fake', 'fake')
     self.network = utils.import_object(FLAGS.network_manager)
     self.stubs = stubout.StubOutForTesting()
     vmwareapi_fake.reset()
     db_fakes.stub_out_db_instance_api(self.stubs)
     stubs.set_stubs(self.stubs)
     glance_stubs.stubout_glance_client(self.stubs,
                                        glance_stubs.FakeGlance)
     self.conn = vmwareapi_conn.get_connection(False)
Exemplo n.º 18
0
 def setUp(self):
     super(VMWareAPIVMTestCase, self).setUp()
     self.flags(vmwareapi_host_ip='test_url',
                vmwareapi_host_username='******',
                vmwareapi_host_password='******')
     self.manager = manager.AuthManager()
     self.user = self.manager.create_user('fake',
                                          'fake',
                                          'fake',
                                          admin=True)
     self.project = self.manager.create_project('fake', 'fake', 'fake')
     self.network = utils.import_object(FLAGS.network_manager)
     self.stubs = stubout.StubOutForTesting()
     vmwareapi_fake.reset()
     db_fakes.stub_out_db_instance_api(self.stubs)
     stubs.set_stubs(self.stubs)
     glance_stubs.stubout_glance_client(self.stubs, glance_stubs.FakeGlance)
     self.conn = vmwareapi_conn.get_connection(False)
Exemplo n.º 19
0
 def setUp(self):
     super(XenAPIVMTestCase, self).setUp()
     self.manager = manager.AuthManager()
     self.user = self.manager.create_user('fake', 'fake', 'fake',
                                          admin=True)
     self.project = self.manager.create_project('fake', 'fake', 'fake')
     self.network = utils.import_object(FLAGS.network_manager)
     self.stubs = stubout.StubOutForTesting()
     FLAGS.xenapi_connection_url = 'test_url'
     FLAGS.xenapi_connection_password = '******'
     xenapi_fake.reset()
     xenapi_fake.create_local_srs()
     db_fakes.stub_out_db_instance_api(self.stubs)
     xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
     stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
     stubs.stubout_get_this_vm_uuid(self.stubs)
     stubs.stubout_stream_disk(self.stubs)
     self.stubs.Set(VMOps, 'reset_network', reset_network)
     glance_stubs.stubout_glance_client(self.stubs,
                                        glance_stubs.FakeGlance)
     self.conn = xenapi_conn.get_connection(False)
Exemplo n.º 20
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        self.flags(target_host='127.0.0.1',
                xenapi_connection_url='test_url',
                xenapi_connection_password='******')
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
        self.user_id = 'fake'
        self.project_id = 'fake'
        self.context = context.RequestContext(self.user_id, self.project_id)
        self.instance_values = {'id': 1,
                  'project_id': self.project_id,
                  'user_id': self.user_id,
                  'image_ref': 1,
                  'kernel_id': None,
                  'ramdisk_id': None,
                  'local_gb': 5,
                  'instance_type_id': '3',  # m1.large
                  'os_type': 'linux',
                  'architecture': 'x86-64'}

        migration_values = {
            'source_compute': 'nova-compute',
            'dest_compute': 'nova-compute',
            'dest_host': '10.127.5.114',
            'status': 'post-migrating',
            'instance_uuid': '15f23e6a-cc6e-4d22-b651-d9bdaac316f7',
            'old_instance_type_id': 5,
            'new_instance_type_id': 1
        }
        self.migration = db.migration_create(
            context.get_admin_context(), migration_values)

        fake_utils.stub_out_utils_execute(self.stubs)
        stubs.stub_out_migration_methods(self.stubs)
        stubs.stubout_get_this_vm_uuid(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs)
Exemplo n.º 21
0
    def setUp(self):
        super(XenAPIMigrateInstance, self).setUp()
        self.stubs = stubout.StubOutForTesting()
        self.flags(target_host='127.0.0.1',
                xenapi_connection_url='test_url',
                xenapi_connection_password='******')
        db_fakes.stub_out_db_instance_api(self.stubs)
        stubs.stub_out_get_target(self.stubs)
        xenapi_fake.reset()
        xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
        self.user_id = 'fake'
        self.project_id = 'fake'
        self.context = context.RequestContext(self.user_id, self.project_id)
        self.instance_values = {'id': 1,
                  'project_id': self.project_id,
                  'user_id': self.user_id,
                  'image_ref': 1,
                  'kernel_id': None,
                  'ramdisk_id': None,
                  'local_gb': 5,
                  'instance_type_id': '3',  # m1.large
                  'os_type': 'linux',
                  'architecture': 'x86-64'}

        migration_values = {
            'source_compute': 'nova-compute',
            'dest_compute': 'nova-compute',
            'dest_host': '10.127.5.114',
            'status': 'post-migrating',
            'instance_uuid': '15f23e6a-cc6e-4d22-b651-d9bdaac316f7',
            'old_instance_type_id': 5,
            'new_instance_type_id': 1
        }
        self.migration = db.migration_create(
            context.get_admin_context(), migration_values)

        fake_utils.stub_out_utils_execute(self.stubs)
        stubs.stub_out_migration_methods(self.stubs)
        stubs.stubout_get_this_vm_uuid(self.stubs)
        glance_stubs.stubout_glance_client(self.stubs)
Exemplo n.º 22
0
 def setUp(self):
     super(XenAPIVMTestCase, self).setUp()
     self.manager = manager.AuthManager()
     self.user = self.manager.create_user('fake',
                                          'fake',
                                          'fake',
                                          admin=True)
     self.project = self.manager.create_project('fake', 'fake', 'fake')
     self.network = utils.import_object(FLAGS.network_manager)
     self.stubs = stubout.StubOutForTesting()
     FLAGS.xenapi_connection_url = 'test_url'
     FLAGS.xenapi_connection_password = '******'
     xenapi_fake.reset()
     xenapi_fake.create_local_srs()
     db_fakes.stub_out_db_instance_api(self.stubs)
     xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
     stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
     stubs.stubout_get_this_vm_uuid(self.stubs)
     stubs.stubout_stream_disk(self.stubs)
     stubs.stubout_is_vdi_pv(self.stubs)
     self.stubs.Set(VMOps, 'reset_network', reset_network)
     glance_stubs.stubout_glance_client(self.stubs, glance_stubs.FakeGlance)
     self.conn = xenapi_conn.get_connection(False)