def setUp(self): super(TestGlanceStore, self).setUp() self.store = glance.GlanceStore() self.flags(api_servers=['http://localhost:9292'], group='glance') self.flags(connection_url='http://localhost', connection_password='******', group='xenserver') self.context = context.RequestContext('user', 'project', auth_token='foobar') fake.reset() stubs.stubout_session(self, fake.SessionBase) driver = xenapi_conn.XenAPIDriver(False) self.session = driver._session self.stub_out('nova.virt.xenapi.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' }
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' }