Home | History | Annotate | Download | only in aio_dio_bugs
      1 import os
      2 from autotest_lib.client.bin import test, utils
      3 
      4 
      5 # tests is a simple array of "cmd" "arguments"
      6 tests = [["aio-dio-invalidate-failure", "poo"],
      7          ["aio-dio-subblock-eof-read", "eoftest"],
      8          ["aio-free-ring-with-bogus-nr-pages", ""],
      9          ["aio-io-setup-with-nonwritable-context-pointer", ""],
     10          ["aio-dio-extend-stat", "file"],
     11         ]
     12 name = 0
     13 arglist = 1
     14 
     15 class aio_dio_bugs(test.test):
     16     version = 5
     17     preserve_srcdir = True
     18 
     19     def initialize(self):
     20         self.job.require_gcc()
     21         self.job.setup_dep(['libaio'])
     22         ldflags = '-L ' + self.autodir + '/deps/libaio/lib'
     23         cflags = '-I ' + self.autodir + '/deps/libaio/include'
     24         self.gcc_flags = ldflags + ' ' + cflags
     25 
     26 
     27     def setup(self):
     28         os.chdir(self.srcdir)
     29         utils.make('"CFLAGS=' + self.gcc_flags + '"')
     30 
     31 
     32     def execute(self, args = ''):
     33         os.chdir(self.tmpdir)
     34         libs = self.autodir + '/deps/libaio/lib/'
     35         ld_path = utils.prepend_path(libs,
     36                               utils.environ('LD_LIBRARY_PATH'))
     37         var_ld_path = 'LD_LIBRARY_PATH=' + ld_path
     38         for test in tests:
     39             cmd = self.srcdir + '/' + test[name] + ' ' + args + ' ' \
     40                                                                + test[arglist]
     41             utils.system(var_ld_path + ' ' + cmd)
     42