mbligh | 548ace8 | 2006-10-19 14:36:45 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | import test |
| 4 | from autotest_utils import * |
| 5 | |
| 6 | class iozone(test.test): |
| 7 | version = 1 |
| 8 | |
| 9 | #http://www.iozone.org/src/current/iozone3_263.tar |
| 10 | def setup(self, tarball = 'iozone3_263.tar'): |
| 11 | tarball = unmap_url(self.bindir, tarball, self.tmpdir) |
| 12 | extract_tarball_to_dir(tarball, self.srcdir) |
| 13 | os.chdir(os.path.join(self.srcdir, 'src/current')) |
| 14 | |
| 15 | arch = get_current_kernel_arch() |
| 16 | if (arch == 'ppc'): |
| 17 | system('make linux-powerpc') |
| 18 | elif (arch == 'ppc64'): |
| 19 | system('make linux-powerpc64') |
| 20 | elif (arch == 'x86_64'): |
| 21 | system('make linux-AMD64') |
| 22 | else: |
| 23 | system('make linux') |
| 24 | |
| 25 | def execute(self, dir, args = None): |
| 26 | os.chdir(dir) |
| 27 | if not args: |
| 28 | args = '-a' |
mbligh | 9f5113d | 2007-06-25 23:41:10 +0000 | [diff] [blame^] | 29 | profilers = self.job.profilers |
| 30 | if not profilers.only(): |
| 31 | system('%s/src/current/iozone %s' % (self.srcdir, args)) |
mbligh | 548ace8 | 2006-10-19 14:36:45 +0000 | [diff] [blame] | 32 | |
| 33 | # Do a profiling run if necessary |
mbligh | 548ace8 | 2006-10-19 14:36:45 +0000 | [diff] [blame] | 34 | if profilers.present(): |
| 35 | profilers.start(self) |
| 36 | system('%s/src/current/iozone %s' % (self.srcdir, args)) |
| 37 | profilers.stop(self) |
| 38 | profilers.report(self) |