From: Thierry Parmentelat Date: Sat, 5 Apr 2008 08:27:29 +0000 (+0000) Subject: correct retcod - was always returning OK because of the tee thing X-Git-Tag: tests-4.2-4~86 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=54a1669cb3b066f89d023b882462686c1f4ac294;p=tests.git correct retcod - was always returning OK because of the tee thing --- diff --git a/system/TestMain.py b/system/TestMain.py index 1bf482d..9450c19 100755 --- a/system/TestMain.py +++ b/system/TestMain.py @@ -235,7 +235,7 @@ steps refer to a method in TestPlc or to a step_* module names.sort() all_step_infos += [ ("%s.%s"%(step,name),module_dict[name],force) for name in names ] except : - print 'Step %s -- ignored'%(step) + print '********** step %s NOT FOUND -- ignored'%(step) traceback.print_exc() overall_result = False diff --git a/system/runtest b/system/runtest index 9fb8e9a..6c46786 100755 --- a/system/runtest +++ b/system/runtest @@ -2,4 +2,13 @@ cd $(dirname $0) mkdir -p logs logfile=logs/runtest-$(date +%H-%M).log -exec python -u TestMain.py "$@" | tee $logfile + +# figure if TestMain succeeds, as the retcod gets lost in the pipe +rm -f logs/success +(python -u TestMain.py "$@" && touch logs/success) | tee $logfile + +if [ -f logs/success ] ; then + exit 0 +else + exit 1 +fi