X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2Fconfig_1testbox.py;fp=system%2Fconfig_1testbox.py;h=b8af153cdfca2275c6fb5ce17256245a4e40df73;hb=85a5dd88bde32c6e6cceba01d633d64ee65a702b;hp=a80a52a5d2611ee9e0dcd7daf8f2e04dbd5a2dd4;hpb=121fc8f1b0a90d1d4361b93d611ab3e5815f5f40;p=tests.git diff --git a/system/config_1testbox.py b/system/config_1testbox.py index a80a52a..b8af153 100644 --- a/system/config_1testbox.py +++ b/system/config_1testbox.py @@ -1,24 +1,34 @@ import sys from TestMapper import TestMapper +from TestPool import TestPoolQemu -# using mapper to do the reallocation job - +# a small qemu pool for now +onelab_qemus_pool = [ + ( 'kruder.inria.fr', None, None), + ( 'estran.inria.fr', None, None), +# cut here + ( 'blitz.inria.fr', None, None), +] + def config (plcs, options): - if options.personality == "linux32": - plc_box ='speedball.inria.fr' - node_box1 = 'testbox64_1.onelab.eu' - node_box2 = 'testbox64_2.onelab.eu' - label="32" - elif options.personality == "linux64": - plc_box = 'speedball.inria.fr' - node_box1 = 'testbox64_1.onelab.eu' - node_box2 = 'testbox64_2.onelab.eu' - label="64" - else: - print 'Unsupported personality %s'%options.personality - sys.exit(1) + # all plcs on the same vserver box + plc_box ='speedball.inria.fr' + # informative + label=options.personality.replace("linux","") + + # all qemus on a unique pool of 64bits boxes + node_map = [] + qemu_pool = TestPoolQemu (onelab_qemus_pool,options) + for index in range(options.size): + index += 1 + if options.ips_qemu: + ip_or_hostname=options.ips_qemu.pop() + (hostname,ip,unused)=qemu_pool.locate_entry(ip_or_hostname) + else: + (hostname,ip,unused) = qemu_pool.next_free() + node_map += [ ('node%d'%index, {'host_box':hostname},) ] mapper = {'plc': [ ('*' , {'hostname':plc_box, 'PLC_DB_HOST':plc_box, @@ -27,9 +37,7 @@ def config (plcs, options): 'PLC_WWW_HOST':plc_box, 'name':'%s-'+label } ) ], - 'node': [ ('node1' , {'host_box': node_box1 } ), - ('node2' , {'host_box': node_box2 } ), - ], + 'node': node_map, } return TestMapper(plcs,options).map(mapper)