From: Thierry Parmentelat Date: Mon, 27 Jan 2014 08:26:44 +0000 (+0100) Subject: various fixes for the warning mode X-Git-Tag: tests-5.3-2~30 X-Git-Url: http://git.onelab.eu/?p=tests.git;a=commitdiff_plain;h=87f953c20a5a10273673e0fab3a6ded79475ad4c various fixes for the warning mode --- diff --git a/system/TestMain.py b/system/TestMain.py index 0c84e35..cf8f670 100755 --- a/system/TestMain.py +++ b/system/TestMain.py @@ -286,7 +286,7 @@ steps refer to a method in TestPlc or to a step_* module if self.options.list_steps: self.init_steps() self.list_steps() - return True + return 'SUCCESS' # steps if not self.options.steps: @@ -299,6 +299,7 @@ steps refer to a method in TestPlc or to a step_* module self.options.exclude = [ step.replace('-','_') for step in self.options.exclude ] self.options.ignore = [ step.replace('-','_') for step in self.options.ignore ] + # technicality, decorate known steps to produce the '_ignore' version TestPlc.create_ignore_steps() # exclude @@ -441,7 +442,7 @@ steps refer to a method in TestPlc or to a step_* module skip_step=True elif answer in ['q','b']: # quit/bye print 'Exiting' - return + return 'FAILURE' elif answer in ['d']: # dry_run dry_run=self.options.dry_run self.options.dry_run=True @@ -540,4 +541,4 @@ steps refer to a method in TestPlc or to a step_* module if __name__ == "__main__": exit_code = TestMain().main() print 'run_log is exiting',exit_code - sys.exit(TestMain().main()) + sys.exit(exit_code) diff --git a/system/TestPlc.py b/system/TestPlc.py index 7c629f0..dd422a8 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -83,7 +83,6 @@ def ignore_result (method): class slice_mapper__tasks (object): # could not get this to work with named arguments def __init__ (self,timeout_minutes,silent_minutes,period_seconds): - print "timeout_minutes,silent_minutes,period_seconds",timeout_minutes,silent_minutes,period_seconds self.timeout=timedelta(minutes=timeout_minutes) self.silent=timedelta(minutes=silent_minutes) self.period=timedelta(seconds=period_seconds) diff --git a/system/run_log b/system/run_log index 16ed934..e170463 100755 --- a/system/run_log +++ b/system/run_log @@ -12,11 +12,9 @@ tracelast=trace rm -f logs/success rm -f logs/$runlast; (cd logs; ln -s $runfile $runlast) rm -f logs/$tracelast; (cd logs; ln -s $tracefile $tracelast) -python -u TestMain.py -t logs/$tracefile "$@" &> logs/$runfile && touch logs/success +python -u TestMain.py -t logs/$tracefile "$@" &> logs/$runfile ; retcod=$? cat logs/$runfile +[ "$retcod" == 0 ] && touch logs/success -if [ -f logs/success ] ; then - exit 0 -else - exit 1 -fi +echo "run_log is exiting" $retcod +exit $retcod