3 from TestMapper import TestMapper
4 from TestPool import TestPoolQemu
6 # a small qemu pool for now
7 onelab_qemus_pool = [ ( 'testqemu%d.onelab.eu'%i, None, None) for i in range(1,4) ]
9 def config (plcs, options):
11 # all plcs on the same vserver box
12 plc_box ='testbox-plc.onelab.eu'
14 label=options.personality.replace("linux","")
16 # all qemus on a unique pool of 64bits boxes
18 qemu_pool = TestPoolQemu (onelab_qemus_pool,options)
19 for index in range(options.size):
22 ip_or_hostname=options.ips_qemu.pop()
23 (hostname,ip,unused)=qemu_pool.locate_entry(ip_or_hostname)
25 (hostname,ip,unused) = qemu_pool.next_free()
26 node_map += [ ('node%d'%index, {'host_box':hostname},) ]
28 mapper = {'plc': [ ('*' , {'hostname':plc_box,
29 'PLC_DB_HOST':plc_box,
30 'PLC_API_HOST':plc_box,
31 'PLC_BOOT_HOST':plc_box,
32 'PLC_WWW_HOST':plc_box,
33 'name':'%s-'+label } )
38 return TestMapper(plcs,options).map(mapper)