From 0d13153e54ce4ff2b604081becf457b2e05b7eb6 Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Fri, 23 Sep 2016 09:20:44 -0400 Subject: [PATCH] Provision from pre-cached/pre-downloaded CirrOS image In run_tests.sh we symlink a cached image to /tmp/openstack/tempest or it is downloaded to that location using wget which is more reliable. Let's use that instead. Change-Id: I3777d9d035ceb31827b8df4264c2f7d213f50aea --- manifests/provision.pp | 10 ++-------- run_tests.sh | 24 ++++++++++-------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/manifests/provision.pp b/manifests/provision.pp index d63d66fd3..d95a7eb35 100644 --- a/manifests/provision.pp +++ b/manifests/provision.pp @@ -43,20 +43,14 @@ class openstack_integration::provision { container_format => 'bare', disk_format => 'qcow2', is_public => 'yes', - # TODO(emilien) optimization by 1/ using Hiera to configure Glance image source - # and 2/ if running in the gate, use /home/jenkins/cache/files/ cirros image. - # source => '/home/jenkins/cache/files/cirros-0.3.4-x86_64-disk.img', - source => 'http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img', + source => '/tmp/openstack/tempest/cirros-0.3.4-x86_64-disk.img' } glance_image { 'cirros_alt': ensure => present, container_format => 'bare', disk_format => 'qcow2', is_public => 'yes', - # TODO(emilien) optimization by 1/ using Hiera to configure Glance image source - # and 2/ if running in the gate, use /home/jenkins/cache/files/ cirros image. - # source => '/home/jenkins/cache/files/cirros-0.3.4-x86_64-disk.img', - source => 'http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img', + source => '/tmp/openstack/tempest/cirros-0.3.4-x86_64-disk.img' } Keystone_user_role['admin@openstack'] -> Glance_image<||> } diff --git a/run_tests.sh b/run_tests.sh index 9a55c4ca5..b73bac8c4 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -74,7 +74,7 @@ if [ "${ADD_SWAP}" = true ]; then $SUDO swapon /swapfile fi -print_header 'Clone Tempest and plugins' +print_header 'Clone Tempest, plugins & pre-cache CirrOS' # TODO(pabelanger): Move this into tools/install_tempest.sh and add logic so we # can clone tempest outside of the gate. Also, tempest should be sandboxed into # the local directory but works needs to be added into puppet to properly find @@ -98,6 +98,15 @@ else fi fi +# NOTE(pabelanger): We cache cirros images on our jenkins slaves, check if it +# exists. +if [ -f ~/cache/files/cirros-0.3.4-x86_64-disk.img ]; then + # Create a symlink for tempest. + ln -s ~/cache/files/cirros-0.3.4-x86_64-disk.img /tmp/openstack/tempest +else + wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img -P /tmp/openstack/tempest +fi + install_puppet PUPPET_FULL_PATH=$(which puppet) if [ "${MANAGE_HIERA}" = true ]; then @@ -162,19 +171,6 @@ if [ $RESULT -ne 0 ]; then fi print_header 'Prepare Tempest' -mkdir -p /tmp/openstack/tempest - -$SUDO rm -f /tmp/openstack/tempest/cirros-0.3.4-x86_64-disk.img - -# NOTE(pabelanger): We cache cirros images on our jenkins slaves, check if it -# exists. -if [ -f ~/cache/files/cirros-0.3.4-x86_64-disk.img ]; then - # Create a symlink for tempest. - ln -s ~/cache/files/cirros-0.3.4-x86_64-disk.img /tmp/openstack/tempest -else - wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img -P /tmp/openstack/tempest -fi - # Tempest plugin tests require tempest-lib to be installed $SUDO pip install tempest-lib