9181ce25ecfcf29cfa72fd0c4f7dab170f9caa12
[tests.git] / system / LocalSubstrate.inria.py
1 #!/usr/bin/python -u
2 # Thierry Parmentelat <thierry.parmentelat@inria.fr>
3 # Copyright (C) 2010 INRIA 
4 #
5 # this is only an example file
6 # the actual file is installed in your testmaster box as /root/LocalTestResources.py
7
8
9 if __name__ == '__main__':
10    import sys, os.path
11    sys.path.append(os.path.expanduser("~/git-tests/system"))
12
13 from Substrate import Substrate
14
15 # domain name .pl.sophia.inria.fr is implicit on our network
16 class OnelabSubstrate (Substrate):
17
18    def test_box_spec (self):
19       return 'testmaster'
20
21    # the experimental lxc-based build box
22    def build_lxc_boxes_spec (self):
23       return [ 'liquid', 'reed', 'velvet' ]
24
25    # the lxc-capable box for PLCs
26    def plc_lxc_boxes_spec (self):
27       return [ 
28          ('gotan', 20),         # how many plcs max in this box 
29 # deathvegas is used at least temporarily for 'real' VMs
30 #         ('deathvegas', 10),    
31          ]  
32
33    # vplc01 to 40
34    def vplc_ips (self):
35       return [  ( 'vplc%02d'%i,                 # DNS name
36                   'unused')                     # MAC address 
37                 for i in range(1,41) ] 
38
39 # as of jan 2014 this is renumbered so that 1 is preferred
40    def qemu_boxes_spec (self):
41       return [ # (hostname, how many qemus max in this box)
42 # speedball - old school but robust and a big disk
43          ('kvm64-1', 3), # 4 cores, 4Gb, 840 Gb
44 # used to have kruder too, but it is broken/dead
45 # dorfmeister
46          ('kvm64-2', 3), # 4 cores, 4Gb
47 # enfoui - this HP box behaves weird at boot-time
48 # we don't get to see much of the boot process
49 # use F10 to enter BIOS setup
50 # nodes spawned in this box won't get network connectivity
51 #         ('kvm64-3', 4), # 4 cores, 8Gb
52 # estran - big mem but small disk
53          ('kvm64-4', 2), # 4 cores, 8Gb
54 # lodos - rather old/small
55          ('kvm64-5', 1), # 2 cores, 4Gb
56 # cyblok         
57          ('kvm64-6', 1), # 2 cores, 4Gb
58          ]
59
60    # the nodes pool has a MAC address as user-data (3rd elt in tuple)
61    def vnode_ips (self):
62       return [ ( 'vnode%02d'%i,                 # DNS name               
63                  '02:34:56:00:00:%02d'%i)       # MAC address
64                for i in range(1,21) ] 
65    
66    # local network settings
67    def domain (self):
68       return 'pl.sophia.inria.fr'
69
70    def network_settings (self):
71       return { 'interface_fields:gateway':      '138.96.112.250',
72                'route_fields:next_hop':         '138.96.112.250',
73                'interface_fields:network':      '138.96.112.0',
74                'interface_fields:broadcast':    '138.96.119.255',
75                'interface_fields:netmask':      '255.255.248.0',
76                'interface_fields:dns1':         '138.96.112.1',
77                'interface_fields:dns2':         '138.96.112.2',
78                'node_fields_nint:dns':          '138.96.112.1,138.96.112.2',
79                'ipaddress_fields:netmask':      '255.255.248.0',
80                }
81
82 # the hostname for the testmaster - in case we'd like to run this remotely
83    def testmaster (self): 
84       return 'testmaster'
85
86 local_substrate = OnelabSubstrate ()
87
88 if __name__ == '__main__':
89    local_substrate.main()