203
202
self.context = context.RequestContext(self.user_id, self.project_id)
204
203
self.conn = xenapi_conn.get_connection(False)
206
def test_parallel_builds(self):
207
stubs.stubout_loopingcall_delay(self.stubs)
209
def _do_build(id, proj, user, *args):
217
'instance_type_id': '3', # m1.large
219
'architecture': 'x86-64'}
220
network_info = [({'bridge': 'fa0', 'id': 0, 'injected': False},
221
{'broadcast': '192.168.0.255',
222
'dns': ['192.168.0.1'],
223
'gateway': '192.168.0.1',
224
'gateway6': 'dead:beef::1',
225
'ip6s': [{'enabled': '1',
226
'ip': 'dead:beef::dcad:beff:feef:0',
228
'ips': [{'enabled': '1',
229
'ip': '192.168.0.100',
230
'netmask': '255.255.255.0'}],
232
'mac': 'DE:AD:BE:EF:00:00',
234
instance = db.instance_create(self.context, values)
235
self.conn.spawn(self.context, instance, network_info)
237
gt1 = eventlet.spawn(_do_build, 1, self.project_id, self.user_id)
238
gt2 = eventlet.spawn(_do_build, 2, self.project_id, self.user_id)
242
205
def test_list_instances_0(self):
243
206
instances = self.conn.list_instances()
244
207
self.assertEquals(instances, [])