diff options
50 files changed, 149 insertions, 230 deletions
diff --git a/client/bin/harness.py b/client/bin/harness.py index 86441b86..0e37b1ea 100755 --- a/client/bin/harness.py +++ b/client/bin/harness.py @@ -34,7 +34,7 @@ class harness: if os.path.isdir(configd): (name, dirs, files) = os.walk(configd).next() job.config_set('kernel.default_config_set', - [ configd + '/' ] + files) + [ configd + '/' ] + files) def run_start(self): diff --git a/client/bin/harness_ABAT.py b/client/bin/harness_ABAT.py index 8fadb2a9..a9ba0f35 100755 --- a/client/bin/harness_ABAT.py +++ b/client/bin/harness_ABAT.py @@ -67,8 +67,7 @@ class harness_ABAT(harness.harness): def __send_status(self, code, subdir, operation, msg): - self.__send("STATUS %s %s %s %s" % \ - (code, subdir, operation, msg)) + self.__send("STATUS %s %s %s %s" % (code, subdir, operation, msg)) def __root_device(self): diff --git a/client/bin/harness_standalone.py b/client/bin/harness_standalone.py index d6a46877..be3a824c 100644 --- a/client/bin/harness_standalone.py +++ b/client/bin/harness_standalone.py @@ -42,7 +42,6 @@ class harness_standalone(harness.harness): try: utils.system('ln -sf %s /etc/init.d/autotest' % rc) - utils.system('ln -sf %s /etc/rc%s.d/S99autotest' % \ - (rc, initdefault)) + utils.system('ln -sf %s /etc/rc%s.d/S99autotest' % (rc,initdefault)) except: print "WARNING: linking init scripts failed" diff --git a/client/bin/kernel_versions.py b/client/bin/kernel_versions.py index 9b04bebd..1b796c14 100644 --- a/client/bin/kernel_versions.py +++ b/client/bin/kernel_versions.py @@ -89,7 +89,7 @@ def version_choose_config(version, candidates): while length > 1: for o in range(n, -1, -1): if version_len(versions[o]) == (length + 1) and \ - version_limit(versions[o], length) == version: + version_limit(versions[o], length) == version: return versions[o] length -= 2 version = version_limit(version, length) diff --git a/client/bin/kernel_versions_unittest.py b/client/bin/kernel_versions_unittest.py index b63ecc88..de430fda 100755 --- a/client/bin/kernel_versions_unittest.py +++ b/client/bin/kernel_versions_unittest.py @@ -66,8 +66,8 @@ class kernel_versions_test(unittest.TestCase): releases = ['2.6.1' , '2.6.18-smp-220.0' ] candidates = ['2.6.1-rc1' , '2.6.18-smp-220.0_rc1'] - experiments = ['2.6.1-patch', '2.6.1-rc1_patch', - '2.6.18-smp-220.0_patch', 'UNKNOWN'] + experiments = ['2.6.1-patch', '2.6.1-rc1_patch', '2.6.18-smp-220.0_patch', + 'UNKNOWN'] def test_is_released_kernel(self): for v in self.releases: diff --git a/client/bin/kernelexpand-test.py b/client/bin/kernelexpand-test.py index 24b4ce04..bbf11639 100755 --- a/client/bin/kernelexpand-test.py +++ b/client/bin/kernelexpand-test.py @@ -17,9 +17,7 @@ mirrorA = [ class kernelexpandTest(unittest.TestCase): def test_decompose_simple(self): - correct = [ - [ km + 'v2.6/linux-2.6.23.tar.bz2' ] - ] + correct = [ [ km + 'v2.6/linux-2.6.23.tar.bz2' ] ] sample = decompose_kernel('2.6.23') self.assertEqual(sample, correct) diff --git a/client/bin/kernelexpand.py b/client/bin/kernelexpand.py index e23b8653..871b0536 100755 --- a/client/bin/kernelexpand.py +++ b/client/bin/kernelexpand.py @@ -60,8 +60,7 @@ def decompose_kernel_once(kernel): raise "unable to determine major/minor version" params['minor'] = match.group(1) params['major'] = match.group(2) - params['minor-prev'] = match.group(2) + \ - '.%d' % (int(match.group(3)) - 1) + params['minor-prev'] = match.group(2) + '.%d' % (int(match.group(3)) -1) # Build the new kernel and patch list. new_kernel = becomes % params @@ -97,8 +96,7 @@ def mirror_kernel_components(mirrors, components): (prefix, local) = mirror for patch in component: if patch.startswith(prefix): - new_patch = local + \ - patch[len(prefix):] + new_patch = local + patch[len(prefix):] new_patches.append(new_patch) for patch in component: new_patches.append(patch) @@ -146,12 +144,10 @@ if __name__ == '__main__': parser = OptionParser() - parser.add_option("-m", "--mirror", - type="string", dest="mirror", action="append", nargs=2, - help="mirror prefix") + parser.add_option("-m", "--mirror", type="string", dest="mirror", + action="append", nargs=2, help="mirror prefix") parser.add_option("-v", "--no-validate", dest="validate", - action="store_false", default=True, - help="prune invalid entries") + action="store_false", default=True, help="prune invalid entries") def usage(): parser.print_help() diff --git a/client/bin/xen.py b/client/bin/xen.py index a7924272..20711751 100644 --- a/client/bin/xen.py +++ b/client/bin/xen.py @@ -13,10 +13,10 @@ class xen(kernel.kernel): self.logfile.write('%s\n' % msg) - def __init__(self, job, base_tree, results_dir, tmp_dir, build_dir, \ - leave = False, kjob = None): + def __init__(self, job, base_tree, results_dir, tmp_dir, build_dir, + leave = False, kjob = None): # call base-class - kernel.kernel.__init__(self, job, base_tree, results_dir, \ + kernel.kernel.__init__(self, job, base_tree, results_dir, tmp_dir, build_dir, leave) self.kjob = kjob @@ -142,8 +142,8 @@ class xen(kernel.kernel): self.job.bootloader.remove_kernel(tag) # add xen and xen kernel - self.job.bootloader.add_kernel(self.kjob.image, tag, \ - self.kjob.initrd, self.xen_image) + self.job.bootloader.add_kernel(self.kjob.image, tag, + self.kjob.initrd, self.xen_image) # if no args passed, populate from /proc/cmdline if not args: @@ -185,8 +185,7 @@ class xen(kernel.kernel): break; # change out $XENGUEST in EXTRAVERSION line - system('sed -i.old "s,\$(XENGUEST),%s," %s' % \ - (xenguest, makefile)) + system('sed -i.old "s,\$(XENGUEST),%s," %s' % (xenguest, makefile)) def get_xen_build_ver(self): diff --git a/client/tests/aio_dio_bugs/aio_dio_bugs.py b/client/tests/aio_dio_bugs/aio_dio_bugs.py index 05132db2..5cd4c2f0 100644 --- a/client/tests/aio_dio_bugs/aio_dio_bugs.py +++ b/client/tests/aio_dio_bugs/aio_dio_bugs.py @@ -35,6 +35,6 @@ class aio_dio_bugs(test.test): autotest_utils.environ('LD_LIBRARY_PATH')) var_ld_path = 'LD_LIBRARY_PATH=' + ld_path for test in tests: - cmd = self.srcdir + '/' + test[name] + ' ' \ - + args + ' ' + test[arglist] + cmd = self.srcdir + '/' + test[name] + ' ' + args + ' ' \ + + test[arglist] utils.system(var_ld_path + ' ' + cmd) diff --git a/client/tests/aiostress/aiostress.py b/client/tests/aiostress/aiostress.py index 6d39edc8..5adb9fb4 100755 --- a/client/tests/aiostress/aiostress.py +++ b/client/tests/aiostress/aiostress.py @@ -34,7 +34,7 @@ class aiostress(test.test): os.chdir(self.tmpdir) libs = self.autodir+'/deps/libaio/lib/' ld_path = autotest_utils.prepend_path(libs, - autotest_utils.environ('LD_LIBRARY_PATH')) + autotest_utils.environ('LD_LIBRARY_PATH')) var_ld_path = 'LD_LIBRARY_PATH=' + ld_path cmd = self.srcdir + '/aio-stress ' + args + ' poo' profilers = self.job.profilers diff --git a/client/tests/barriertest/barriertest.py b/client/tests/barriertest/barriertest.py index 26bcab70..29b72f48 100644 --- a/client/tests/barriertest/barriertest.py +++ b/client/tests/barriertest/barriertest.py @@ -9,22 +9,21 @@ class barriertest(test.test): hostid, masterid, all_ids): profilers = self.job.profilers - b0 = self.job.barrier(hostid, "sync_profilers", - timeout_start, port=63100) + b0 = self.job.barrier(hostid, "sync_profilers", timeout_start, + port=63100) b0.rendevous_servers(masterid, hostid) - b1 = self.job.barrier(hostid, "start_profilers", - timeout_start, port=63100) + b1 = self.job.barrier(hostid, "start_profilers", timeout_start, + port=63100) b1.rendevous_servers(masterid, hostid) - b2 = self.job.barrier(hostid, "local_sync_profilers", - timeout_sync) + b2 = self.job.barrier(hostid, "local_sync_profilers", timeout_sync) b2.rendevous(*all_ids) profilers.start(self) - b3 = self.job.barrier(hostid, "stop_profilers", - timeout_stop, port=63100) + b3 = self.job.barrier(hostid, "stop_profilers", timeout_stop, + port=63100) b3.rendevous_servers(masterid, hostid) profilers.stop(self) diff --git a/client/tests/bash_shared_mapping/bash_shared_mapping.py b/client/tests/bash_shared_mapping/bash_shared_mapping.py index df993c1a..6b0b932e 100755 --- a/client/tests/bash_shared_mapping/bash_shared_mapping.py +++ b/client/tests/bash_shared_mapping/bash_shared_mapping.py @@ -7,8 +7,7 @@ class bash_shared_mapping(test.test): # http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz def setup(self, tarball = 'ext3-tools.tar.gz'): - self.tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir) os.chdir(self.srcdir) @@ -33,9 +32,8 @@ class bash_shared_mapping(test.test): pid[i] = os.spawnv(os.P_NOWAIT, usemem, args) cmd = "%s/bash-shared-mapping %s %d -t %d -n %d" % \ - (self.srcdir, file, kilobytes, - count_cpus(), iterations) + (self.srcdir, file, kilobytes, count_cpus(), iterations) os.system(cmd) - for i in (0,1): + for i in (0, 1): os.kill(pid[i], signal.SIGKILL) diff --git a/client/tests/bonnie/bonnie.py b/client/tests/bonnie/bonnie.py index e6def250..1156be2c 100755 --- a/client/tests/bonnie/bonnie.py +++ b/client/tests/bonnie/bonnie.py @@ -29,8 +29,7 @@ class bonnie(test.test): # http://www.coker.com.au/bonnie++/bonnie++-1.03a.tgz def setup(self, tarball = 'bonnie++-1.03a.tgz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) @@ -48,14 +47,12 @@ class bonnie(test.test): profilers = self.job.profilers if not profilers.only(): for i in range(iterations): - results.append(utils.system_output(cmd, - retain_output=True)) + results.append(utils.system_output(cmd, retain_output=True)) # Do a profiling run if necessary if profilers.present(): profilers.start(self) - results.append(utils.system_output(cmd, - retain_output=True)) + results.append(utils.system_output(cmd, retain_output=True)) profilers.stop(self) profilers.report(self) diff --git a/client/tests/btreplay/btreplay.py b/client/tests/btreplay/btreplay.py index 5bfc2890..26635aea 100644 --- a/client/tests/btreplay/btreplay.py +++ b/client/tests/btreplay/btreplay.py @@ -8,8 +8,7 @@ class btreplay(test.test): # http://brick.kernel.dk/snaps/blktrace-git-latest.tar.gz def setup(self, tarball = 'blktrace-git-latest.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) self.job.setup_dep(['libaio']) @@ -29,27 +28,27 @@ class btreplay(test.test): def _run_btreplay(self, dev, devices, tmpdir, extra_args): - alldevs="-d /dev/"+dev + alldevs = "-d /dev/" + dev alldnames = dev for d in devices.split(): - alldevs += " -d /dev/"+d - alldnames += " "+d + alldevs += " -d /dev/" + d + alldnames += " " + d # convert the trace (assumed to be in this test's base # directory) into btreplay's required format - utils.system("./btreplay/btrecord -d .. -D "+tmpdir+" "+dev) + utils.system("./btreplay/btrecord -d .. -D %s %s" % (tmpdir, dev)) # time a replay that omits "thinktime" between requests # (by use of the -N flag) - utils.system(self.ldlib+" /usr/bin/time ./btreplay/btreplay -d "+\ + utils.system(self.ldlib + " /usr/bin/time ./btreplay/btreplay -d "+\ tmpdir+" -N -W "+dev+" "+extra_args+" 2>&1") # trace a replay that reproduces inter-request delays, and # analyse the trace with btt to determine the average request # completion latency - utils.system("./blktrace -D "+tmpdir+" "+alldevs+" >/dev/null &") - utils.system(self.ldlib+" ./btreplay/btreplay -d "+tmpdir+" -W "+\ - dev+" "+extra_args) + utils.system("./blktrace -D %s %s >/dev/null &" % (tmpdir, alldevs)) + utils.system(self.ldlib + " ./btreplay/btreplay -d %s -W %s %s" % + (tmpdir, dev, extra_args)) utils.system("killall -INT blktrace") # wait until blktrace is really done @@ -60,13 +59,13 @@ class btreplay(test.test): slept += 0.1 if slept > 30.0: utils.system("killall -9 blktrace") - raise error.TestError("blktrace failed to exit after 30 seconds") - utils.system("./blkparse -q -D "+tmpdir+" -d "+tmpdir+\ - "/trace.bin -O "+alldnames+" >/dev/null") - utils.system("./btt/btt -i "+tmpdir+"/trace.bin") + raise error.TestError("blktrace failed to exit in 30 seconds") + utils.system("./blkparse -q -D %s -d %s/trace.bin -O %s >/dev/null" % + (tmpdir, tmpdir, alldnames)) + utils.system("./btt/btt -i %s/trace.bin" % tmpdir) - def execute(self, iterations = 1, dev="", devices="", - extra_args = '', tmpdir = None): + def execute(self, iterations = 1, dev="", devices="", extra_args = '', + tmpdir = None): # @dev: The device against which the trace will be replayed. # e.g. "sdb" or "md_d1" # @devices: A space-separated list of the underlying devices @@ -109,11 +108,11 @@ class btreplay(test.test): systime = 0.0 for n in range(len(s)): i = (len(s)-1) - n - systime += float(s[i])*(60**n) + systime += float(s[i]) * (60**n) elapsed = 0.0 for n in range(len(e)): i = (len(e)-1) - n - elapsed += float(e[i])*(60**n) + elapsed += float(e[i]) * (60**n) q2c = 0.0 for line in lines: diff --git a/client/tests/container_functional/container_functional.py b/client/tests/container_functional/container_functional.py index eec05322..1c6803f9 100644 --- a/client/tests/container_functional/container_functional.py +++ b/client/tests/container_functional/container_functional.py @@ -20,28 +20,21 @@ class container_functional(test.test): for container in ['sys', name]: try: utils.system('ls %s > /dev/null' % \ - os.path.join('/dev/cpuset', - container)) + os.path.join('/dev/cpuset', container)) except error.CmdError: - raise error.TestError("Container %s not created." % \ - container) + raise error.TestError("Container %s not created." % container) # Did we get the CPUs? if cpus: actual_cpus = utils.system_output('cat %s' % \ - os.path.join('/dev/cpuset', - name, - 'cpus')) + os.path.join('/dev/cpuset', name, 'cpus')) if cpus != cpuset.rangelist_to_list(actual_cpus): - raise error.TestError(("CPUs = %s, " - "expecting: %s") % + raise error.TestError(("CPUs = %s, expecting: %s") % (actual_cpus, cpus)) # Are we in this container? actual_pid = utils.system_output('cat %s' % \ - os.path.join('/dev/cpuset', - name, - 'tasks')) + os.path.join('/dev/cpuset', name, 'tasks')) if str(os.getpid()) not in actual_pid: raise error.TestError("My pid %s is not in " @@ -50,23 +43,17 @@ class container_functional(test.test): # Our memory nodes != sys memory nodes actual_mems = utils.system_output('cat %s' % \ - os.path.join('/dev/cpuset', - name, - 'mems')) + os.path.join('/dev/cpuset', name, 'mems')) sys_mems = utils.system_output('cat %s' % \ - os.path.join('/dev/cpuset', - 'sys', - 'mems')) + os.path.join('/dev/cpuset', 'sys', 'mems')) actual_nodes = set(cpuset.rangelist_to_list(actual_mems)) sys_nodes = set(cpuset.rangelist_to_list(sys_mems)) if actual_nodes.intersection(sys_nodes): raise error.TestError("Sys nodes = %s\n" - "My nodes = %s" % \ - (sys_nodes, actual_nodes)) + "My nodes = %s" % (sys_nodes, actual_nodes)) # Should only have one node for 100MB if len(actual_nodes) != 1: - raise error.TestError(("Got more than 1 node: %s" % - actual_nodes)) + raise error.TestError(("Got more than 1 node: %s" % actual_nodes)) diff --git a/client/tests/cpu_hotplug/cpu_hotplug.py b/client/tests/cpu_hotplug/cpu_hotplug.py index 352145bf..8e1d7d9b 100644 --- a/client/tests/cpu_hotplug/cpu_hotplug.py +++ b/client/tests/cpu_hotplug/cpu_hotplug.py @@ -7,8 +7,7 @@ class cpu_hotplug(test.test): # http://developer.osdl.org/dev/hotplug/tests/lhcs_regression-1.6.tgz def setup(self, tarball = 'lhcs_regression-1.6.tgz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) def execute(self): diff --git a/client/tests/dbench/dbench.py b/client/tests/dbench/dbench.py index 085b4b85..bd6fdd27 100755 --- a/client/tests/dbench/dbench.py +++ b/client/tests/dbench/dbench.py @@ -27,14 +27,12 @@ class dbench(test.test): results = [] if not profilers.only(): for i in range(iterations): - results.append(utils.system_output(cmd, - retain_output=True)) + results.append(utils.system_output(cmd, retain_output=True)) # Do a profiling run if necessary if profilers.present(): profilers.start(self) - results.append(utils.system_output(cmd, - retain_output=True)) + results.append(utils.system_output(cmd, retain_output=True)) profilers.stop(self) profilers.report(self) diff --git a/client/tests/dbt2/dbt2.py b/client/tests/dbt2/dbt2.py index 5d6d6fca..fef19c19 100644 --- a/client/tests/dbt2/dbt2.py +++ b/client/tests/dbt2/dbt2.py @@ -11,8 +11,7 @@ class dbt2(test.test): # http://osdn.dl.sourceforge.net/sourceforge/osdldbt/dbt2-0.39.tar.gz def setup(self, tarball = 'dbt2-0.39.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) self.job.setup_dep(['pgsql', 'pgpool', 'mysql']) @@ -36,10 +35,10 @@ class dbt2(test.test): # Create symlinks to autotest's results directory from dbt-2's # preferred results directory to self.resultsdir - utils.system('ln -s %s %s' % (self.resultsdir, \ - self.srcdir + '.mysql/scripts/output')) - utils.system('ln -s %s %s' % (self.resultsdir, \ - self.srcdir + '.pgsql/scripts/output')) + utils.system('ln -s %s %s' % + (self.resultsdir, self.srcdir + '.mysql/scripts/output')) + utils.system('ln -s %s %s' % + (self.resultsdir, self.srcdir + '.pgsql/scripts/output')) def execute(self, db_type, args = ''): logfile = self.resultsdir + '/dbt2.log' diff --git a/client/tests/disktest/disktest.py b/client/tests/disktest/disktest.py index 2019c005..a21b935d 100755 --- a/client/tests/disktest/disktest.py +++ b/client/tests/disktest/disktest.py @@ -19,7 +19,7 @@ class disktest(test.test): print "testing %d MB files on %s in %d MB memory" % \ (self.chunk_mb, disk, self.memory_mb) cmd = "%s/disktest -m %d -f %s/testfile.%d -i -S" % \ - (self.srcdir, self.chunk_mb, disk, chunk) + (self.srcdir, self.chunk_mb, disk, chunk) p = subprocess.Popen(cmd, shell=True) return(p.pid) diff --git a/client/tests/fio/fio.py b/client/tests/fio/fio.py index aad6bf7e..29a2d3c2 100644 --- a/client/tests/fio/fio.py +++ b/client/tests/fio/fio.py @@ -8,8 +8,7 @@ class fio(test.test): # http://brick.kernel.dk/snaps/fio-1.16.5.tar.bz2 def setup(self, tarball = 'fio-1.16.5.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) self.job.setup_dep(['libaio']) diff --git a/client/tests/fs_mark/fs_mark.py b/client/tests/fs_mark/fs_mark.py index 6b52e197..dfde3cfb 100644 --- a/client/tests/fs_mark/fs_mark.py +++ b/client/tests/fs_mark/fs_mark.py @@ -8,8 +8,7 @@ class fs_mark(test.test): # http://developer.osdl.org/dev/doubt/fs_mark/archive/fs_mark-3.2.tgz def setup(self, tarball = 'fs_mark-3.2.tgz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/fsfuzzer/fsfuzzer.py b/client/tests/fsfuzzer/fsfuzzer.py index d8310e30..050f4fcb 100755 --- a/client/tests/fsfuzzer/fsfuzzer.py +++ b/client/tests/fsfuzzer/fsfuzzer.py @@ -8,8 +8,7 @@ class fsfuzzer(test.test): # http://people.redhat.com/sgrubb/files/fsfuzzer-0.6.tar.gz def setup(self, tarball = 'fsfuzzer-0.6.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/fsstress/fsstress.py b/client/tests/fsstress/fsstress.py index 6a6e20ff..6521842b 100644 --- a/client/tests/fsstress/fsstress.py +++ b/client/tests/fsstress/fsstress.py @@ -9,8 +9,7 @@ class fsstress(test.test): # http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz def setup(self, tarball = 'ext3-tools.tar.gz'): - self.tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir) os.chdir(self.srcdir) @@ -22,8 +21,7 @@ class fsstress(test.test): if not testdir: testdir = self.tmpdir - args = '-d ' + testdir + ' -p ' + nproc + ' -n ' + nops + ' ' + extra_args - + args = '-d %s -p %s -n %s %s' % (testdir, nproc, nops, extra_args) cmd = self.srcdir + '/fsstress ' + args profilers = self.job.profilers if not profilers.only(): diff --git a/client/tests/fsx/fsx.py b/client/tests/fsx/fsx.py index 08328be7..8ed98d2e 100755 --- a/client/tests/fsx/fsx.py +++ b/client/tests/fsx/fsx.py @@ -13,8 +13,7 @@ class fsx(test.test): # http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz def setup(self, tarball = 'ext3-tools.tar.gz'): - self.tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir) self.job.setup_dep(['libaio']) diff --git a/client/tests/interbench/interbench.py b/client/tests/interbench/interbench.py index aca7834d..fa8411e6 100644 --- a/client/tests/interbench/interbench.py +++ b/client/tests/interbench/interbench.py @@ -8,8 +8,7 @@ class interbench(test.test): # http://www.kernel.org/pub/linux/kernel/people/ck/apps/interbench/interbench-0.30.tar.bz2 def setup(self, tarball = 'interbench-0.30.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/iozone/iozone.py b/client/tests/iozone/iozone.py index 8347a320..f1e7e6d1 100644 --- a/client/tests/iozone/iozone.py +++ b/client/tests/iozone/iozone.py @@ -9,8 +9,7 @@ class iozone(test.test): # http://www.iozone.org/src/current/iozone3_283.tar def setup(self, tarball = 'iozone3_283.tar'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(os.path.join(self.srcdir, 'src/current')) @@ -26,8 +25,7 @@ class iozone(test.test): def execute(self, dir = None, iterations=1, args = None): - self.keyval = open(os.path.join(self.resultsdir, 'keyval'), - 'w') + self.keyval = open(os.path.join(self.resultsdir, 'keyval'), 'w') if not dir: dir = self.tmpdir os.chdir(dir) @@ -55,8 +53,7 @@ class iozone(test.test): def __format_results(self, results): labels = ('write', 'rewrite', 'read', 'reread', 'randread', 'randwrite', 'bkwdread', 'recordrewrite', - 'strideread', 'fwrite', 'frewrite', - 'fread', 'freread') + 'strideread', 'fwrite', 'frewrite', 'fread', 'freread') for line in results.splitlines(): fields = line.split() if len(fields) != 15: diff --git a/client/tests/isic/isic.py b/client/tests/isic/isic.py index df616bee..b7f6c7b2 100644 --- a/client/tests/isic/isic.py +++ b/client/tests/isic/isic.py @@ -13,13 +13,12 @@ class isic(test.test): self.job.setup_dep(['libnet']) def setup(self, tarball = 'isic-0.06.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) utils.system('patch -p1 < ../build-fixes.patch') - utils.system('PREFIX=' + self.autodir + '/deps/libnet/libnet/ ./configure') + utils.system('PREFIX=%s /deps/libnet/libnet/ ./configure' %self.autodir) utils.system('make') def execute(self, args = '-s rand -d 127.0.0.1 -p 10000000'): diff --git a/client/tests/kernbench/kernbench.py b/client/tests/kernbench/kernbench.py index de7d8491..490ab3b7 100755 --- a/client/tests/kernbench/kernbench.py +++ b/client/tests/kernbench/kernbench.py @@ -83,8 +83,7 @@ class kernbench(test.test): if not profilers.only(): for i in range(iterations): print "Performance run, iteration %d ..." % i - timefile = os.path.join(self.resultsdir, - 'time.%d' % i) + timefile = os.path.join(self.resultsdir, 'time.%d' % i) kernel.build_timed(threads, timefile) # Do a profiling run if necessary diff --git a/client/tests/kvmtest/kvmtest.py b/client/tests/kvmtest/kvmtest.py index f7760335..655d503c 100644 --- a/client/tests/kvmtest/kvmtest.py +++ b/client/tests/kvmtest/kvmtest.py @@ -7,8 +7,7 @@ class kvmtest(test.test): version = 1 def setup(self, tarball = 'kvm-test.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) utils.system('python setup.py install') @@ -22,9 +21,8 @@ class kvmtest(test.test): # spawn vncserver if needed if not os.environ.has_key('DISPLAY'): - print("No DISPLAY set in environment," - "spawning vncserver...") - display = self.__create_vncserver(os.environ['HOME']+"/.vnc") + print("No DISPLAY set in environment, spawning vncserver...") + display = self.__create_vncserver(os.environ['HOME'] + "/.vnc") print("Setting DISPLAY=%s"%(display)) os.environ['DISPLAY'] = display @@ -32,8 +30,7 @@ class kvmtest(test.test): os.path.walk(testdir, self.__has_vmlog, dirs) for d in dirs: - replaydir = os.path.join(self.resultsdir, - os.path.basename(d)) + replaydir = os.path.join(self.resultsdir, os.path.basename(d)) os.mkdir(replaydir) logfile = replaydir + "/%s.log" %(os.path.basename(d)) @@ -43,15 +40,14 @@ class kvmtest(test.test): results.append((d, rv)) if rv != 0: screenshot = self.__get_expected_file(logfile) - expected = "expected-%03d.png" %( - random.randint(0, 999)) + expected = "expected-%03d.png" % random.randint(0, 999) dest = os.path.join(replaydir,expected) # make a copy of the screen shot - utils.system("cp %s %s" %(screenshot, dest), 1) + utils.system("cp %s %s" % (screenshot, dest), 1) # move the failure - utils.system("mv failure-*.png %s" %(replaydir), 1) + utils.system("mv failure-*.png %s" % replaydir, 1) # generate html output self.__format_results(results) @@ -59,13 +55,13 @@ class kvmtest(test.test): # produce pass/fail output for (x, y) in results: if y != 0: - print("FAIL: '%s' with rv %s" %(x, y)) + print("FAIL: '%s' with rv %s" % (x, y)) failed = failed + 1 else: - print("pass: '%s' with rv %s" %(x, y)) + print("pass: '%s' with rv %s" % (x, y)) passed = passed + 1 - print("Summary: Passed %d Failed %d" %(passed, failed)) + print("Summary: Passed %d Failed %d" % (passed, failed)) # if we had any tests not passed, fail entire test if failed != 0: raise error.TestError('kvm-test-replay') @@ -91,16 +87,15 @@ class kvmtest(test.test): if os.path.exists('/proc/%s/status' % pid): vncdisplay = os.path.basename(pidfile)\ .split(":")[1].split(".")[0] - print("Found vncserver on port %s, using it"%( - vncdisplay)) + print("Found vncserver on port %s, using it" % vncdisplay) return ':%s.0' %(vncdisplay) # none of the vncserver were still alive, spawn our own and # return the display whack existing server first, then spawn it vncdisplay = "1" - print("Spawning vncserver on port %s"%(vncdisplay)) - utils.system('vncserver :%s' %(vncdisplay)) - return ':%s.0' %(vncdisplay) + print("Spawning vncserver on port %s" % vncdisplay) + utils.system('vncserver :%s' % vncdisplay) + return ':%s.0' % vncdisplay def __has_vmlog(self, arg, dirname, names): @@ -125,10 +120,10 @@ class kvmtest(test.test): raise "Failed to find images" fail_buff = "<html><table border=1><tr><th>Barrier Diff</th>\n" + \ - "<th>Expected Barrier</th><th>Failure</th></tr><tr><td></td>\n" + "<th>Expected Barrier</th><th>Failure</th></tr><tr><td></td>\n" for img in expected_img, failure_img: fail_buff = fail_buff + "<td><a href=\"%s\"><img width=320 " \ - "height=200 src=\"%s\"></a></td>\n" %(img, img) + "height=200 src=\"%s\"></a></td>\n" % (img, img) fail_buff = fail_buff + "</tr></table></html>\n" @@ -142,13 +137,13 @@ class kvmtest(test.test): test_buff = "<html><table border=1><tr><th>Test</th>\n" for (x,y) in results: - test_buff = test_buff + "<th>%s</th>\n" %(os.path.basename(x)) + test_buff = test_buff + "<th>%s</th>\n" % os.path.basename(x) test_buff = test_buff + "</tr><tr><td></td>\n" for (x,y) in results: if y != 0: - fail = "<td><a href=\"results/%s/\">FAIL</a></td>\n" %(os.path.basename(x)) + fail = "<td><a href=\"results/%s/\">FAIL</a></td>\n" % os.path.basename(x) test_buff = test_buff + fail self.__gen_fail_html(x) else: diff --git a/client/tests/libhugetlbfs/libhugetlbfs.py b/client/tests/libhugetlbfs/libhugetlbfs.py index aa018c51..2306ce20 100644 --- a/client/tests/libhugetlbfs/libhugetlbfs.py +++ b/client/tests/libhugetlbfs/libhugetlbfs.py @@ -7,8 +7,7 @@ class libhugetlbfs(test.test): # http://libhugetlbfs.ozlabs.org/releases/libhugetlbfs-1.3-pre1.tar.gz def setup(self, tarball = 'libhugetlbfs-1.3-pre1.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) @@ -27,7 +26,8 @@ class libhugetlbfs(test.test): if os.path.exists('/proc/sys/vm/nr_hugepages'): utils.write_one_line('/proc/sys/vm/nr_hugepages', str(pages_requested)) - pages_available = int(open('/proc/sys/vm/nr_hugepages', 'r').readline()) + nr_hugepages = utils.read_one_line('/proc/sys/vm/nr_hugepages') + pages_available = int(nr_hugepages) else: raise error.TestNAError('Kernel does not support hugepages') diff --git a/client/tests/lmbench/lmbench.py b/client/tests/lmbench/lmbench.py index a4bef457..e31734b1 100755 --- a/client/tests/lmbench/lmbench.py +++ b/client/tests/lmbench/lmbench.py @@ -8,8 +8,7 @@ class lmbench(test.test): version = 2 def setup(self, tarball = 'lmbench3.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) # http://www.bitmover.com/lm/lmbench/lmbench3.tar.gz # + lmbench3.diff # removes Makefile references to bitkeeper @@ -20,10 +19,9 @@ class lmbench(test.test): utils.system('make') - def execute(self, iterations = 1, mem = '', fastmem = 'NO', - slowfs = 'NO', disks = '', disks_desc = '', - mhz = '', remote = '', enough = '5000', sync_max = '1', - fsdir = None, file = None): + def execute(self, iterations = 1, mem = '', fastmem = 'NO', slowfs = 'NO', + disks = '', disks_desc = '', mhz = '', remote = '', + enough = '5000', sync_max = '1', fsdir = None, file = None): if not fsdir: fsdir = self.tmpdir if not file: @@ -42,6 +40,7 @@ class lmbench(test.test): utils.system(cmd) profilers.stop(self) profilers.report(self) + # Get the results: outputdir = self.srcdir + "/results" results = self.resultsdir + "/summary.txt" diff --git a/client/tests/ltp/ltp.py b/client/tests/ltp/ltp.py index 2417f46b..434c18e6 100755 --- a/client/tests/ltp/ltp.py +++ b/client/tests/ltp/ltp.py @@ -7,8 +7,7 @@ class ltp(test.test): # http://prdownloads.sourceforge.net/ltp/ltp-full-20080229.tgz def setup(self, tarball = 'ltp-full-20080229.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/netperf2/netperf2.py b/client/tests/netperf2/netperf2.py index e01f815a..4b4deb53 100755 --- a/client/tests/netperf2/netperf2.py +++ b/client/tests/netperf2/netperf2.py @@ -8,8 +8,7 @@ class netperf2(test.test): # ftp://ftp.netperf.org/netperf/netperf-2.4.1.tar.gz def setup(self, tarball = 'netperf-2.4.1.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) @@ -27,8 +26,8 @@ class netperf2(test.test): self.client_path = os.path.join(self.srcdir, 'src/netperf') - def execute(self, server_ip, client_ip, role, - script='snapshot_script', args=''): + def execute(self, server_ip, client_ip, role, script='snapshot_script', + args=''): server_tag = server_ip + '#netperf-server' client_tag = client_ip + '#netperf-client' all = [server_tag, client_tag] @@ -36,10 +35,8 @@ class netperf2(test.test): if (role == 'server'): self.server_start() try: - job.barrier(server_tag, 'start', - 600).rendevous(*all) - job.barrier(server_tag, 'stop', - 3600).rendevous(*all) + job.barrier(server_tag, 'start', 600).rendevous(*all) + job.barrier(server_tag, 'stop', 3600).rendevous(*all) finally: self.server_stop() elif (role == 'client'): diff --git a/client/tests/parallel_dd/parallel_dd.py b/client/tests/parallel_dd/parallel_dd.py index 5d92667f..c86c9622 100755 --- a/client/tests/parallel_dd/parallel_dd.py +++ b/client/tests/parallel_dd/parallel_dd.py @@ -34,8 +34,7 @@ class parallel_dd(test.test): dd = 'dd if=/dev/zero of=%s bs=4K count=%d' % \ (file, self.blocks_per_file) print dd - p.append(subprocess.Popen(dd + ' > /dev/null', - shell=True)) + p.append(subprocess.Popen(dd + ' > /dev/null', shell=True)) print "Waiting for %d streams" % self.streams # Wait for everyone to complete for i in range(self.streams): @@ -90,7 +89,8 @@ class parallel_dd(test.test): self.fs.unmount() - def execute(self, fs, fstype = 'ext2', iterations = 2, megabytes = 1000, streams = 2): + def execute(self, fs, fstype = 'ext2', iterations = 2, megabytes = 1000, + streams = 2): self.megabytes = megabytes self.blocks = megabytes * 256 self.blocks_per_file = self.blocks / streams diff --git a/client/tests/pi_tests/pi_tests.py b/client/tests/pi_tests/pi_tests.py index 7f3fcf27..c3c79de6 100644 --- a/client/tests/pi_tests/pi_tests.py +++ b/client/tests/pi_tests/pi_tests.py @@ -10,8 +10,7 @@ class pi_tests(test.test): def setup(self, tarball = 'pi_tests.tar.bz2'): autotest_utils.check_glibc_ver('2.5') - tarball = autotest_utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = autotest_utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/posixtest/posixtest.py b/client/tests/posixtest/posixtest.py index adec69cb..d26ce0a4 100755 --- a/client/tests/posixtest/posixtest.py +++ b/client/tests/posixtest/posixtest.py @@ -11,11 +11,8 @@ class posixtest(test.test): version = 1 # http://ufpr.dl.sourceforge.net/sourceforge/posixtest/posixtestsuite-1.5.2.tar.gz def setup(self, tarball = 'posixtestsuite-1.5.2.tar.gz'): - self.posix_tarball = utils.unmap_url(self.bindir, - tarball, - self.tmpdir) - autotest_utils.extract_tarball_to_dir(self.posix_tarball, - self.srcdir) + self.posix_tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) + autotest_utils.extract_tarball_to_dir(self.posix_tarball, self.srcdir) os.chdir(self.srcdir) # Applying a small patch that introduces some linux specific # linking options diff --git a/client/tests/reaim/reaim.py b/client/tests/reaim/reaim.py index 9a5e832a..eae8e301 100755 --- a/client/tests/reaim/reaim.py +++ b/client/tests/reaim/reaim.py @@ -9,8 +9,7 @@ class reaim(test.test): # http://prdownloads.sourceforge.net/re-aim-7/osdl-aim-7.0.1.13.tar.gz def setup(self, tarball = 'osdl-aim-7.0.1.13.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) self.job.setup_dep(['libaio']) @@ -49,11 +48,11 @@ class reaim(test.test): # -e <number of users to end with> # -i <number of users to increment> workfile = os.path.join('data', workfile) - args = "-f %s -s %d -e %d -i %d" %(workfile,start,end,increment) + args = "-f %s -s %d -e %d -i %d" % (workfile, start, end, increment) config = os.path.join(self.srcdir, 'reaim.config') utils.system('cp -f %s/reaim.config %s' % (self.bindir, config)) args += ' -c ./reaim.config' - open(config, 'a+').write("DISKDIR %s\n" % (tmpdir)) + open(config, 'a+').write("DISKDIR %s\n" % tmpdir) os.chdir(self.srcdir) print os.getcwd() cmd = self.ldlib + ' ./reaim ' + args + ' ' + extra_args @@ -63,14 +62,12 @@ class reaim(test.test): profilers = self.job.profilers if not profilers.only(): for i in range(iterations): - results.append(utils.system_output(cmd, - retain_output=True)) + results.append(utils.system_output(cmd, retain_output=True)) # Do a profiling run if necessary if profilers.present(): profilers.start(self) - resuls.append(utils.system_output(cmd, - retain_output=True)) + resuls.append(utils.system_output(cmd, retain_output=True)) profilers.stop(self) profilers.report(self) diff --git a/client/tests/rmaptest/rmaptest.py b/client/tests/rmaptest/rmaptest.py index 9b655470..e6afdef2 100644 --- a/client/tests/rmaptest/rmaptest.py +++ b/client/tests/rmaptest/rmaptest.py @@ -23,6 +23,5 @@ class rmaptest(test.test): def execute(self, args = ''): os.chdir(self.tmpdir) for test in tests: - cmd = self.srcdir + '/' + test[name] + ' ' \ - + args + ' ' + test[arglist] + cmd = '%s/%s %s %s' % (self.srcdir, test[name], args, test[arglist]) utils.system(cmd) diff --git a/client/tests/rtlinuxtests/rtlinuxtests.py b/client/tests/rtlinuxtests/rtlinuxtests.py index 8c27432d..c971ca3c 100644 --- a/client/tests/rtlinuxtests/rtlinuxtests.py +++ b/client/tests/rtlinuxtests/rtlinuxtests.py @@ -4,9 +4,7 @@ from autotest_lib.client.common_lib import utils # tests is a simple array of "cmd" "arguments" -tests = [["./run.sh", "tests=func"], - ["./run.sh", "tests=pi-tests"], - ] +tests = [["./run.sh", "tests=func"], ["./run.sh", "tests=pi-tests"]] name = 0 arglist = 1 @@ -18,8 +16,7 @@ class rtlinuxtests(test.test): def setup(self, tarball = 'tests.tar.bz2'): autotest_utils.check_glibc_ver('2.5') - self.tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir) os.chdir(self.srcdir) utils.system('patch -p1 < ../path-fix.patch') @@ -27,5 +24,5 @@ class rtlinuxtests(test.test): def execute(self, args = ''): os.chdir(self.srcdir) for test in tests: - cmd = 'echo y | ' + test[name] + ' ' + args + ' ' + test[arglist] + cmd = 'echo y | %s %s %s' % (test[name], args, test[arglist]) utils.system(cmd) diff --git a/client/tests/rttester/rttester.py b/client/tests/rttester/rttester.py index 69a2e9ff..f28ad358 100644 --- a/client/tests/rttester/rttester.py +++ b/client/tests/rttester/rttester.py @@ -9,8 +9,7 @@ class rttester(test.test): # http://www.stardust.webpages.pl/files/patches/autotest/rttester.tar.bz2 def setup(self, tarball = 'rttester.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) def execute(self): diff --git a/client/tests/scrashme/scrashme.py b/client/tests/scrashme/scrashme.py index 30ace1c9..77f8a1b2 100644 --- a/client/tests/scrashme/scrashme.py +++ b/client/tests/scrashme/scrashme.py @@ -8,8 +8,7 @@ class scrashme(test.test): # http://www.codemonkey.org.uk/projects/git-snapshots/scrashme/scrashme-2007-07-08.tar.gz def setup(self, tarball = 'scrashme-2007-07-08.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/sparse/sparse.py b/client/tests/sparse/sparse.py index f6ff11d5..253675ce 100755 --- a/client/tests/sparse/sparse.py +++ b/client/tests/sparse/sparse.py @@ -8,8 +8,7 @@ class sparse(test.test): # http://www.codemonkey.org.uk/projects/git-snapshots/sparse/sparse-2006-04-28.tar.gz def setup(self, tarball = 'sparse-2006-04-28.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/spew/spew.py b/client/tests/spew/spew.py index 4c1cb557..77a657ea 100755 --- a/client/tests/spew/spew.py +++ b/client/tests/spew/spew.py @@ -8,8 +8,7 @@ class spew(test.test): # ftp://ftp.berlios.de/pub/spew/1.0.5/spew-1.0.5.tgz def setup(self, tarball = 'spew-1.0.5.tgz'): - self.tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir) os.chdir(self.srcdir) @@ -17,7 +16,8 @@ class spew(test.test): utils.system('make') - def execute(self, testdir = None, iterations = 1, filesize='100M', type='write', pattern='random'): + def execute(self, testdir = None, iterations = 1, filesize='100M', + type='write', pattern='random'): cmd = os.path.join(self.srcdir, 'src/spew') if not testdir: testdir = self.tmpdir diff --git a/client/tests/stress/stress.py b/client/tests/stress/stress.py index d6688662..c7f3341f 100644 --- a/client/tests/stress/stress.py +++ b/client/tests/stress/stress.py @@ -8,8 +8,7 @@ class stress(test.test): # http://weather.ou.edu/~apw/projects/stress/stress-0.18.8.tar.gz def setup(self, tarball = 'stress-0.18.8.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/sysbench/sysbench.py b/client/tests/sysbench/sysbench.py index 571c37f6..aef3627f 100644 --- a/client/tests/sysbench/sysbench.py +++ b/client/tests/sysbench/sysbench.py @@ -8,8 +8,7 @@ class sysbench(test.test): # http://osdn.dl.sourceforge.net/sourceforge/sysbench/sysbench-0.4.8.tar.gz def setup(self, tarball = 'sysbench-0.4.8.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) self.job.setup_dep(['pgsql', 'mysql']) @@ -44,11 +43,9 @@ class sysbench(test.test): raise TestError('Unable to run as nobody') if (db_type == 'pgsql'): - self.execute_pgsql(build, num_threads, max_time, \ - read_only, args) + self.execute_pgsql(build, num_threads, max_time, read_only, args) elif (db_type == 'mysql'): - self.execute_mysql(build, num_threads, max_time, \ - read_only, args) + self.execute_mysql(build, num_threads, max_time, read_only, args) def execute_pgsql(self, build, num_threads, max_time, read_only, args): @@ -64,16 +61,14 @@ class sysbench(test.test): # Database must be able to write its output into debugdir os.chown(self.debugdir, self.dbuid, 0) - utils.system(self.sudo + bin + '/pg_ctl -D ' + data + \ - ' -l ' + log + ' start') + utils.system(self.sudo + bin + '/pg_ctl -D %s -l %s start' %(data, log)) # Wait for database to start time.sleep(5) try: - base_cmd = self.srcdir + '/sysbench/sysbench ' + \ - '--test=oltp --db-driver=pgsql ' + \ - '--pgsql-user=' + self.dbuser + base_cmd = self.srcdir + '/sysbench/sysbench --test=oltp ' + '--db-driver=pgsql --pgsql-user=' + self.dbuser if build == 1: utils.system(self.sudo + bin + '/createdb sbtest') @@ -130,9 +125,8 @@ class sysbench(test.test): time.sleep(5) try: - base_cmd = self.srcdir + '/sysbench/sysbench ' + \ - '--test=oltp --db-driver=mysql ' + \ - '--mysql-user=root' + base_cmd = self.srcdir + '/sysbench/sysbench --test=oltp ' + '--db-driver=mysql --mysql-user=root' if build == 1: utils.system('echo "create database sbtest" | ' + \ diff --git a/client/tests/tbench/tbench.py b/client/tests/tbench/tbench.py index 0aeb3cd4..32cc3f0c 100755 --- a/client/tests/tbench/tbench.py +++ b/client/tests/tbench/tbench.py @@ -8,8 +8,7 @@ class tbench(test.test): # http://samba.org/ftp/tridge/dbench/dbench-3.04.tar.gz def setup(self, tarball = 'dbench-3.04.tar.gz'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/tiobench/tiobench.py b/client/tests/tiobench/tiobench.py index 8a4d5ba6..2f3b0407 100644 --- a/client/tests/tiobench/tiobench.py +++ b/client/tests/tiobench/tiobench.py @@ -8,8 +8,7 @@ class tiobench(test.test): # http://prdownloads.sourceforge.net/tiobench/tiobench-0.3.3.tar.gz def setup(self, tarball = 'tiobench-0.3.3.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/tsc/tsc.py b/client/tests/tsc/tsc.py index 54941f8b..6e7ca640 100755 --- a/client/tests/tsc/tsc.py +++ b/client/tests/tsc/tsc.py @@ -6,8 +6,7 @@ class tsc(test.test): version = 1 def setup(self, tarball = 'checktsc.tar'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) utils.system('make') diff --git a/client/tests/unixbench/unixbench.py b/client/tests/unixbench/unixbench.py index 001ce666..abdfc4f5 100755 --- a/client/tests/unixbench/unixbench.py +++ b/client/tests/unixbench/unixbench.py @@ -8,8 +8,7 @@ class unixbench(test.test): # http://www.tux.org/pub/tux/niemi/unixbench/unixbench-4.1.0.tgz def setup(self, tarball = 'unixbench-4.1.0.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) diff --git a/client/tests/xmtest/xmtest.py b/client/tests/xmtest/xmtest.py index e9216332..1f1c08d2 100644 --- a/client/tests/xmtest/xmtest.py +++ b/client/tests/xmtest/xmtest.py @@ -18,8 +18,7 @@ class xmtest(test.test): # cd tools # tar -czf xm-test.tgz xm-test def setup(self, tarball = 'xm-test.tar.bz2'): - tarball = utils.unmap_url(self.bindir, tarball, - self.tmpdir) + tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) autotest_utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) |