use fqdn for vplc
[tests.git] / system / LocalSubstrate.inria.py
1 #!/usr/bin/python3 -u
2 # -*- python3 -*-
3 # Thierry Parmentelat <thierry.parmentelat@inria.fr>
4 # Copyright (C) 2015 INRIA 
5 #
6 # this is only an example file
7 # the actual file is installed in your testmaster box as /root/LocalTestResources.py
8
9
10 if __name__ == '__main__':
11    import sys, os.path
12    sys.path.append(os.path.expanduser("~/git-tests/system"))
13
14 from Substrate import Substrate
15
16 # domain name .pl.sophia.inria.fr is implicit on our network
17 class OnelabSubstrate (Substrate):
18
19    def test_box_spec (self):
20       return 'testmaster'
21
22    # the experimental lxc-based build box
23    def build_lxc_boxes_spec (self):
24       return [ 'buzzcocks' ]
25
26    # the lxc-capable box for PLCs
27    def plc_lxc_boxes_spec (self):
28       # we now use the same box as for builds
29       return [ ('buzzcocks', 20), ]  
30
31    def qemu_boxes_spec (self):
32       # ditto, a single big box now is enough
33       return [ ('boxtops', 64), ]
34
35    
36    # may use vplc01 to 25 - out of the existing 30
37    # keep 5 upper addresses for more persistent instances
38    def vplc_ips (self):
39       return [  ( 'vplc{:02d}.pl.sophia.inria.fr'
40                       .format(i),               # DNS name
41                   'unused')                     # MAC address 
42                 for i in range(1, 26) ] 
43
44    # vnode01 to 20
45    # the nodes IP pool has a MAC address as user-data (3rd elt in tuple)
46    def vnode_ips (self):
47       return [ ( 'vnode{:02d}'.format(i),            # DNS name               
48                  '02:34:56:00:00:{:02d}'.format(i))  # MAC address
49                for i in range(1, 21) ] 
50    
51    # local network settings
52    def domain (self):
53       return 'pl.sophia.inria.fr'
54
55    def network_settings (self):
56       return { 'interface_fields:gateway':      '138.96.112.250',
57                'route_fields:next_hop':         '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                'node_fields_nint:dns':          '138.96.112.1,138.96.112.2',
64                'ipaddress_fields:netmask':      '255.255.248.0',
65                }
66
67 # the hostname for the testmaster that orchestrates the whole business
68    def testmaster (self): 
69       return 'testmaster'
70
71 local_substrate = OnelabSubstrate ()
72
73 if __name__ == '__main__':
74    local_substrate.main()