예제 #1
0
    def setUp(self):
        super(TestGlanceStore, self).setUp()
        self.store = glance.GlanceStore()

        self.flags(host='1.1.1.1',
                   port=123,
                   api_insecure=False, group='glance')
        self.flags(connection_url='test_url',
                   connection_password='******',
                   group='xenserver')

        self.context = context.RequestContext(
                'user', 'project', auth_token='foobar')

        fake.reset()
        stubs.stubout_session(self.stubs, fake.SessionBase)
        driver = xenapi_conn.XenAPIDriver(False)
        self.session = driver._session

        self.stubs.Set(
                vm_utils, 'get_sr_path', lambda *a, **kw: '/fake/sr/path')

        self.instance = {'uuid': 'blah',
                         'system_metadata': [],
                         'auto_disk_config': True,
                         'os_type': 'default',
                         'xenapi_use_agent': 'true'}
예제 #2
0
    def setUp(self):
        super(TestBittorrentStore, self).setUp()
        self.store = bittorrent.BittorrentStore()
        self.mox = mox.Mox()

        self.flags(torrent_base_url='http://foo',
                   connection_url='test_url',
                   connection_password='******',
                   group='xenserver')

        self.context = context.RequestContext(
                'user', 'project', auth_token='foobar')

        fake.reset()
        stubs.stubout_session(self.stubs, fake.SessionBase)

        def mock_iter_eps(namespace):
            return []

        self.stubs.Set(pkg_resources, 'iter_entry_points', mock_iter_eps)

        driver = xenapi_conn.XenAPIDriver(False)
        self.session = driver._session

        self.stubs.Set(
                vm_utils, 'get_sr_path', lambda *a, **kw: '/fake/sr/path')
예제 #3
0
    def setUp(self):
        super(TestGlanceStore, self).setUp()
        self.store = glance.GlanceStore()

        self.flags(host='1.1.1.1',
                   port=123,
                   api_insecure=False,
                   group='glance')
        self.flags(connection_url='test_url',
                   connection_password='******',
                   group='xenserver')

        self.context = context.RequestContext('user',
                                              'project',
                                              auth_token='foobar')

        fake.reset()
        stubs.stubout_session(self.stubs, fake.SessionBase)
        driver = xenapi_conn.XenAPIDriver(False)
        self.session = driver._session

        self.stubs.Set(vm_utils, 'get_sr_path',
                       lambda *a, **kw: '/fake/sr/path')

        self.instance = {
            'uuid': 'blah',
            'system_metadata': [],
            'auto_disk_config': True,
            'os_type': 'default',
            'xenapi_use_agent': 'true'
        }
예제 #4
0
    def setUp(self):
        super(TestBittorrentStore, self).setUp()
        self.store = bittorrent.BittorrentStore()
        self.mox = mox.Mox()

        self.flags(torrent_base_url='http://foo',
                   connection_url='test_url',
                   connection_password='******',
                   group='xenserver')

        self.context = context.RequestContext('user',
                                              'project',
                                              auth_token='foobar')

        fake.reset()
        stubs.stubout_session(self.stubs, fake.SessionBase)

        def mock_iter_eps(namespace):
            return []

        self.stubs.Set(pkg_resources, 'iter_entry_points', mock_iter_eps)

        driver = xenapi_conn.XenAPIDriver(False)
        self.session = driver._session

        self.stubs.Set(vm_utils, 'get_sr_path',
                       lambda *a, **kw: '/fake/sr/path')
예제 #5
0
    def setUp(self):
        super(ComputeXenTestCase, self).setUp()
        self.flags(compute_driver='xenapi.XenAPIDriver')
        self.flags(connection_url='test_url',
                   connection_password='******',
                   group='xenserver')

        stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
        self.compute = importutils.import_object(CONF.compute_manager)
        # execute power syncing synchronously for testing:
        self.compute._sync_power_pool = eventlet_utils.SyncPool()
예제 #6
0
    def setUp(self):
        super(ComputeXenTestCase, self).setUp()
        self.flags(compute_driver='xenapi.XenAPIDriver')
        self.flags(connection_url='test_url',
                   connection_password='******',
                   group='xenserver')

        stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
        self.compute = importutils.import_object(CONF.compute_manager)
        # execute power syncing synchronously for testing:
        self.compute._sync_power_pool = eventlet_utils.SyncPool()
예제 #7
0
 def _get_driver(self):
     stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
     self.flags(connection_url='test_url',
                connection_password='******',
                group='xenserver')
     return xenapi.XenAPIDriver(fake.FakeVirtAPI(), False)
예제 #8
0
 def _get_driver(self):
     stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
     self.flags(connection_url='test_url',
                connection_password='******', group='xenserver')
     return xenapi.XenAPIDriver(fake.FakeVirtAPI(), False)