1 # a configuration module is expected:
2 # (*) to define a config method
3 # (*) that takes two arguments
4 # (**) the current set of plc_specs as output by the preceding config modules
5 # (**) TestMain options field
6 # (*) and that returns the new set of plc_specs
11 # (*) run a 32bits myplc
13 # (*) run wlab02 as a plain 32bits node
14 # (*) try and run 64bits in wlab17 (i.e. bootcd & bootstrapfs)
15 # which should be achieved by simply adding this node in the 'x86_64' nodegroup
16 # (*) investigate what it takes to have the slivers on wlab17 run 32bits as well
18 # (*) define slice 'plain' without secific tuning, that should result in f8-based slivers
19 # (*) define slice 'centos' with its vref set to centos5
20 ########## manual stuff
21 # all this would require to
22 # (*) install bootcd f8-x86_64
23 # (*) install bootstrapfs f8-x86_64
24 # (*) install noderepo f8-x86_64
25 # (*) install noderepo centos5-i386
26 # (*) install noderepo centos5-x86_64
27 # (*) install vserver centos5-i386
28 # (*) and add that to yumgroups.xml
29 ########## unclear stuff
30 # I'm pretty sure that yum.conf.php still needs hacking, at least for centos5
31 ########## unclear stuff
35 # these are real nodes, they dont get started by the framework
37 node02 = {'name':'wlab02',
38 'node_fields': {'hostname': 'wlab02.inria.fr', 'model':'Dell Latitude 830'},
40 'nodegroups' : 'wifi',
41 'interface_fields': { 'method':'dhcp', 'type' : 'ipv4', 'ip':'138.96.250.162',},
42 'extra_interfaces' : [ { 'interface_fields' : { 'method' : 'dhcp',
44 'mac' : '00:1B:77:70:F4:C6',
45 'ip' : '138.96.250.192', },
46 'settings' : { 'essid' : 'guest-inria-sophia',
47 'ifname' : 'wlan0', },
51 node17 = {'name':'wlab17',
52 'node_fields': {'hostname': 'wlab17.inria.fr', 'model':'Dell Latitude 830'},
54 'nodegroups' : ['wifi','x86_64'] ,
55 'interface_fields': { 'method':'dhcp', 'type' : 'ipv4', 'ip':'138.96.250.177',},
56 'extra_interfaces' : [ { 'interface_fields' : { 'method' : 'dhcp',
58 'mac' : '00:1c:bf:51:3c:19',
59 'ip' : '138.96.250.207',},
60 'settings' : { 'essid' : 'guest-inria-sophia',
65 node05 = {'name':'wlab05',
66 'node_fields': {'hostname': 'wlab05.inria.fr', 'model':'Dell Latitude 830'},
68 'nodegroups' : 'wifi',
69 'interface_fields': { 'method':'dhcp', 'type' : 'ipv4', 'ip':'138.96.250.165',},
70 'extra_interfaces' : [ { 'interface_fields' : { 'method' : 'static',
72 'mac' : '00:1B:77:70:FC:84',
73 'ip' : '138.96.250.215',
74 'network' : '138.96.0.0',
75 'dns1': '138.96.0.10',
76 'dns2': '138.96.0.11',
77 'broadcast' : '138.96.255.255',
78 'netmask' : '255.255.0.0',
79 'gateway' : '138.96.248.250',},
80 'settings' : { 'essid' : 'guest-inria-sophia',
83 { 'interface_fields' : { 'method' : 'dhcp',
85 'mac' : '00:20:A6:4E:FF:E6',
86 'ip' : '138.96.250.50',
87 'hostname' : 'radio40.inria.fr', },
88 'settings' : { 'essid' : 'guest-inria-sophia',
95 # wlab05 not avail. for now
96 return [ node02 , node17 ]
99 return [ node['name'] for node in nodes()]
101 def users (domain=onelab) :
102 return [ {'name' : 'pi', 'keynames' : [ 'key1' ],
103 'user_fields' : {'first_name':'PI', 'last_name':'PI',
105 'email':'fake-pi1@%s'%domain,
106 'password':'testpi'},
108 {'name' : 'tech', 'keynames' : [ 'key1' ],
109 'user_fields' : {'first_name':'Tech', 'last_name':'Tech',
111 'email':'fake-tech1@%s'%domain,
112 'password':'testtech'},
114 {'name':'user', 'keynames' : [ 'key1' ],
115 'user_fields' : {'first_name':'User', 'last_name':'User',
117 'email':'fake-user1@%s'%domain,
118 'password':'testuser'},
120 {'name':'techuser', 'keynames' : [ 'key1' ],
121 'user_fields' : {'first_name':'UserTech', 'last_name':'UserTech',
123 'email':'fake-tech2@%s'%domain,
124 'password':'testusertech'},
125 'roles':['tech','user']},
126 {'name':'pitech', 'keynames' : [ 'key1' ],
127 'user_fields' : {'first_name':'PiTech',
128 'last_name':'PiTech',
130 'email':'fake-pi2@%s'%domain,
131 'password':'testusertech'},
132 'roles':['pi','tech']},
135 def all_usernames ():
136 return [ user['name'] for user in users()]
139 return [ {'site_fields' : {'name':'wifisite',
141 'abbreviated_name':'wifi',
143 'url':'http://test.onelab.eu',
145 'address_fields' : {'line1':'route des lucioles',
148 'postalcode':'06902',
156 public_key="""ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFUYyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXeWYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzVFN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO+7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bw== root@test.onelab.eu
158 private_key="""-----BEGIN RSA PRIVATE KEY-----
159 MIIEogIBAAKCAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFU
160 YyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXe
161 WYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp
162 9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzV
163 FN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO
164 +7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bwIBIwKCAQATY32Yf4NyN93oNd/t
165 QIyTuzG0NuLI3W95J/4gI4PAnUDmv6glwRiRO92ynlnnAjqFW/LZ5sGFd4k8YoYU
166 sjaa8JJgpwrJBi9y6Fx47/9Tp+ITPqyoliyT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dcZtqIwsSmn/ri5d7iyvpIk591YIHSY0dr2
183 BO+VyPNWF+kDNI8mSUwi7jLW6liMdhNOmDaSX0+0X8CHtK898xM=
184 -----END RSA PRIVATE KEY-----
188 return [ {'name': 'key1',
189 'private' : private_key,
190 'key_fields' : {'key_type':'ssh',
195 return [ { 'initscript_fields' : { 'enabled' : True,
196 'name':'script_plain',
197 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 1; date) > /tmp/initscript_plain.log \n ',
199 { 'initscript_fields' : { 'enabled' : True,
200 'name':'script_centos',
201 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 2; date) > /tmp/initscript_centos.log \n ',
206 plain= { 'slice_fields': {'name':'wifi_plain',
207 'instantiation':'plc-instantiated',
208 'url':'http://foo@foo.com',
209 'description':'plain slice',
212 'usernames' : [ 'pi','tech','techuser' ],
213 'nodenames' : all_nodenames(),
214 'initscriptname' : 'script_plain',
218 centos= { 'slice_fields': {'name':'wifi_centos',
219 'instantiation':'plc-instantiated',
220 'url':'http://foo@foo.com',
221 'description':'centos slice',
224 'usernames' : [ 'pi','tech','techuser' ],
225 'nodenames' : all_nodenames(),
226 'initscriptname' : 'script_centos',
236 # as of yet, not sure we can handle foreign hosts, but this is required though
237 'hostname' : 'wlab24.inria.fr',
238 # set these two items to run within a vserver
239 # 'vservername': 'somename'
240 # 'vserverip': '138.96.250.131'
242 'PLC_ROOT_USER' : 'root@wlab24.inria.fr',
243 'PLC_ROOT_PASSWORD' : 'test++',
244 'PLC_NAME' : 'WifiLab',
245 'PLC_MAIL_ENABLED':'true',
246 'PLC_MAIL_SUPPORT_ADDRESS' : 'thierry.parmentelat@sophia.inria.fr',
247 'PLC_DB_HOST' : 'wlab24.inria.fr',
248 'PLC_API_HOST' : 'wlab24.inria.fr',
249 'PLC_WWW_HOST' : 'wlab24.inria.fr',
250 'PLC_BOOT_HOST' : 'wlab24.inria.fr',
251 'PLC_NET_DNS1' : '138.96.0.10',
252 'PLC_NET_DNS2' : '138.96.0.11',
253 'PLC_DNS_ENABLED' : 'false',
256 'initscripts': initscripts(),
260 def config (plc_specs,options):
261 return plc_specs + [ plc() ]