diff --git a/run_tests.sh b/run_tests.sh index c18420daa..4649de10b 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -179,18 +179,30 @@ which pip || $SUDO easy_install pip rm -rf /tmp/cirros mkdir /tmp/cirros -if [ -f ~/cache/files/cirros-0.3.5-x86_64-uec.tar.gz ]; then - tar -xzvf ~/cache/files/cirros-0.3.5-x86_64-uec.tar.gz -C /tmp/cirros/ + +arch="$(uname -p)" + +case $arch in + x86_64) + cirros_version="0.3.5" + ;; + ppc64le) + cirros_version="0.4.0" + ;; +esac + +if [ -f ~/cache/files/cirros-$cirros_version-$arch-uec.tar.gz ]; then + tar -xzvf ~/cache/files/cirros-$cirros_version-$arch-uec.tar.gz -C /tmp/cirros/ else echo "No pre-cached uec archive found, downloading..." - wget --tries=10 http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-uec.tar.gz -P /tmp/cirros/ - tar -xzvf /tmp/cirros/cirros-0.3.5-x86_64-uec.tar.gz -C /tmp/cirros/ + wget --tries=10 http://download.cirros-cloud.net/$cirros_version/cirros-$cirros_version-$arch-uec.tar.gz -P /tmp/cirros/ + tar -xzvf /tmp/cirros/cirros-$cirros_version-$arch-uec.tar.gz -C /tmp/cirros/ fi -if [ -f ~/cache/files/cirros-0.3.5-x86_64-disk.img ]; then - cp -p ~/cache/files/cirros-0.3.5-x86_64-disk.img /tmp/cirros/ +if [ -f ~/cache/files/cirros-$cirros_version-$arch-disk.img ]; then + cp -p ~/cache/files/cirros-$cirros_version-$arch-disk.img /tmp/cirros/ else echo "No pre-cached disk image found, downloading..." - wget --tries=10 http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img -P /tmp/cirros/ + wget --tries=10 http://download.cirros-cloud.net/$cirros_version/cirros-$cirros_version-$arch-disk.img -P /tmp/cirros/ fi echo "Using pre-cached images:" find /tmp/cirros -type f -printf "%m %n %u %g %s %t" -exec md5sum \{\} \;