aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/tests/asserts
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/vagrant-onap/tests/asserts')
-rwxr-xr-xbootstrap/vagrant-onap/tests/asserts10
1 files changed, 10 insertions, 0 deletions
diff --git a/bootstrap/vagrant-onap/tests/asserts b/bootstrap/vagrant-onap/tests/asserts
index 8eda3ce25..441b9f091 100755
--- a/bootstrap/vagrant-onap/tests/asserts
+++ b/bootstrap/vagrant-onap/tests/asserts
@@ -77,6 +77,16 @@ function asserts_file_exist {
fi
}
+# asserts_env_set() - Function that verities that an environment variable is set
+function asserts_env_set {
+ local variable=$1
+ local error_msg=${2:-"$variable wasn't set"}
+
+ if [ -z ${variable+x} ]; then
+ raise_error $error_msg
+ fi
+}
+
# raise_error() - Function that prints and exits the execution
function raise_error {
echo $@