From ce062d315394b813ce79849c6595d198351c2cec Mon Sep 17 00:00:00 2001 From: Gwenael Lambrouin Date: Mon, 13 Dec 2021 13:48:14 +0100 Subject: nfvbenchvm: abort build on error Make sure a VM image build fails if any step fails. Else we can end up with a bad image not containing all that we want, and we discover this later at run time. For instance, without the current patch, we can get a generator VM image without nfvbench installed because "pip install" failed, but this is not detected by the build process because the last step in post-install.d/52-nfvbench-script is an "echo" command that returns a success code. We fix this by making all the Bash scripts fail if any command whose return code is not tested fails (set -euo pipefail). Change-Id: Ic5ec9eb85a8d6e7e4d1dcbac8ebcac5931e4808e Signed-off-by: Gwenael Lambrouin --- .../dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute') diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute index 666d9dc..c96740f 100755 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute @@ -1,5 +1,8 @@ #!/bin/bash +# Stop on error +set -euo pipefail + chmod +x /etc/rc.d/rc.local chmod +x /etc/sysconfig/network-scripts/ifcfg-eth0 chmod +x /etc/profile.d/nfvbench.sh -- cgit 1.2.3-korg