Set up downloaded images for testing

Change-Id: Ia08d314e26fcf4a443b567432d0c36202d151c9f
This commit is contained in:
Dean Troyer 2011-11-23 23:19:10 -06:00
parent f4497d5eb9
commit 3320c55d10

View File

@ -123,6 +123,33 @@ set `echo $GLANCE_HOSTPORT | tr ':' ' '`
GLANCE_HOST=$1 GLANCE_HOST=$1
GLANCE_PORT=$2 GLANCE_PORT=$2
# Set up downloaded images
# Defaults to use first image
IMAGE_DIR=""
for imagedir in $TOP_DIR/files/images/*; do
KERNEL=""
RAMDISK=""
IMAGE=""
IMAGE_RAMDISK=""
KERNEL=$(for f in "$imagedir/"*-vmlinuz*; do
[ -f "$f" ] && echo "$f" && break; done; true)
[ -n "$KERNEL" ] && ln -sf $KERNEL $imagedir/kernel
RAMDISK=$(for f in "$imagedir/"*-initrd*; do
[ -f "$f" ] && echo "$f" && break; done; true)
[ -n "$RAMDISK" ] && ln -sf $RAMDISK $imagedir/ramdisk && \
IMAGE_RAMDISK="ari_location = $imagedir/ramdisk"
IMAGE=$(for f in "$imagedir/"*.img; do
[ -f "$f" ] && echo "$f" && break; done; true)
if [ -n "$IMAGE" ]; then
ln -sf $IMAGE $imagedir/disk
# Save the first image directory that contains a disk image link
if [ -z "$IMAGE_DIR" ]; then
IMAGE_DIR=$imagedir
fi
fi
done
# Create storm.conf # Create storm.conf
CONFIG_CONF_TMP=$(mktemp $CONFIG_CONF.XXXXXX) CONFIG_CONF_TMP=$(mktemp $CONFIG_CONF.XXXXXX)
@ -154,9 +181,9 @@ CONFIG_INI_TMP=$(mktemp $CONFIG_INI.XXXXXX)
if [ "$UPLOAD_LEGACY_TTY" ]; then if [ "$UPLOAD_LEGACY_TTY" ]; then
cat >$CONFIG_INI_TMP <<EOF cat >$CONFIG_INI_TMP <<EOF
[environment] [environment]
aki_location = $DEST/devstack/files/images/aki-tty/image aki_location = $TOP_DIR/files/images/aki-tty/image
ari_location = $DEST/devstack/files/images/ari-tty/image ari_location = $TOP_DIR/files/images/ari-tty/image
ami_location = $DEST/devstack/files/images/ami-tty/image ami_location = $TOP_DIR/files/images/ami-tty/image
image_ref = 3 image_ref = 3
image_ref_alt = 3 image_ref_alt = 3
flavor_ref = 1 flavor_ref = 1
@ -173,9 +200,9 @@ EOF
else else
cat >$CONFIG_INI_TMP <<EOF cat >$CONFIG_INI_TMP <<EOF
[environment] [environment]
aki_location = $DEST/openstack-integration-tests/include/sample_vm/$DIST_NAME-server-cloudimg-amd64-vmlinuz-virtual aki_location = $IMAGE_DIR/kernel
#ari_location = $DEST/openstack-integration-tests/include/sample_vm/$DIST_NAME-server-cloudimg-amd64-loader ami_location = $IMAGE_DIR/disk
ami_location = $DEST/openstack-integration-tests/include/sample_vm/$DIST_NAME-server-cloudimg-amd64.img $IMAGE_RAMDISK
image_ref = 2 image_ref = 2
image_ref_alt = 2 image_ref_alt = 2
flavor_ref = 1 flavor_ref = 1
@ -185,8 +212,8 @@ flavor_ref_alt = 2
host = $GLANCE_HOST host = $GLANCE_HOST
apiver = v1 apiver = v1
port = $GLANCE_PORT port = $GLANCE_PORT
image_id = 1 image_id = 2
image_id_alt = 1 image_id_alt = 2
tenant_id = 1 tenant_id = 1
EOF EOF
fi fi