bonds: use rung <=> run -G that hurts my pinky
[tests.git] / system / macros.py
1 # Thierry Parmentelat <thierry.parmentelat@inria.fr>
2 # Copyright (C) 2010 INRIA 
3
4 sequences={}
5
6 "release local resources (stop vs, kill qemus)"
7 sequences['free_all'] = [ 'plcvm_stop', 'qemu_kill_mine', ]
8
9 sequences['sfa_restart'] = [
10     'sfa_stop',
11     'sfa_plcclean',
12     'sfa_dbclean',
13     'sfa_fsclean',
14     'sfa_configure',
15     'sfa_start',
16     'sfa_import',
17     'sfi_clean',
18     'sfi_configure',
19     ]
20
21 sequences ['sfa_create_slice'] = [
22     'sfa_rspec',
23     'sfa_allocate',
24     'sfa_provision',
25 ]
26
27 "re-run a complete sfa cycle from a nightly test"
28 sequences['sfa_populate'] = [ 
29     'sfa_register_site',
30     'sfa_register_pi',
31     'sfa_register_user', 
32     'sfa_update_user', 
33     'sfa_register_slice',
34     'sfa_renew_slice',
35     'sfa_discover', 
36     'sfa_create_slice', 
37     'sfa_check_slice_plc', 
38     'sfa_update_user',
39     'sfa_update_slice', 
40 # xxx this behaves weird in this context, needs more care apparently
41 # looks like at that point the PI is not allowed, while the regular is allowed to
42 # remove himself (!) and to add himself back in (!!)
43 #    'sfa_user_slice',
44     'sfi_view_all', 
45     'sfa_utest', 
46     ]
47
48 sequences['sfa_delete'] = [
49     'sfa_delete_slice', 
50     'sfa_delete_user',
51 ]
52
53 sequences['sfa'] = [
54     'sfa_restart',
55     'sfa_populate',
56 ]
57
58 sequences['sfa_create'] = [
59     'sfa_plcclean', 
60     # nuke sometimes requires the service to be stopped b/c of db locks apparently
61     'sfa_stop',
62     'sfa_dbclean',
63     'sfa_start',
64     'sfa_import', 
65     'sfi_clean',
66     'sfi_configure', 
67     'sfa_register_site',
68     'sfa_register_pi',
69     'sfa_register_user', 
70     'sfa_register_slice',
71 ]
72
73 sequences['sfa_user_slice'] = [
74     'sfa_remove_user_from_slice',
75     'sfi_show_slice_researchers', 
76     'sfa_insert_user_in_slice',
77     'sfi_show_slice_researchers', 
78 ]
79
80 sequences['sfa_provision'] = [ 
81     'sfa_discover',
82     'sfa_create_slice',
83     'sfa_check_slice_plc',
84     'sfi_view_all',
85 ]
86
87 # run the whole SFA stuff but from scratch, new vs all reinstalled and all
88 sequences['sfa_scratch'] = [
89     'show',
90     'plcvm_delete','plcvm_timestamp','plcvm_create', 
91     'plc_install', 'plc_configure', 'plc_start', 
92     'keys_fetch', 'keys_store', 'keys_clear_known_hosts', 
93     'initscripts', 'sites', 'nodes', 'slices', 'nodegroups', 'leases', 
94     'nodestate_reinstall', 'qemu_local_init','bootcd', 'qemu_local_config', 
95     'qemu_export', 'qemu_kill_mine', 'qemu_start', 'qemu_timestamp', 
96     'sfa_install_all', 'sfa_configure', 'cross_sfa_configure', 'sfa_start', 'sfa_import', 
97     'sfi_configure', 'sfa_register_user', 'sfa_register_slice', 'sfa_discover', 
98     'sfa_create_slice', 'sfa_check_slice_plc', 
99     'sfa_update_user', 'sfa_update_slice', 'sfi_view_all', 'sfa_utest',
100 ]
101
102 sequences['sfi_view_all'] = [
103     'sfi_list',
104     'sfi_show_site',
105     'sfi_show_slice',
106 ]
107
108 # macro to exercice the registry only
109 # this requires the sfavoid config
110 # so that flavour=void and thus sfa-plc is not required
111 # xxx todo
112 # this initially was just a convenience to setup a reduced depl.
113 # clearly there is a lot more to check here in terms of consistency
114 sequences['sfa_standalone'] = [
115     'show',
116     'plcvm_delete',
117     'plcvm_timestamp',
118     'plcvm_create',
119     'sfa_install_client',
120     'sfa_install_core',
121     'sfa_configure',
122     'cross_sfa_configure',
123     'sfa_start',
124     'sfa_import',
125     'sfi_configure',
126     'sfa_register_site',
127     'sfa_register_pi',
128     'sfa_register_user',
129     'sfa_register_slice',
130     'sfi_list',
131     'sfi_show_site',
132     'sfi_show_slice',
133     'sfa_delete_slice',
134     'sfa_delete_user',
135     'sfi_list',
136     'sfi_show_site',
137 #    'sfi_show_slice',
138 ]
139
140 # re-run a qemu node when things go wrong
141 # we need a scheme where we can select another qemu box
142 # this is based on a 2-step mechanism
143 #
144 # run qemu_again1
145 # rm arg-ips-bnode (or echo anotherbox > arg-ips-bnode)
146 # run qemu-again2
147
148 sequences['qemu_again1'] = [
149     'qemu_kill_mine',
150 ]
151
152 sequences['qemu_again2']=[
153     'qemu_clean_mine',
154     'nodestate_reinstall', 'qemu_local_init','bootcd', 'qemu_local_config', 
155     'qemu_clean_mine', 'qemu_export', 'qemu_start', 'qemu_timestamp', 
156     'ping_node', 'ssh_node_debug',
157     'ssh_node_boot', 'node_bmlogs', 'ssh_slice', 'ssh_slice_basics', 'check_initscripts',
158 ]
159
160 # same but only up to ping 
161 sequences['qemu_again2_ping']=[
162     'qemu_clean_mine',
163     'nodestate_reinstall', 'qemu_local_init','bootcd', 'qemu_local_config', 
164     'qemu_clean_mine', 'qemu_export', 'qemu_start', 'qemu_timestamp', 
165     'ping_node',
166 ]
167     
168 sequences['slice_up']=[
169     'fill_slices',
170     'ssh_slice',
171 ]
172 sequences['slice_down']=[
173     'empty_slices',
174     'ssh_slice_off',
175 ]
176 sequences['slice_up_down']=[
177     'slice_up',
178     'slice_down',
179 ]
180     
181 ## dealing with nodes
182 # useful also. for bonding
183 # alias nodes to node since we mostly have one node
184 sequences['node'] = [ 'nodes' ]
185
186 sequences['restart_node'] = sequences['start_node'] = """
187 qemu_kill_mine nodestate_reinstall qemu_local_init bootcd qemu_local_config 
188 qemu_clean_mine qemu_export qemu_start qemu_timestamp qemu_nodeflavour
189 """.split()
190
191 sequences['bonding_node'] = 'node start-node'.split()
192
193 sequences['wait_node'] = 'ping_node ssh_node_debug ssh_node_boot'.split()