nfvbenchvm: abort build on error 32/73232/1
authorGwenael Lambrouin <gwenael.lambrouin@orange.com>
Mon, 13 Dec 2021 12:48:14 +0000 (13:48 +0100)
committerGwenael Lambrouin <gwenael.lambrouin@orange.com>
Mon, 28 Feb 2022 17:40:54 +0000 (18:40 +0100)
commitce062d315394b813ce79849c6595d198351c2cec
tree135e3fcb9623fa5d344f07f15f4c5682796a7ff5
parent1a9c875d35daf4e742cd980e824c862ad793a658
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 <gwenael.lambrouin@orange.com>
nfvbenchvm/dib/build-image.sh
nfvbenchvm/dib/elements/nfvbenchvm/finalise.d/51-add-cpu-isolation
nfvbenchvm/dib/elements/nfvbenchvm/finalise.d/52-change-resolution
nfvbenchvm/dib/elements/nfvbenchvm/finalise.d/53-boot-from-new-kernel
nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/01-update-kernel
nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-pip-package
nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local
nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute
nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script
nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script
nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup