1 # Thierry Parmentelat <thierry.parmentelat@inria.fr>
2 # Copyright (C) 2010 INRIA
4 # a configuration module is expected:
5 # (*) to define a config method
6 # (*) that takes two arguments
7 # (**) the current set of plc_specs as output by the preceding config modules
8 # (**) TestMain options field
9 # (*) and that returns the new set of plc_specs
14 # (*) run a 32bits myplc
16 # (*) run wlab02 as a plain 32bits node
17 # (*) try and run 64bits in wlab17 (i.e. bootcd & bootstrapfs)
18 # which should be achieved by simply adding this node in the 'x86_64' nodegroup
19 # (*) investigate what it takes to have the slivers on wlab17 run 32bits as well
21 # (*) define slice 'plain' without secific tuning, that should result in f8-based slivers
22 # (*) define slice 'centos' with its vref set to centos5
23 ########## manual stuff
24 # all this would require to
25 # (*) install bootcd f8-x86_64
26 # (*) install bootstrapfs f8-x86_64
27 # (*) install noderepo f8-x86_64
28 # (*) install noderepo centos5-i386
29 # (*) install noderepo centos5-x86_64
30 # (*) install vserver centos5-i386
31 # (*) and add that to yumgroups.xml
32 ########## unclear stuff
33 # I'm pretty sure that yum.conf.php still needs hacking, at least for centos5
34 ########## unclear stuff
38 # these are real nodes, they dont get started by the framework
40 node02 = {'name':'wlab02',
41 'node_fields': {'hostname': 'wlab02.inria.fr', 'model':'Dell Latitude 830'},
43 'nodegroups' : 'wifi',
44 'interface_fields': { 'method':'dhcp', 'type' : 'ipv4', 'ip':'138.96.250.162',},
45 'extra_interfaces' : [ { 'interface_fields' : { 'method' : 'dhcp',
47 'mac' : '00:1B:77:70:F4:C6',
48 'ip' : '138.96.250.192', },
49 'settings' : { 'essid' : 'guest-inria-sophia',
50 'ifname' : 'wlan0', },
54 node17 = {'name':'wlab17',
55 'node_fields': {'hostname': 'wlab17.inria.fr', 'model':'Dell Latitude 830'},
57 'nodegroups' : ['wifi','x86_64'] ,
58 'interface_fields': { 'method':'dhcp', 'type' : 'ipv4', 'ip':'138.96.250.177',},
59 'extra_interfaces' : [ { 'interface_fields' : { 'method' : 'dhcp',
61 'mac' : '00:1c:bf:51:3c:19',
62 'ip' : '138.96.250.207',},
63 'settings' : { 'essid' : 'guest-inria-sophia',
68 node05 = {'name':'wlab05',
69 'node_fields': {'hostname': 'wlab05.inria.fr', 'model':'Dell Latitude 830'},
71 'nodegroups' : 'wifi',
72 'interface_fields': { 'method':'dhcp', 'type' : 'ipv4', 'ip':'138.96.250.165',},
73 'extra_interfaces' : [ { 'interface_fields' : { 'method' : 'static',
75 'mac' : '00:1B:77:70:FC:84',
76 'ip' : '138.96.250.215',
77 'network' : '138.96.0.0',
78 'dns1': '138.96.0.10',
79 'dns2': '138.96.0.11',
80 'broadcast' : '138.96.255.255',
81 'netmask' : '255.255.0.0',
82 'gateway' : '138.96.248.250',},
83 'settings' : { 'essid' : 'guest-inria-sophia',
86 { 'interface_fields' : { 'method' : 'dhcp',
88 'mac' : '00:20:A6:4E:FF:E6',
89 'ip' : '138.96.250.50',
90 'hostname' : 'radio40.inria.fr', },
91 'settings' : { 'essid' : 'guest-inria-sophia',
98 # wlab05 not avail. for now
99 return [ node02 , node17 ]
101 def all_nodenames ():
102 return [ node['name'] for node in nodes()]
104 def users (domain=onelab) :
105 return [ {'name' : 'pi', 'keynames' : [ 'key1' ],
106 'user_fields' : {'first_name':'PI', 'last_name':'PI',
108 'email':'fake-pi1@%s'%domain,
109 'password':'testpi'},
111 {'name' : 'tech', 'keynames' : [ 'key1' ],
112 'user_fields' : {'first_name':'Tech', 'last_name':'Tech',
114 'email':'fake-tech1@%s'%domain,
115 'password':'testtech'},
117 {'name':'user', 'keynames' : [ 'key1' ],
118 'user_fields' : {'first_name':'User', 'last_name':'User',
120 'email':'fake-user1@%s'%domain,
121 'password':'testuser'},
123 {'name':'techuser', 'keynames' : [ 'key1' ],
124 'user_fields' : {'first_name':'UserTech', 'last_name':'UserTech',
126 'email':'fake-tech2@%s'%domain,
127 'password':'testusertech'},
128 'roles':['tech','user']},
129 {'name':'pitech', 'keynames' : [ 'key1' ],
130 'user_fields' : {'first_name':'PiTech',
131 'last_name':'PiTech',
133 'email':'fake-pi2@%s'%domain,
134 'password':'testusertech'},
135 'roles':['pi','tech']},
138 def all_usernames ():
139 return [ user['name'] for user in users()]
142 return [ {'site_fields' : {'name':'wifisite',
144 'abbreviated_name':'wifi',
146 'url':'http://test.onelab.eu',
148 'address_fields' : {'line1':'route des lucioles',
151 'postalcode':'06902',
159 public_key="""ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFUYyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXeWYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzVFN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO+7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bw== root@test.onelab.eu
161 private_key="""-----BEGIN RSA PRIVATE KEY-----
162 MIIEogIBAAKCAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFU
163 YyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXe
164 WYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp
165 9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzV
166 FN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO
167 +7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bwIBIwKCAQATY32Yf4NyN93oNd/t
168 QIyTuzG0NuLI3W95J/4gI4PAnUDmv6glwRiRO92ynl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J2kD0HIZYh7aud6X6aEYNdJopbfbEhifU
185 vTbf8GtvERDoxWEsk9Qp7km8xXfKWdcZtqIwsSmn/ri5d7iyvpIk591YIHSY0dr2
186 BO+VyPNWF+kDNI8mSUwi7jLW6liMdhNOmDaSX0+0X8CHtK898xM=
187 -----END RSA PRIVATE KEY-----
191 return [ {'name': 'key1',
192 'private' : private_key,
193 'key_fields' : {'key_type':'ssh',
198 return [ { 'initscript_fields' : { 'enabled' : True,
199 'name':'script_plain',
200 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 1; date) > /tmp/initscript_plain.log \n ',
202 { 'initscript_fields' : { 'enabled' : True,
203 'name':'script_centos',
204 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 2; date) > /tmp/initscript_centos.log \n ',
209 plain= { 'slice_fields': {'name':'wifi_plain',
210 'instantiation':'plc-instantiated',
211 'url':'http://foo@foo.com',
212 'description':'plain slice',
215 'usernames' : [ 'pi','tech','techuser' ],
216 'nodenames' : all_nodenames(),
217 'initscriptname' : 'script_plain',
221 centos= { 'slice_fields': {'name':'wifi_centos',
222 'instantiation':'plc-instantiated',
223 'url':'http://foo@foo.com',
224 'description':'centos slice',
227 'usernames' : [ 'pi','tech','techuser' ],
228 'nodenames' : all_nodenames(),
229 'initscriptname' : 'script_centos',
239 # as of yet, not sure we can handle foreign hosts, but this is required though
240 'hostname' : 'wlab24.inria.fr',
241 # set these two items to run within a vserver
242 # 'vservername': 'somename'
243 # 'vserverip': '138.96.250.131'
245 'PLC_ROOT_USER' : 'root@wlab24.inria.fr',
246 'PLC_ROOT_PASSWORD' : 'test++',
247 'PLC_NAME' : 'WifiLab',
248 'PLC_MAIL_ENABLED':'true',
249 'PLC_MAIL_SUPPORT_ADDRESS' : 'thierry.parmentelat@inria.fr',
250 'PLC_DB_HOST' : 'wlab24.inria.fr',
251 'PLC_API_HOST' : 'wlab24.inria.fr',
252 'PLC_WWW_HOST' : 'wlab24.inria.fr',
253 'PLC_BOOT_HOST' : 'wlab24.inria.fr',
254 'PLC_NET_DNS1' : '138.96.0.10',
255 'PLC_NET_DNS2' : '138.96.0.11',
256 'PLC_DNS_ENABLED' : 'false',
259 'initscripts': initscripts(),
263 def config (plc_specs,options):
264 return plc_specs + [ plc() ]