ABAT: default boot.default_args to the args from our autobench entry

ABAT uses the autobench entry to hold the default boot args.
Find this entry and extract the current arguments.  Set those as
the default boot-args in the job configuration.

Signed-off-by: Andy Whitcroft <[email protected]>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@396 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/harness_ABAT.py b/client/bin/harness_ABAT.py
index 4ea145f..6fae0ab 100755
--- a/client/bin/harness_ABAT.py
+++ b/client/bin/harness_ABAT.py
@@ -28,6 +28,22 @@
 		else:
 			self.status = None
 
+		# Search the boot loader configuration for the autobench entry,
+		# and extract its args.
+		entry_args = None
+		args = None
+		for line in job.bootloader.info('all').split('\n'):
+			if line.startswith('args'):
+				entry_args = line.split(None, 2)[2]
+			if line.startswith('title'):
+				title = line.split()[2]
+				if title == 'autobench':
+					args = entry_args
+
+		if args:
+			args = re.sub(r'autobench_args:.*', '', args)
+			self.job.config_set('boot.default_args', args)
+
 	def __send(self, msg):
 		if self.status:
 			msg = msg.rstrip()