diff options
Diffstat (limited to 'client/tests/linus_stress/linus_stress.py')
-rwxr-xr-x | client/tests/linus_stress/linus_stress.py | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/client/tests/linus_stress/linus_stress.py b/client/tests/linus_stress/linus_stress.py index 3a81134e..61603078 100755 --- a/client/tests/linus_stress/linus_stress.py +++ b/client/tests/linus_stress/linus_stress.py @@ -4,40 +4,40 @@ from autotest_lib.client.common_lib import utils class linus_stress(test.test): - version = 1 + version = 1 - def setup(self): - os.mkdir(self.srcdir) - os.chdir(self.bindir) - utils.system('cp linus_stress.c src/') - os.chdir(self.srcdir) - utils.system('cc linus_stress.c -D_POSIX_C_SOURCE=200112 -o linus_stress') + def setup(self): + os.mkdir(self.srcdir) + os.chdir(self.bindir) + utils.system('cp linus_stress.c src/') + os.chdir(self.srcdir) + utils.system('cc linus_stress.c -D_POSIX_C_SOURCE=200112 -o linus_stress') - def run_the_test(self, iterations): - utils.write_one_line('/proc/sys/vm/dirty_ratio', '4') - utils.write_one_line('/proc/sys/vm/dirty_background_ratio', '2') + def run_the_test(self, iterations): + utils.write_one_line('/proc/sys/vm/dirty_ratio', '4') + utils.write_one_line('/proc/sys/vm/dirty_background_ratio', '2') - cmd = os.path.join(self.srcdir, 'linus_stress') - args = "%d" % (autotest_utils.memtotal() / 32) + cmd = os.path.join(self.srcdir, 'linus_stress') + args = "%d" % (autotest_utils.memtotal() / 32) - profilers = self.job.profilers - if profilers.present(): - profilers.start(self) + profilers = self.job.profilers + if profilers.present(): + profilers.start(self) - for i in range(iterations): - utils.system(cmd + ' ' + args) + for i in range(iterations): + utils.system(cmd + ' ' + args) - if profilers.present(): - profilers.stop(self) - profilers.report(self) + if profilers.present(): + profilers.stop(self) + profilers.report(self) - def execute(self, iterations = 1): - dirty_ratio = utils.read_one_line('/proc/sys/vm/dirty_ratio') - dirty_background_ratio = utils.read_one_line('/proc/sys/vm/dirty_background_ratio') - try: - self.run_the_test(iterations) - finally: - utils.write_one_line('/proc/sys/vm/dirty_ratio', dirty_ratio) - utils.write_one_line('/proc/sys/vm/dirty_background_ratio', dirty_background_ratio) + def execute(self, iterations = 1): + dirty_ratio = utils.read_one_line('/proc/sys/vm/dirty_ratio') + dirty_background_ratio = utils.read_one_line('/proc/sys/vm/dirty_background_ratio') + try: + self.run_the_test(iterations) + finally: + utils.write_one_line('/proc/sys/vm/dirty_ratio', dirty_ratio) + utils.write_one_line('/proc/sys/vm/dirty_background_ratio', dirty_background_ratio) |