Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profusion-mobi.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=G6zU5oDQletZf70Ccp+Un2QbLAT0yqqUA7aSo2qewcA=; b=dLPZW4vAvSET9Y6fQ8oIjGrcvDo1M9F8Ydooiehu10MF2PL4WWEbpCtQsHYYdDQ8Yb UN9E/rkwNDW4bGCa2gL1Df7KN6QynZ5vjRf0V7BNoXcqFHqhKEh3IBrCJPtJ5DXri+Rm zh517HDk84eNDBo03lFidrDxTkl76pXSMx64Z8zAWXJzYbCoQ5kgwA87/zJsFDt8lwxH 9sxtIrGC0/fZbKUD29Ayw4Y3kKd54Juk4m4ORVh13vMxhvg/JEERTSfGIqTWiKdXcEci TXyau6uBjiz0Fexfd/woN4X17iRdZCv3w1Hp9/uUBIsyzvtmt5m5PyvmSWHfvDS1kn2h 8yOA== From: Guilherme Campos Camargo Date: Wed, 7 Mar 2018 17:07:14 -0300 Message-Id: <20180307200714.18498-1-guicc@profusion.mobi> Subject: [Fuego] [PATCH] Return error if docker install script fails List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org Before this patch, install.sh would return 0 even if fuego-host-scripts/docker-build-image.sh (that's sourced in it) failed, what could possibly mislead a script or program that depends on its return. By using 'set -e' we make sure that any failure inside its sourced scripts is propagated, aborting the execution and returning the proper error code. Signed-off-by: Guilherme Campos Camargo --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index 2193559..6441ff0 100755 --- a/install.sh +++ b/install.sh @@ -1,2 +1,6 @@ +#!/bin/bash + +set -e + source fuego-host-scripts/docker-build-image.sh $1 sudo /bin/sh -c "if [ -f /etc/ttc.conf -a ! -f fuego-ro/conf/ttc.conf ] ; then cp /etc/ttc.conf fuego-ro/conf/ttc.conf ; fi" -- 2.16.2