We are not recording the kernel build/configure/install phases in
the job log, so when they fail we just get nothing, and when they
work we do not really know they were done.

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



git-svn-id: http://test.kernel.org/svn/autotest/trunk@647 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/kernel.py b/client/bin/kernel.py
index b461cb4..3344bb5 100755
--- a/client/bin/kernel.py
+++ b/client/bin/kernel.py
@@ -108,7 +108,18 @@
 				self.patch(*base_components)
 
 
-	def patch(self, *patches):
+	def __record(self, fn, name, *args, **dargs):
+		try:
+			fn(*args, **dargs)
+			self.job.record("GOOD " + name + \
+						" completed successfully\n")
+		except Exception, detail:
+			self.job.record("FAIL " + name + \
+						detail.__str__() + "\n")
+			raise
+		
+
+	def _patch(self, *patches):
 		"""Apply a list of patches (in order)"""
 		if not patches:
 			return
@@ -120,7 +131,11 @@
 		# self.job.stdout.restore()
 
 
-	def config(self, config_file = '', config_list = None,
+	def patch(self, *args, **dargs):
+		self.__record(self._patch, "kernel.patch", *args, **dargs)
+
+
+	def _config(self, config_file = '', config_list = None,
 							defconfig = False):
 		self.job.stdout.redirect(os.path.join(self.log_dir, 'stdout'))
 		self.set_cross_cc()
@@ -130,6 +145,10 @@
 		self.job.stdout.restore()
 
 
+	def config(self, *args, **dargs):
+		self.__record(self._config, "kernel.config", *args, **dargs)
+
+
 	def get_patches(self, patches):
 		"""fetch the patches to the local src_dir"""
 		local_patches = []
@@ -193,7 +212,7 @@
 		system('sed "%s" < Makefile.old > Makefile' % p)
 
 
-	def build(self, make_opts = '', logfile = '', extraversion='autotest'):
+	def _build(self, make_opts = '', logfile = '', extraversion='autotest'):
 		"""build the kernel
 
 		make_opts
@@ -232,6 +251,10 @@
 		force_copy(self.build_dir+'/System.map', self.results_dir)
 
 
+	def build(self, *args, **dargs):
+		self.__record(self._build, "kernel.build", *args, **dargs)
+
+
 	def build_timed(self, threads, timefile = '/dev/null', make_opts = ''):
 		"""time the bulding of the kernel"""
 		os.chdir(self.build_dir)
@@ -245,14 +268,18 @@
 			raise TestError("no vmlinux found, kernel build failed")
 
 
-	def clean(self):
+	def _clean(self):
 		"""make clean in the kernel tree"""
 		os.chdir(self.build_dir) 
 		print "make clean"
 		system('make clean')
 
 
-	def mkinitrd(self, version, image, system_map, initrd):
+	def clean(self, *args, **dargs):
+		self.__record(self._clean, "kernel.clean", *args, **dargs)
+
+
+	def _mkinitrd(self, version, image, system_map, initrd):
 		"""Build kernel initrd image.
 		Try to use distro specific way to build initrd image.
 		Parameters:
@@ -287,11 +314,15 @@
 			raise TestError('Unsupported vendor %s' % vendor)
 
 
+	def mkinitrd(self, *args, **dargs):
+		self.__record(self._mkinitrd, "kernel.mkinitrd", *args, **dargs)
+
+
 	def set_build_image(self, image):
 		self.build_image = image
 
 
-	def install(self, tag='autotest', prefix = '/'):
+	def _install(self, tag='autotest', prefix = '/'):
 		"""make install in the kernel tree"""
 		os.chdir(self.build_dir)
 
@@ -335,6 +366,10 @@
 						  self.system_map, self.initrd)
 
 
+	def install(self, *args, **dargs):
+		self.__record(self._install, "kernel.install", *args, **dargs)
+
+
 	def add_to_bootloader(self, tag='autotest', args=''):
 		""" add this kernel to bootloader, taking an
 		    optional parameter of space separated parameters