Merge branch 'master' of ssh://git.onelab.eu/git/tests
[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 build boxes we use 
22    def build_boxes_spec (self):
23       return [ 'liquid', 'reed', 'velvet', ]
24
25    # the vs-capable box for PLCs
26    def plc_boxes_spec (self):
27       return [ ('vs64-1', 20),  # how many plcs max in this box
28                ]  
29
30    # vplc01 to 40
31    def vplc_ips (self):
32       return [  ( 'vplc%02d'%i,                 # DNS name
33                   'unused')                     # MAC address 
34                 for i in range(1,41) ] 
35
36    def qemu_boxes_spec (self):
37       return [ # how many qemus max in this box
38          ('kvm64-1', 3), # 4 cores, 4Gb
39          ('kvm64-2', 3), # 4 cores, 4Gb
40          ('kvm64-3', 2), # 2 cores, 4Gb
41          ('kvm64-4', 3), # 4 cores, 8Gb
42          ('kvm64-5', 2), # 2 cores, 4Gb
43          ('kvm64-6', 2), # 2 cores, 4Gb
44          ]
45
46    # the nodes pool has a MAC address as user-data (3rd elt in tuple)
47    def vnode_ips (self):
48       return [ ( 'vnode%02d'%i,                 # DNS name               
49                  '02:34:56:00:00:%02d'%i)       # MAC address
50                for i in range(1,21) ] 
51    
52    # local network settings
53    def domain (self):
54       return 'pl.sophia.inria.fr'
55
56    def network_settings (self):
57       return { 'interface_fields:gateway':'138.96.112.250',
58                'interface_fields:network':'138.96.112.0',
59                'interface_fields:broadcast':'138.96.119.255',
60                'interface_fields:netmask':'255.255.248.0',
61                'interface_fields:dns1': '138.96.112.1',
62                'interface_fields:dns2': '138.96.112.2',
63                }
64
65 # the hostname for the testmaster - in case we'd like to run this remotely
66    def testmaster (self): 
67       return 'testmaster'
68
69 local_substrate = OnelabSubstrate ()
70
71 if __name__ == '__main__':
72    local_substrate.main()