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
10 # use a model that contains "vmware" to get the node actually started
12 return [ {'node_fields': {'hostname': 'test1.one-lab.org',
13 'model':'vmware/minhw'},
15 'network_fields': { 'method':'static',
17 'ip':'192.168.132.128',
18 'gateway':'192.168.132.1',
19 'network':'192.168.132.0',
20 'broadcast':'192.168.132.255',
21 'netmask':'255.255.255.0',
22 'dns1': '192.168.132.2',
25 { 'node_fields': {'hostname':'test2.one-lab.org',
26 'model':'vmware/minhw'},
28 'network_fields': {'method':'static',
30 'ip':'192.168.132.130',
31 'gateway':'192.168.132.1',
32 'network':'192.168.132.0',
33 'broadcast':'192.168.132.255',
34 'netmask':'255.255.255.0',
35 'dns1': '192.168.132.2',
41 return [ node['node_fields']['hostname'] for node in nodes()]
43 def users (domain=onelab) :
44 return [ {'name' : 'pi', 'keynames' : [ 'key1' ],
45 'user_fields' : {'first_name':'PI', 'last_name':'PI',
47 'email':'fake-pi1@%s'%domain,
50 {'name' : 'tech', 'keynames' : [ 'key1' ],
51 'user_fields' : {'first_name':'Tech', 'last_name':'Tech',
53 'email':'fake-tech1@%s'%domain,
54 'password':'testtech'},
56 {'name':'user', 'keynames' : [ 'key1' ],
57 'user_fields' : {'first_name':'User', 'last_name':'User',
59 'email':'fake-user1@%s'%domain,
60 'password':'testuser'},
62 {'name':'techuser', 'keynames' : [ 'key1' ],
63 'user_fields' : {'first_name':'UserTech', 'last_name':'UserTech',
65 'email':'fake-tech2@%s'%domain,
66 'password':'testusertech'},
67 'roles':['tech','user']},
68 {'name':'pitech', 'keynames' : [ 'key1' ],
69 'user_fields' : {'first_name':'PiTech',
72 'email':'fake-pi2@%s'%domain,
73 'password':'testusertech'},
74 'roles':['pi','tech']},
78 return [ user['name'] for user in users()]
81 return [ {'site_fields' : {'name':'mainsite',
83 'abbreviated_name':'PLanettest',
85 'url':'http://onelab-test.inria.fr',
87 'address_fields' : {'line1':'route des lucioles',
98 return [ {'name': 'key1',
99 'key_fields' : {'key_type':'ssh',
100 'key':'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4jNj8yT9ieEc6nSJz/ESu4fui9WrJ2y/MCfqIZ5WcdVKhBFUYyIenmUaeTduMcSqvoYRQ4QnFR1BFdLG8XR9D6FWZ5zTKUgpkew22EVNeqai4IXeWYKyt1Qf3ehaz9E3o1PG/bmQNIM6aQay6TD1Y4lqXI+eTVXVQev4K2fixySjFQpp9RB4UHbeA8c28yoa/cgAYHqCqlvm9uvpGMjgm/Qa4M+ZeO7NdjowfaF/wF4BQIzVFN9YRhvQ/d8WDz84B5Pr0J7pWpaX7EyC4bvdskxl6kmdNIwIRcIe4OcuIiX5Z9oO+7h/chsEVJWF4vqNIYlL9Zvyhnr0hLLhhuk2bw== root@onelab-test.inria.fr'}}
104 return [ { 'name' : 'test1',
105 'initscript_fields' : { 'enabled' : True,
107 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 1; date) > /tmp/initscript1.log \n ',
110 'initscript_fields' : { 'enabled' : True,
112 'script' : '#! /bin/sh\n (echo Starting test initscript: Stage 2; date) > /tmp/initscript2.log \n ',
117 both = [ { 'slice_fields': {'name':'main_slicetest1',
118 'instantiation':'plc-instantiated',
119 'url':'http://foo@ffo.com',
120 'description':'testslice the first slice for the site testsite',
123 'usernames' : [ 'pi','tech','techuser' ],
124 'nodenames' : all_nodenames(),
125 'initscriptname' : 'test1',
129 { 'slice_fields': {'name':'main_slicetest2',
130 'instantiation':'plc-instantiated',
131 'url':'http://foo2@ffo2.com',
132 'description':'testslice the second slice for the site testsite',
135 'usernames' : [ 'user', 'pitech' ],
136 'nodenames' : all_nodenames(),
137 'initscriptname' : 'test2',
141 # I suspect the check_slices stuff to work improperly with 2 slices
146 'name' : 'onelab-chroot',
147 # as of yet, not sure we can handle foreign hosts, but this is required though
148 'hostname' : 'localhost',
149 # use this to run in a vserver
150 # 'vserver': '138.96.250.131'
152 'PLC_ROOT_USER' : 'root@onelab-test.inria.fr',
153 'PLC_ROOT_PASSWORD' : 'test++',
154 'PLC_NAME' : 'TestLab',
155 'PLC_MAIL_ENABLED':'true',
156 'PLC_MAIL_SUPPORT_ADDRESS' : 'mohamed-amine.chaoui@sophia.inria.fr',
157 'PLC_DB_HOST' : 'onelab-test.inria.fr',
158 'PLC_API_HOST' : 'onelab-test.inria.fr',
159 'PLC_WWW_HOST' : 'onelab-test.inria.fr',
160 'PLC_BOOT_HOST' : 'onelab-test.inria.fr',
161 'PLC_NET_DNS1' : '138.96.0.10',
162 'PLC_NET_DNS2' : '138.96.0.11',
165 'initscripts': initscripts(),
169 def config (plc_specs,options):
170 return plc_specs + [ plc() ]