OLD | NEW |
1 import os | 1 import os |
2 from autotest_lib.client.bin import test | 2 from autotest_lib.client.bin import test, utils |
3 from autotest_lib.client.common_lib import utils | |
4 | 3 |
5 | 4 |
6 # tests is a simple array of "cmd" "arguments" | 5 # tests is a simple array of "cmd" "arguments" |
7 tests = [["rmaptest", "-h -i100 -n100 -s100 -t100 -V10 -v file1.dat"], | 6 tests = [["rmaptest", "-h -i100 -n100 -s100 -t100 -V10 -v file1.dat"], |
8 ["rmaptest", "-l -i100 -n100 -s100 -t100 -V10 -v file2.dat"], | 7 ["rmaptest", "-l -i100 -n100 -s100 -t100 -V10 -v file2.dat"], |
9 ["rmaptest", "-r -i100 -n100 -s100 -t100 -V10 -v file3.dat"], | 8 ["rmaptest", "-r -i100 -n100 -s100 -t100 -V10 -v file3.dat"], |
10 ] | 9 ] |
11 name = 0 | 10 name = 0 |
12 arglist = 1 | 11 arglist = 1 |
13 | 12 |
14 class rmaptest(test.test): | 13 class rmaptest(test.test): |
15 version = 1 | 14 version = 1 |
16 preserve_srcdir = True | 15 preserve_srcdir = True |
17 | 16 |
18 def initialize(self): | 17 def initialize(self): |
19 self.job.require_gcc() | 18 self.job.require_gcc() |
20 | 19 |
21 | 20 |
22 def setup(self): | 21 def setup(self): |
23 os.chdir(self.srcdir) | 22 os.chdir(self.srcdir) |
24 utils.system(utils.get_cc() + ' -Wall -o rmaptest rmap-test.c') | 23 utils.system(utils.get_cc() + ' -Wall -o rmaptest rmap-test.c') |
25 | 24 |
26 | 25 |
27 def execute(self, args = ''): | 26 def execute(self, args = ''): |
28 os.chdir(self.tmpdir) | 27 os.chdir(self.tmpdir) |
29 for test in tests: | 28 for test in tests: |
30 cmd = '%s/%s %s %s' % (self.srcdir, test[name], args, test[arglist]) | 29 cmd = '%s/%s %s %s' % (self.srcdir, test[name], args, test[arglist]) |
31 utils.system(cmd) | 30 utils.system(cmd) |
OLD | NEW |