From: Thierry Parmentelat Date: Thu, 30 Sep 2010 07:23:53 +0000 (+0200) Subject: convenience X-Git-Tag: tests-5.0-18~9 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=4758f52d7c94ac82c573d5e4dbedc409669624eb;p=tests.git convenience --- diff --git a/system/TestMain.py b/system/TestMain.py index 964209e..0d4e2a7 100755 --- a/system/TestMain.py +++ b/system/TestMain.py @@ -259,7 +259,7 @@ steps refer to a method in TestPlc or to a step_* module ips_qemu_file.close() # build a TestPlc object from the result, passing options for spec in all_plc_specs: - spec['disabled'] = False + spec['failed_step'] = False all_plcs = [ (x, TestPlc(x,self.options)) for x in all_plc_specs] # pass options to utils as well @@ -337,7 +337,7 @@ steps refer to a method in TestPlc or to a step_* module # run the step beg=strftime(TIME_FORMAT) - if not spec['disabled'] or force or self.options.interactive or self.options.keep_going: + if not spec['failed_step'] or force or self.options.interactive or self.options.keep_going: skip_step=False if self.options.interactive: prompting=True @@ -369,7 +369,7 @@ steps refer to a method in TestPlc or to a step_* module continue try: force_msg="" - if force: force_msg=" (forced)" + if force and spec['failed_step']: force_msg=" (forced after %s has failed)" utils.header("********** %d RUNNING step %s%s on plc %s"%(plc_counter,stepname,force_msg,plcname)) if not cross: step_result = method(plc_obj) else: step_result = method(plc_obj,across_plcs) @@ -378,13 +378,13 @@ steps refer to a method in TestPlc or to a step_* module status="OK" else: overall_result = False - spec['disabled'] = True + spec['failed_step'] = stepname utils.header('********** %d FAILED Step %s on %s (discarded from further steps)'\ %(plc_counter,stepname,plcname)) status="KO" except: overall_result=False - spec['disabled'] = True + spec['failed_step'] = stepname traceback.print_exc() utils.header ('********** %d FAILED (exception) Step %s on %s (discarded from further steps)'\ %(plc_counter,stepname,plcname)) @@ -392,7 +392,8 @@ steps refer to a method in TestPlc or to a step_* module # do not run, just display it's skipped else: - utils.header("********** %d IGNORED Plc %s is disabled - skipping step %s"%(plc_counter,plcname,stepname)) + why="has failed %s"%spec['failed_step'] + utils.header("********** %d SKIPPED Step %s on %s (%s)"%(plc_counter,stepname,plcname,why)) status="UNDEF" if not self.options.dry_run: end=strftime(TIME_FORMAT) diff --git a/system/TestPlc.py b/system/TestPlc.py index acb5d07..ae61522 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -90,12 +90,11 @@ class TestPlc: 'delete_vs','create_vs','install', 'configure', 'start', SEP, 'fetch_keys', 'store_keys', 'clear_known_hosts', SEP, 'initscripts', 'sites', 'nodes', 'slices', 'nodegroups', 'leases', SEP, - 'reinstall_node', 'init_node','bootcd', 'configure_qemu', 'export_qemu', - 'kill_all_qemus', 'start_node', SEP, - # better use of time: do this now that the nodes are taking off - 'plcsh_stress_test', SEP, + 'reinstall_node', 'init_node','bootcd', 'configure_qemu', 'export_qemu', 'kill_all_qemus', 'start_node', SEP, 'install_sfa', 'configure_sfa', 'cross_configure_sfa', 'import_sfa', 'start_sfa', SEPSFA, 'configure_sfi@1', 'add_sfa@1', 'create_sfa@1', 'update_sfa@1', 'view_sfa@1', SEPSFA, + # better use of time: do this now that the nodes are taking off + 'plcsh_stress_test', SEP, 'nodes_ssh_debug', 'nodes_ssh_boot', 'check_slice', 'check_initscripts', SEPSFA, 'check_slice_sfa@1', 'delete_sfa_user@1', 'delete_sfa_slices@1', SEPSFA, 'check_tcp', 'check_hooks', SEP, @@ -1070,7 +1069,8 @@ class TestPlc: def dbclean_sfa(self): "thoroughly wipes off the SFA database" - return self.run_in_guest("sfa-nuke-plc.py")==0 + self.run_in_guest("sfa-nuke-plc.py")==0 + return True def plcclean_sfa(self): "cleans the PLC entries that were created as a side effect of running the script" @@ -1094,6 +1094,8 @@ class TestPlc: self.run_in_guest("rm -rf /var/lib/sfa") self.run_in_guest("rm -rf /etc/sfa") self.run_in_guest("rm -rf /var/log/sfa_access.log /var/log/sfa_import_plc.log /var/log/sfa.daemon") + # xxx tmp + self.run_in_guest("rpm -e --noscripts sfa-plc") return True ### @@ -1293,7 +1295,8 @@ class TestPlc: def stop_sfa(self): "service sfa stop" - return self.run_in_guest('service sfa stop')==0 + self.run_in_guest('service sfa stop')==0 + return True def populate (self): "creates random entries in the PLCAPI"