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:in-reply-to:references; bh=n/9HPmDpUC06/2OfLXkkTZUKZkfCi6D39eNN0tBSl4k=; b=BO+oE4gKLDySffjKPc7UAkSKjrxpzbyE8+oukTWMeZ5HIc0dbhwx51PsL/BnZHrFB+ wY7rc0S0AYWLZ3WXpDuv3Yjiu0T+nKwk6QsVbVL8LHClneOsyZ9ETJQI/2q5g9oW3+Qp MiZnzMRbozYGVRueStBNHjNxK/xnl89uMBIpMnZCIHbWMEhPnecn6NFmBNyIVGViMNPA orIMdVXTI4FOYG5eB8eYpXevRmKkKxskr7nzl4QHnQjY6oRAOd6qhzsednESsf+JtknU blgTcx9jwo3KzMULgwDBd5zdQHGF3bl43C+iJIClnU/CQIGgm7HW3tdZVTO5NZ8R24mV d7AQ== From: Guilherme Campos Camargo Date: Wed, 2 May 2018 18:27:13 -0300 Message-Id: <20180502212714.26461-3-guicc@profusion.mobi> In-Reply-To: <20180502212714.26461-1-guicc@profusion.mobi> References: <20180502212714.26461-1-guicc@profusion.mobi> Subject: [Fuego] [PATCH 2/3] 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.17.0