| OLD | NEW | 
|---|
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be | 
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. | 
| 4 | 4 | 
| 5 import logging, os, re | 5 import logging, os, re | 
| 6 | 6 | 
| 7 from autotest_lib.client.bin import test, utils | 7 from autotest_lib.client.bin import test, utils | 
| 8 from autotest_lib.client.common_lib import error | 8 from autotest_lib.client.common_lib import error | 
| 9 | 9 | 
| 10 class hardware_SAT(test.test): | 10 class hardware_SAT(test.test): | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
| 41             var_flags += ' CXXFLAGS="-nopie ' + cflags + '"' | 41             var_flags += ' CXXFLAGS="-nopie ' + cflags + '"' | 
| 42             var_flags += ' CFLAGS="-nopie ' + cflags + '"' | 42             var_flags += ' CFLAGS="-nopie ' + cflags + '"' | 
| 43         else: | 43         else: | 
| 44             var_flags += ' CXXFLAGS="' + cflags + '"' | 44             var_flags += ' CXXFLAGS="' + cflags + '"' | 
| 45             var_flags += ' CFLAGS="' + cflags + '"' | 45             var_flags += ' CFLAGS="' + cflags + '"' | 
| 46         var_flags += ' LIBS="-static -laio"' | 46         var_flags += ' LIBS="-static -laio"' | 
| 47 | 47 | 
| 48         os.chdir(self.srcdir) | 48         os.chdir(self.srcdir) | 
| 49         # ./configure stores relevant path and environment variables. | 49         # ./configure stores relevant path and environment variables. | 
| 50         utils.configure(configure=var_flags + ' ./configure') | 50         utils.configure(configure=var_flags + ' ./configure') | 
| 51         utils.system('make -j %d' % utils.count_cpus()) | 51         utils.make() | 
| 52 | 52 | 
| 53 | 53 | 
| 54     def run_once(self, seconds=60): | 54     def run_once(self, seconds=60): | 
| 55         # Allow shmem access to all of memory. This is used for 32 bit | 55         # Allow shmem access to all of memory. This is used for 32 bit | 
| 56         # access to > 1.4G. Virtual address space limitation prevents | 56         # access to > 1.4G. Virtual address space limitation prevents | 
| 57         # directly mapping the memory. | 57         # directly mapping the memory. | 
| 58         utils.run('mount -o remount,size=100% /dev/shm') | 58         utils.run('mount -o remount,size=100% /dev/shm') | 
| 59         cpus = max(utils.count_cpus(), 1) | 59         cpus = max(utils.count_cpus(), 1) | 
| 60         mbytes = max(int(utils.freememtotal() * .95 / 1024), 512) | 60         mbytes = max(int(utils.freememtotal() * .95 / 1024), 512) | 
| 61         # SAT should use as much memory as possible, while still | 61         # SAT should use as much memory as possible, while still | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 79         # or disk cache problems. Two threads ensure multiple | 79         # or disk cache problems. Two threads ensure multiple | 
| 80         # outstanding transactions to the disk, if supported. | 80         # outstanding transactions to the disk, if supported. | 
| 81         args += ' -f sat.diskthread.a'  # disk thread | 81         args += ' -f sat.diskthread.a'  # disk thread | 
| 82         args += ' -f sat.diskthread.b' | 82         args += ' -f sat.diskthread.b' | 
| 83 | 83 | 
| 84         os.chdir(os.path.join(self.srcdir, 'src')) | 84         os.chdir(os.path.join(self.srcdir, 'src')) | 
| 85         sat = utils.run('./stressapptest' + args) | 85         sat = utils.run('./stressapptest' + args) | 
| 86         logging.debug(sat.stdout) | 86         logging.debug(sat.stdout) | 
| 87         if not re.search('Status: PASS', sat.stdout): | 87         if not re.search('Status: PASS', sat.stdout): | 
| 88             raise error.TestFail(sat.stdout) | 88             raise error.TestFail(sat.stdout) | 
| OLD | NEW | 
|---|