From 2471fa66c635e8f1ffd75883855a5317c3e7e90c Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Sat, 19 Mar 2016 09:58:14 +0100 Subject: [PATCH] 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 --- magnum/tests/contrib/post_test_hook.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/magnum/tests/contrib/post_test_hook.sh b/magnum/tests/contrib/post_test_hook.sh index 0e5612d514..4f5215f969 100755 --- a/magnum/tests/contrib/post_test_hook.sh +++ b/magnum/tests/contrib/post_test_hook.sh @@ -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}')