I had the same need (check if proxy is configured correctly), and while the above solutions gave hints, none was a complete solution, as checking with curl does not use the http proxy configured in yum.
Firstly, yum proxy can be configured:
per-repo by adding proxy=http://<proxy_ip>:<proxy_port>
in each /etc/yum.repos.d/*.repo
globally, by adding proxy=http://<ip>:<port>
and http_caching=none
in yum.conf (no caching to avoid getting stale repmod.xml causing checksum mismatches)
1. First, get a list of repositories and URLs:
#Produces a csv with 'repo_id#repo_url' rows
yum repolist enabled -v|egrep 'Repo-id|Repo-baseurl' | paste -sd ' \n' | awk '{printf ("%s#%s\n",$3,$6)}' > repolist.csv
2. Clear yum cache to avoid cached answers
yum clean all
Then for each repository in repolist.csv, do the following:
3a. query repo contents with yum (about 15 seconds for base)
#count packages, outputs: 9352
yum --quiet --disablerepo=* --enablerepo=base list available|wc -l
3b. alternatively query a specific package with repoquery (about 7 seconds for base)
# outputs: 1
repoquery --repoid=base --qf "%-20{repoid} %{name}" openssh-clients|wc -l