kernbench: use the standard mirrors to download kernel

kernbench always uses 2.6.14 as its base kernel, taken from a
local tarball.  When these are not found use the normal kernel
shortcut mechanism to trigger a download from the local mirrors,
or kernel.org.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@507 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/kernbench/kernbench.py b/client/tests/kernbench/kernbench.py
index 55f7a8f..2d0a3ca 100755
--- a/client/tests/kernbench/kernbench.py
+++ b/client/tests/kernbench/kernbench.py
@@ -5,11 +5,22 @@
 	version = 1
 
 	def setup(self):
+		#
+		# If we have a local copy of the 2.6.14 tarball use that
+		# else let the kernel object use the defined mirrors
+		# to obtain it.
+		#
 		# http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.14.tar.bz2
-		if (os.path.exists(self.bindir + '/linux-2.6.14.tar.bz2')):
-			tarball = self.bindir + '/linux-2.6.14.tar.bz2'
-		else:
-			tarball = '/usr/local/src/linux-2.6.14.tar.bz2'
+		#
+		tarball = None
+		for dir in (self.bindir, '/usr/local/src'):
+			path = os.path.join(dir, 'linux-2.6.14.tar.bz2')
+			if os.path.exists(path):
+				tarball = path
+				break
+		if not tarball:
+			tarball = '2.6.14'
+			
 		kernel = self.job.kernel(tarball, self.tmpdir, self.srcdir)
 		kernel.config(defconfig=True)
 		# have to save this off, as we might use it in another run