SF Bug 2191 - [Raptor] - When forcesuccess is enabled, exit status for a failed recipe is "retry" but should be "failed"
--- a/sbsv2/raptor/RELEASE-NOTES.txt Thu Mar 04 10:28:45 2010 +0000
+++ b/sbsv2/raptor/RELEASE-NOTES.txt Wed Mar 10 17:21:26 2010 +0000
@@ -2,6 +2,7 @@
next version
- SF Bug 2125 - [Raptor] - tracecompiler what output incorrect if mmp basename contains '.' e.g. fred.prd.mmp
+- SF Bug 2191 - [Raptor] - When forcesuccess is enabled, exit status for a failed recipe is "retry" but should be "failed"
version 2.12.4
--- a/sbsv2/raptor/util/talon/talon.c Thu Mar 04 10:28:45 2010 +0000
+++ b/sbsv2/raptor/util/talon/talon.c Wed Mar 10 17:21:26 2010 +0000
@@ -586,7 +586,7 @@
if (p->returncode != 0)
{
- char *exitstr = retries > 0 ? "retry" : "failed";
+ char *exitstr = force_success ? "failed" : retries > 0 ? "retry" : "failed";
snprintf(status, STATUS_STRMAX - 1, "\n<status exit='%s' code='%d' attempt='%d'%s%s />", exitstr, p->returncode, attempt, flagsstr, reasonstr );
} else {
snprintf(status, STATUS_STRMAX - 1, "\n<status exit='ok' attempt='%d'%s%s />", attempt, flagsstr, reasonstr );
--- a/sbsv2/raptor/util/talon/tests/config.sh Thu Mar 04 10:28:45 2010 +0000
+++ b/sbsv2/raptor/util/talon/tests/config.sh Wed Mar 10 17:21:26 2010 +0000
@@ -16,9 +16,19 @@
#
# set up the environment for some talon tests.
+eval `$SBS_HOME/bin/gethost.sh -e`
+
+if [[ "$HOSTPLATFORM" =~ "win" ]]; then
+TEST_SHELL=$(cygpath -w $SBS_HOME/win32/bin/talon.exe)
+TEST_TALON_SHELL=$(cygpath -w $SBS_CYGWIN/bin/bash.exe)
+else
+TEST_SHELL=$SBS_HOME/$HOSTPLATFORM_DIR/bin/talon
+TEST_TALON_SHELL=/bin/bash
+fi
+
cat >settings.mk <<-endofsettings
- SHELL:=$(cygpath -w $SBS_HOME/win32/bin/talon.exe)
- TALON_SHELL:=$(cygpath -w $SBS_CYGWIN/bin/bash.exe)
+ SHELL:=$TEST_SHELL
+ TALON_SHELL:=$TEST_TALON_SHELL
TALON_BUILDID:=100
TALON_DEBUG:=""
export TALON_SHELL TALON_BUILDID TALON_DEBUG
--- a/sbsv2/raptor/util/talon/tests/t4.mk Thu Mar 04 10:28:45 2010 +0000
+++ b/sbsv2/raptor/util/talon/tests/t4.mk Wed Mar 10 17:21:26 2010 +0000
@@ -23,6 +23,11 @@
$(info testing timeouts)
$(info )
-all:
+.PHONY: all passed
+
+all: passed
+ @echo "t4-PASSED"
+
+passed:
@|PLATFORM=armv5;MMP=barney.mmp;BLDINF=somebld.inf;|echo "Started a slow command under talon (attempt $$TALON_ATTEMPT):";echo "SHELL=$$SHELL";if (( $$TALON_ATTEMPT <4 )); then echo sleeping 6; sleep 6; echo "hi"; else echo "Not sleeping this time"; fi; echo "this should not appear in the recipe tags unless you try 4 times."
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/util/talon/tests/t6.mk Wed Mar 10 17:21:26 2010 +0000
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+include settings.mk
+
+# Making sure that forcesuccess works.
+
+TALON_RECIPEATTRIBUTES:=flags='$$TALON_FLAGS'
+TALON_RETRIES:=1
+
+export TALON_RECIPEATTRIBUTES TALON_RETRIES
+
+.PHONY: all fred
+
+all: fred
+ @echo "t6-PASSED"
+
+fred:
+ |TALON_FLAGS=FORCESUCCESS;|echo "Forcesuccess'd command"; exit 1
+
+