1 # map all nodes onto the avail. pool
4 from TestMapper import TestMapper
5 from TestPool import TestPoolIP
7 onelab_nodes_ip_pool = [
8 ( 'vnode%02d.inria.fr'%i,
9 '138.96.255.%d'%(220+i),
10 '02:34:56:00:00:%02d'%i) for i in range(1,10) ]
13 'interface_fields:gateway':'138.96.248.250',
14 'interface_fields:network':'138.96.0.0',
15 'interface_fields:broadcast':'138.96.255.255',
16 'interface_fields:netmask':'255.255.0.0',
17 'interface_fields:dns1': '138.96.0.10',
18 'interface_fields:dns2': '138.96.0.11',
21 def config (plcs, options):
23 ip_pool = TestPoolIP (onelab_nodes_ip_pool,options)
24 test_mapper = TestMapper (plcs, options)
26 all_nodenames = test_mapper.node_names()
28 for nodename in all_nodenames:
30 ip_or_hostname=options.ips_node.pop()
31 (hostname,ip,mac)=ip_pool.locate_entry(ip_or_hostname)
33 (hostname,ip,mac) = ip_pool.next_free()
34 utils.header('Attaching node %s to %s (%s)'%(nodename,hostname,ip))
35 node_dict= {'node_fields:hostname':hostname,
36 'interface_fields:ip':ip,
37 'interface_fields:mac':mac,
40 node_dict.update(site_dict)
41 maps.append ( ( nodename, node_dict) )
43 plc_map = [ ( '*' , { 'PLC_NET_DNS1' : site_dict [ 'interface_fields:dns1' ],
44 'PLC_NET_DNS2' : site_dict [ 'interface_fields:dns2' ], } ) ]
46 return test_mapper.map ({'node': maps, 'plc' : plc_map } )