From 6f670a42449c90d217f0c177c5a850baededc4d4 Mon Sep 17 00:00:00 2001 From: Karanbir Singh Date: Nov 09 2012 10:23:08 +0000 Subject: new test for yum-plugin-fastestmirror --- diff --git a/tests/p_yum-plugin-fastestmirror/0_install_yum-plugin-fastestmirror.sh b/tests/p_yum-plugin-fastestmirror/0_install_yum-plugin-fastestmirror.sh new file mode 100755 index 0000000..c5fde6e --- /dev/null +++ b/tests/p_yum-plugin-fastestmirror/0_install_yum-plugin-fastestmirror.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +t_Log "Running $0 - package should already be installed" + +rpm -qa | grep yum-plugin-fastestmirror > /dev/null +t_CheckExitStatus $? + +t_Log "Running $0 - yum should have a hard Requires on yum-plugin-fastestmirror" +rpm -q --requires yum | grep yum-plugin-fastestmirror > /dev/null +t_CheckExitStatus $? \ No newline at end of file diff --git a/tests/p_yum-plugin-fastestmirror/10-fastestmirror.sh b/tests/p_yum-plugin-fastestmirror/10-fastestmirror.sh new file mode 100755 index 0000000..79e81d3 --- /dev/null +++ b/tests/p_yum-plugin-fastestmirror/10-fastestmirror.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Ensure plugin is enabled : + +t_Log "Running $0 - is y-p-fastestmirror enabled." +grep 'enabled=1' /etc/yum/pluginconf.d/fastestmirror.conf > /dev/null +t_CheckExitStatus $? + +# timedhosts file ends up in different places on c5 and c6 +if [ $centos_ver == 5 ]; then + $BaseDir=/var/cache/yum/ +else + $BaseDir=/var/cache/yum/`uanme -m`/$centos_ver +fi + +t_Log "Running $0 - Ensure we have mirrorlist enabled." +egrep '^mirrorlist' /etc/yum.repos.d/*.repo > /dev/null +t_CheckExitStatus $? + +t_Log "Running $0 - is y-p-fastestmirror can get hosts + time them." +find $BaseDir -type f -name timedhosts.txt -exec rm -f {}\; +yum -d0 list kernel > /dev/null +hostsfound=$( wc -l ${BaseDir}/timedhosts.txt ) +[ $hostsfound -gt 0 ] +t_CheckExitStatus $? +