From f3619367a211d8d13977d7c554df45b469799e67 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Wed, 22 Apr 2015 14:54:33 +0100 Subject: [PATCH] Make sourcing of config.sh idempotent --- test/config.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/config.sh b/test/config.sh index c20f55a6..f1db670d 100644 --- a/test/config.sh +++ b/test/config.sh @@ -2,6 +2,13 @@ set -e +# Protect against being sourced multiple times to prevent +# overwriting assert.sh global state +if ! [ -z "$SOURCED_CONFIG_SH" ]; then + return +fi +SOURCED_CONFIG_SH=true + # these ought to match what is in Vagrantfile N_MACHINES=${N_MACHINES:-2} IP_PREFIX=${IP_PREFIX:-192.168.48}