1 # map all nodes onto the avail. pool
3 from TestMapper import TestMapper
4 from TestPool import TestPool
7 ( 'vnode%02d.inria.fr'%i, '138.96.250.22%d'%i, '02:34:56:00:00:%02d'%i) for i in range(1,10) ]
9 'network_fields:gateway':'138.96.248.250',
10 'network_fields:network':'138.96.0.0',
11 'network_fields:broadcast':'138.96.255.255',
12 'network_fields:netmask':'255.255.0.0',
13 'network_fields:dns1': '138.96.0.10',
14 'network_fields:dns2': '138.96.0.11',
17 def config (plcs, options):
19 test_pool = TestPool (onelab_plcs_pool,options)
20 test_mapper = TestMapper (plcs, options)
22 all_nodenames = test_mapper.node_names()
24 for nodename in all_nodenames:
25 if len(options.ips) != 0:
27 options.ips=options.ips[1:]
28 (hostname,ip,mac)=test_pool.locate(ip)
30 (hostname,ip,mac) = test_pool.next_free()
31 node_dict= {'node_fields:hostname':hostname,
32 'network_fields:ip':ip,
33 'network_fields:mac':mac,
36 node_dict.update(site_dict)
37 maps.append ( ( nodename, node_dict) )
39 plc_map = [ ( '*' , { 'PLC_NET_DNS1' : site_dict [ 'network_fields:dns1' ],
40 'PLC_NET_DNS2' : site_dict [ 'network_fields:dns2' ], } ) ]
42 return test_mapper.map ({'node': maps, 'plc' : plc_map } )