X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2Fconfig_1testbox.py;h=b8a4ea46148080250e35d74720389dab5f5703ae;hb=14f127cec6f64a00ba8c07087196cec4a39ddd27;hp=aa44e7d79de41cf5cb80d61413230e1944af65dd;hpb=9578c3c02ac9d0f1f7b6b54754a3bb68fe8c12c2;p=tests.git diff --git a/system/config_1testbox.py b/system/config_1testbox.py index aa44e7d..b8a4ea4 100644 --- a/system/config_1testbox.py +++ b/system/config_1testbox.py @@ -1,26 +1,38 @@ 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 = [ ( 'testqemu%d.onelab.eu'%i, None, None) for i in range(1,4) ] + def config (plcs, options): - if options.arch == "i386": - target = 'testbox32.onelab.eu' - elif options.arch == "x86_64": - target = 'testbox64.onelab.eu' - else: - print 'Unsupported arch %s'%options.arch - sys.exit(1) + # all plcs on the same vserver box + plc_box ='testbox-plc.onelab.eu' + # 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':target, - 'PLC_DB_HOST':target, - 'PLC_API_HOST':target, - 'PLC_BOOT_HOST':target, - 'PLC_WWW_HOST':target, - 'name':'%s-'+options.arch } ) ], - 'node': [ ('*' , {'host_box': target } ) ], + mapper = {'plc': [ ('*' , {'hostname':plc_box, + 'PLC_DB_HOST':plc_box, + 'PLC_API_HOST':plc_box, + 'PLC_BOOT_HOST':plc_box, + 'PLC_WWW_HOST':plc_box, + 'name':'%s-'+label } ) + ], + 'node': node_map, } return TestMapper(plcs,options).map(mapper)