#!/usr/bin/env python
# $Id$
-import os, sys
+import sys, os, os.path
from optparse import OptionParser
import traceback
default_steps = ['uninstall','install','install_rpm',
'configure', 'start',
- 'store_keys', 'initscripts',
+ 'clear_ssh_config','store_keys', 'initscripts',
'sites', 'nodes', 'slices',
'bootcd', 'nodegroups',
- 'start_nodes', 'check_nodes', 'check_slices' ]
+ 'kill_all_qemus', 'start_nodes',
+ 'standby_4', 'nodes_booted',
+ 'standby_6','nodes_ssh', 'check_slices',
+ 'check_tcp',
+ 'kill_qemus', ]
other_steps = [ 'fresh_install', 'stop',
'clean_sites', 'clean_nodes', 'clean_slices', 'clean_keys',
- 'stop_nodes' , 'db_dump' , 'db_restore',
+ 'list_all_qemus', 'kill_qemus', 'stop_nodes' ,
+ 'db_dump' , 'db_restore',
+ 'standby_1 through 20',
]
default_build_url = "http://svn.planet-lab.org/svn/build/trunk"
except:
setattr(parser.values,option.dest,value.split())
- def test_main (self):
+ def run (self):
steps_message="Defaut steps are\n\t%s"%(" ".join(TestMain.default_steps))
steps_message += "\nOther useful steps are\n\t %s"%(" ".join(TestMain.other_steps))
usage = """usage: %%prog [options] steps
help="Run in verbose mode")
parser.add_option("-n","--dry-run", action="store_true", dest="dry_run", default=False,
help="Show environment and exits")
+ parser.add_option("-f","--forcenm", action="store_true", dest="forcenm", default=False,
+ help="Force the NM to restart in check_slices step")
(self.options, self.args) = parser.parse_args()
if len(self.args) == 0:
# store self.path in options.path for the various callbacks
self.options.path = self.path
+ # this is useful when propagating on host boxes, to avoid conflicts
+ self.options.buildname = os.path.basename (os.path.abspath (self.path))
if self.options.verbose:
self.show_env(self.options,"Verbose")
return 0
# do all steps on all plcs
- for (name,method) in all_step_infos:
+ for (stepname,method) in all_step_infos:
for (spec,obj) in all_plcs:
- if not spec['disabled']:
+ plcname=spec['name']
+ if spec['disabled']:
+ utils.header("Plc %s is disabled - skipping step %s"%(plcname,stepname))
+ else:
try:
- utils.header("Running step %s on plc %s"%(name,spec['name']))
+ utils.header("Running step %s on plc %s"%(stepname,plcname))
step_result = method(obj,self.options)
if step_result:
- utils.header('Successful step %s on %s'%(name,spec['name']))
+ utils.header('********** SUCCESSFUL step %s on %s'%(stepname,plcname))
else:
overall_result = False
spec['disabled'] = True
- utils.header('Step %s on %s FAILED - discarding that plc from further steps'%(name,spec['name']))
+ utils.header('********** Step %s on %s FAILED - discarding that plc from further steps'%(stepname,plcname))
except:
overall_result=False
spec['disabled'] = True
- utils.header ('Step %s on plc %s FAILED (exception) - discarding this plc from further steps'%(name,spec['name']))
+ utils.header ('********** Step %s on plc %s FAILED (exception) - discarding this plc from further steps'%(stepname,plcname))
traceback.print_exc()
return overall_result
- # wrapper to shell
+ # wrapper to run, returns a shell-compatible result
def main(self):
try:
- success=self.test_main()
+ success=self.run()
if success:
return 0
else: