Fixes for variables

Stop process when security-sensitive variables are undefined,
removed verification for JOB_NAME, verification added for
POOL_PUBLIC, NSXV_PLUGIN_PATH

Change-Id: I0e5eee42544b92cd687f29edb7fe0ac23c277a51
This commit is contained in:
Ruslan Khozinov 2015-12-01 14:09:30 +03:00 committed by Andrey Setyaev
parent 89ae02de35
commit 4d822c4395

View File

@ -214,21 +214,21 @@ CheckVariables() {
echo "Error! JOB_NAME is not set!" echo "Error! JOB_NAME is not set!"
exit $NOJOBNAME_ERR exit $NOJOBNAME_ERR
fi fi
if [ -z "${ISO_PATH}" ]; then if [ -z "${ISO_PATH}" ]; then
echo "Error! ISO_PATH is not set!" echo "Error! ISO_PATH is not set!"
exit $NOISOPATH_ERR exit $NOISOPATH_ERR
fi fi
if [ -z "${TASK_NAME}" ]; then if [ -z "${TASK_NAME}" ]; then
echo "Error! TASK_NAME is not set!" echo "Error! TASK_NAME is not set!"
exit $NOTASKNAME_ERR exit $NOTASKNAME_ERR
fi fi
if [ -z "${WORKSPACE}" ]; then if [ -z "${WORKSPACE}" ]; then
echo "Error! WORKSPACE is not set!" echo "Error! WORKSPACE is not set!"
exit $NOWORKSPACE_ERR exit $NOWORKSPACE_ERR
fi fi
if [ -z "${POOL_PUBLIC}" ]; then
export POOL_PUBLIC='172.16.0.0/24:24'
fi
# Vcenter variables # Vcenter variables
if [ -z "${DISABLE_SSL}" ]; then if [ -z "${DISABLE_SSL}" ]; then
@ -245,6 +245,7 @@ CheckVariables() {
fi fi
if [ -z "${VCENTER_PASSWORD}" ]; then if [ -z "${VCENTER_PASSWORD}" ]; then
echo "Error! VCENTER_PASSWORD is not set!" echo "Error! VCENTER_PASSWORD is not set!"
exit 1
fi fi
if [ -z "${VC_DATACENTER}" ]; then if [ -z "${VC_DATACENTER}" ]; then
export VC_DATACENTER="Datacenter" export VC_DATACENTER="Datacenter"
@ -269,11 +270,18 @@ CheckVariables() {
fi fi
if [ -z "${WORKSTATION_USERNAME}" ]; then if [ -z "${WORKSTATION_USERNAME}" ]; then
echo "Error! WORKSTATION_USERNAME is not set!" echo "Error! WORKSTATION_USERNAME is not set!"
exit 1
fi fi
if [ -z "${WORKSTATION_PASSWORD}" ]; then if [ -z "${WORKSTATION_PASSWORD}" ]; then
echo "Error! WORKSTATION_PASSWORD is not set!" echo "Error! WORKSTATION_PASSWORD is not set!"
exit 1
fi fi
# NSXv variables # NSXv variables
if [ -z "${NSXV_PLUGIN_PATH}" ]; then
echo "Error! NSXV_PLUGIN_PATH is not set!"
exit 1
fi
if [ -z "${NEUTRON_SEGMENT_TYPE}" ]; then if [ -z "${NEUTRON_SEGMENT_TYPE}" ]; then
export NEUTRON_SEGMENT_TYPE="tun" export NEUTRON_SEGMENT_TYPE="tun"
fi fi
@ -285,6 +293,7 @@ CheckVariables() {
fi fi
if [ -z "${NSXV_PASSWORD}" ]; then if [ -z "${NSXV_PASSWORD}" ]; then
echo "Error! NSXV_PASSWORD is not set!" echo "Error! NSXV_PASSWORD is not set!"
exit 1
fi fi
if [ -z "${NSXV_DATACENTER_MOID}" ]; then if [ -z "${NSXV_DATACENTER_MOID}" ]; then
export NSXV_DATACENTER_MOID='datacenter-126' export NSXV_DATACENTER_MOID='datacenter-126'
@ -328,9 +337,6 @@ CheckVariables() {
if [ -z "${NSXV_INSECURE}" ]; then if [ -z "${NSXV_INSECURE}" ]; then
export NSXV_INSECURE='true' export NSXV_INSECURE='true'
fi fi
if [ -z "${JOB_NAME}" ]; then
export JOB_NAME="nsxv_system_test"
fi
# Export settings # Export settings
if [ -z "${ADMIN_NODE_MEMORY}" ]; then if [ -z "${ADMIN_NODE_MEMORY}" ]; then