bstinson / centos / t_functional

Forked from centos/t_functional 3 years ago
Clone

Blame tests/p_yum-plugin-fastestmirror/10-fastestmirror.sh

Karanbir Singh 6f670a
#!/bin/sh
Karanbir Singh 6f670a
Karanbir Singh 6f670a
# Ensure plugin is enabled :
Karanbir Singh 6f670a
Karanbir Singh 6f670a
t_Log "Running $0 - is y-p-fastestmirror enabled."
Karanbir Singh 6f670a
grep 'enabled=1' /etc/yum/pluginconf.d/fastestmirror.conf > /dev/null
Karanbir Singh 6f670a
t_CheckExitStatus $?
Karanbir Singh 6f670a
Karanbir Singh 6f670a
# timedhosts file ends up in different places on c5 and c6
Karanbir Singh 6f670a
if [ $centos_ver == 5 ]; then 
Karanbir Singh 6f670a
	$BaseDir=/var/cache/yum/
Karanbir Singh 6f670a
else
Karanbir Singh 6f670a
	$BaseDir=/var/cache/yum/`uanme -m`/$centos_ver
Karanbir Singh 6f670a
fi
Karanbir Singh 6f670a
Karanbir Singh 6f670a
t_Log "Running $0 - Ensure we have mirrorlist enabled."
Karanbir Singh 6f670a
egrep '^mirrorlist' /etc/yum.repos.d/*.repo > /dev/null
Karanbir Singh 6f670a
t_CheckExitStatus $?
Karanbir Singh 6f670a
Karanbir Singh 6f670a
t_Log "Running $0 - is y-p-fastestmirror can get hosts + time them."
Karanbir Singh 488421
find $BaseDir -type f -name timedhosts.txt -exec rm -f {} \;
Karanbir Singh 6f670a
yum -d0 list kernel > /dev/null
Karanbir Singh 6f670a
hostsfound=$( wc -l ${BaseDir}/timedhosts.txt )
Karanbir Singh 6f670a
[ $hostsfound -gt 0 ]
Karanbir Singh 6f670a
t_CheckExitStatus $?
Karanbir Singh 6f670a