From 0b3ff885d8b82405e20476f2248523b806af9740 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Wed, 23 Apr 2014 19:27:28 +0200 Subject: Add log in case of failure BZ: 189977 The hostDomainGenerator.sh script generates xml files a build time. Sometimes it fails but the log information are no sufficient to found the root cause. Add some log information in order to be able to find it. Change-Id: I505577ee30503dccf25375b0ea262461ec4cce14 Signed-off-by: Kevin Rocard Signed-off-by: Mattijs Korpershoek --- tools/xmlGenerator/hostDomainGenerator.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/xmlGenerator/hostDomainGenerator.sh b/tools/xmlGenerator/hostDomainGenerator.sh index 47bfa82..1af42ba 100755 --- a/tools/xmlGenerator/hostDomainGenerator.sh +++ b/tools/xmlGenerator/hostDomainGenerator.sh @@ -45,11 +45,11 @@ then shift exec 1>/dev/null else - exec 1> >(sed 's/^/Info: /' >&2) + exec 1> >(sed "s/^/($$) Info: /" >&2) fi # Prefix all warning and error log lines and redirect them to stderr -exec 5> >(sed 's/^/Warning: /' >&2) -exec 2> >(sed 's/^/Error: /' >&2) +exec 5> >(sed "s/^/($$) Warning: /" >&2) +exec 2> >(sed "s/^/($$) Error: /" >&2) # Get script arguments PFWconfigurationFilePath="$1"; shift @@ -91,6 +91,16 @@ export LD_LIBRARY_PATH="$HostRoot/lib:${LD_LIBRARY_PATH:-}" # Setup clean trap, it will be called automatically on exit clean_up () { status=$? + set +e # An error should not abort clean up + + ( if test $status -ne 0 + then + echo "$0 is exiting on error, printing debug information." + echo "Test platform port: $TPSocket" + echo "PFW port: $PFWSocket" + netstat --program --all --numeric --extend --tcp + ps -ejHlf + fi ) >&5 # Exit the test-platform only if it was created by this process if $TPCreated -- cgit v1.1