diff mbox

[AUTOTEST,4/5] update ltp wrapper in autotest

Message ID a50cf5ab0907122308h69a9a85x18b0c86bc162c041@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

sudhir kumar July 13, 2009, 6:08 a.m. UTC
This patch updates the ltp wrapper in autotest to execute the latest ltp.
At present autotest contains ltp which is more than 1 year old. There have
been added lots of testcases in ltp within this period. So this patch updates
the wrapper to run the June2009 release of ltp.
http://prdownloads.sourceforge.net/ltp/ltp-full-20090630.tgz

I have added an option which generates a fancy html results file. Also the
run is left to be a default run as expected.

This patch also adds the facility to apply kvm_ltp.patch which can customize
the test execution under kvm guests.

For autotest users, please untar the results file I am sending, run
cd results/default; firefox results.html, click ltp_results.html
This is a symlink to the ltp_results.html which is generated by ltp.

Please provide your comments, concerns and issues.

Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com>


         cmd = os.path.join(self.srcdir, script) + ' ' + args
diff mbox

Patch

Index: autotest/client/tests/ltp/ltp.py
===================================================================
--- autotest.orig/client/tests/ltp/ltp.py
+++ autotest/client/tests/ltp/ltp.py
@@ -23,13 +23,17 @@  class ltp(test.test):
         self.job.require_gcc()


-    # http://prdownloads.sourceforge.net/ltp/ltp-full-20080229.tgz
-    def setup(self, tarball = 'ltp-full-20080229.tar.bz2'):
+    # http://prdownloads.sourceforge.net/ltp/ltp-full-20090630.tgz
+    def setup(self, tarball = 'ltp-full-20090630.tgz', guest=None):
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)

-        utils.system('patch -p1 < ../ltp.patch')
+        try:
+            utils.system('patch -p1 < ../ltp.patch')
+            print "Patch ltp.patch applied successfully"
+        except :
+            print "Patch ltp.patch failed to apply"

         # comment the capability tests if we fail to load the capability module
         try:
@@ -37,6 +41,14 @@  class ltp(test.test):
         except error.CmdError, detail:
             utils.system('patch -p1 < ../ltp_capability.patch')

+        # if we are running under kvm guests apply kvm_ltp.patch
+        if guest == "kvm" :
+            try:
+                utils.system('patch -p1 < ../kvm_ltp.patch')
+                print "Patch kvm_ltp.patch applied successfully"
+            except :
+                print "Patch kvm_ltp.patch failed to apply"
+
         utils.system('cp ../scan.c pan/')   # saves having lex installed
         utils.system('make -j %d' % utils.count_cpus())
         utils.system('yes n | make install')
@@ -52,8 +64,9 @@  class ltp(test.test):
         # In case the user wants to run another test script
         if script == 'runltp':
             logfile = os.path.join(self.resultsdir, 'ltp.log')
+            htmlfile = os.path.join(self.resultsdir, 'ltp_results.html')
             failcmdfile = os.path.join(self.debugdir, 'failcmdfile')
-            args2 = '-q -l %s -C %s -d %s' % (logfile, failcmdfile,
self.tmpdir)
+            args2 = '-l %s -g %s -C %s -d %s' % (logfile, htmlfile,
failcmdfile, self.tmpdir)
             args = args + ' ' + args2