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