Allow to parameterize image name in tests

Add the ability to pass an image name using an env
var, to provide more flexibility on image testing.

Change-Id: Iddb2ab3efb5746a070e147ccc2180915c788c5c2
This commit is contained in:
Yolanda Robla 2016-03-19 09:58:14 +01:00
parent ddb7eeaab3
commit 2471fa66c6
1 changed files with 10 additions and 2 deletions

View File

@ -28,10 +28,18 @@ function create_test_data {
# a baymodel, bay and a pod
coe=$1
local image_name="fedora-21-atomic"
if [ $coe == 'mesos' ]; then
image_name="ubuntu-14.04"
local image_name="ubuntu-14.04"
else
local image_name="fedora-21-atomic"
fi
# if we have the MAGNUM_IMAGE_NAME setting, use it instead
# of the default one. In combination with MAGNUM_GUEST_IMAGE_URL
# setting, it allows to perform testing on custom images.
image_name=${MAGNUM_IMAGE_NAME:-$image_name}
export NIC_ID=$(neutron net-show public | awk '/ id /{print $4}')
export IMAGE_ID=$(glance --os-image-api-version 1 image-list | grep $image_name | awk '{print $2}')