Force SUSE repo refresh and switch default mirror.

This change forces a repo refresh whenever running tests on SUSE. This
is needed to ensure all of the repos are up-to-date and we're pulling
package from the correct sources. This also sets the default mirror
to download.opensuse.org since the OpenStack mirrors are outdated due
to rsync.opensuse.org being broken. See https://progress.opensuse.org/issues/27699

Change-Id: I9f2a1f98981cdb444c2162b09c02f6e530f5d1c2
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
Signed-off-by: Markos Chandras <mchandras@suse.de>
This commit is contained in:
Kevin Carter 2017-11-16 14:10:38 -06:00 committed by Markos Chandras
parent 807df2a289
commit f69d088d1d

View File

@ -25,6 +25,14 @@ which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum'
case "${ID,,}" in
*suse*)
# FIXME(hwoarang) workaround for broken rsync.opensuse.org. See
# https://progress.opensuse.org/issues/27699
for repo in /etc/zypp/repos.d/*.repo; do
sudo sed -i "/baseurl/s@\(http://\).*/opensuse\(.*\)@\1download.opensuse.org\2@" $repo
done
sudo zypper --non-interactive clean -a
sudo zypper --no-gpg-checks --non-interactive ref -f
sudo zypper --no-gpg-checks --non-interactive modifyrepo --all --refresh
# Need to pull libffi and python-pyOpenSSL early
# because we install ndg-httpsclient from pip on Leap 42.1
[[ "${VERSION}" == "42.1" ]] && extra_suse_deps="libffi-devel python-pyOpenSSL"