tests: Look for specific repo files for testing

On CentOS it will use centos.repo + test-artifacts.repo and on RHEL
it will use rhel.repo + test-artifacts.repo

Related: RHEL-61778
This commit is contained in:
Brian C. Lane 2024-10-21 10:38:42 -07:00
parent f325427b2b
commit c56a1c26ee

View File

@ -306,10 +306,16 @@ if [ ! -e /usr/share/lorax/templates.d/80-rhel/ ]; then
exit 1 exit 1
fi fi
# Gather up the list of system repo files and use them for lorax # NOTE: This must be able to run both on the Zuul using centos repos and on osci gating using rhel
REPOS=$(find /etc/yum.repos.d/ -maxdepth 1 -type f -name '*\.repo' ! -name 'fedora.repo' -exec echo -n "--repo {} " \;) # so filter for the list of allowed repos
REPODIR="/etc/yum.repos.d"
REPOFILES="rhel.repo centos.repo test-artifacts.repo"
REPOS=""
for r in $REPOFILES; do
[ -e "$REPODIR/$r" ] && REPOS+="--repo $REPODIR/$r "
done
if [ -z "$REPOS" ]; then if [ -z "$REPOS" ]; then
echo "No system repos found" echo "No repos ($REPOFILES) found in $REPODIR"
exit 1 exit 1
fi fi