summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-06-05 16:19:07 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-06-05 16:19:07 +0000
commit971b31dc127e78212342ae2c83f5643ccde4b53f (patch)
treefc3c97d3504bbaf64be37b23f8644399986922c9
parent52532987d5532d2ecdac06c996761e6c6e261d06 (diff)
Risk: Required at this point
Visibilty: Under the hood Here is an update to all public tests adding imports where they were missing and removing import * Signed-off-by: Scott Zawalski <scottz@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1605 592f7852-d20e-0410-864c-8624ca9c26a4
-rwxr-xr-xclient/tests/aborttest/aborttest.py4
-rw-r--r--client/tests/aio_dio_bugs/aio_dio_bugs.py15
-rwxr-xr-xclient/tests/aiostress/aiostress.py17
-rw-r--r--client/tests/barriertest/barriertest.py4
-rwxr-xr-xclient/tests/bonnie/bonnie.py20
-rw-r--r--client/tests/btreplay/btreplay.py34
-rw-r--r--client/tests/cpu_hotplug/cpu_hotplug.py28
-rwxr-xr-xclient/tests/cyclictest/cyclictest.py9
-rw-r--r--client/tests/dacapo/dacapo.py28
-rw-r--r--client/tests/dbt2/dbt2.py44
-rwxr-xr-xclient/tests/disktest/disktest.py21
-rw-r--r--client/tests/fio/fio.py18
-rw-r--r--client/tests/fs_mark/fs_mark.py15
-rwxr-xr-xclient/tests/fsfuzzer/fsfuzzer.py16
-rw-r--r--client/tests/fsstress/fsstress.py19
-rwxr-xr-xclient/tests/fsx/fsx.py21
-rw-r--r--client/tests/interbench/interbench.py16
-rw-r--r--client/tests/iozone/iozone.py24
-rw-r--r--client/tests/isic/isic.py18
-rwxr-xr-xclient/tests/kernbench/kernbench.py3
-rwxr-xr-xclient/tests/kernelbuild/kernelbuild.py4
-rw-r--r--client/tests/kvmtest/kvmtest.py24
-rw-r--r--client/tests/libhugetlbfs/libhugetlbfs.py13
-rwxr-xr-xclient/tests/linus_stress/linus_stress.py20
-rwxr-xr-xclient/tests/lmbench/lmbench.py18
-rw-r--r--client/tests/lsb_dtk/lsb_dtk.py31
-rwxr-xr-xclient/tests/ltp/ltp.py3
-rwxr-xr-xclient/tests/netperf2/netperf2.py16
-rwxr-xr-xclient/tests/parallel_dd/parallel_dd.py17
-rw-r--r--client/tests/pi_tests/pi_tests.py14
-rwxr-xr-xclient/tests/pktgen/pktgen.py13
-rwxr-xr-xclient/tests/posixtest/posixtest.py19
-rwxr-xr-xclient/tests/raisetest/raisetest.py7
-rwxr-xr-xclient/tests/reaim/reaim.py28
-rw-r--r--client/tests/rmaptest/rmaptest.py10
-rw-r--r--client/tests/rtlinuxtests/rtlinuxtests.py15
-rw-r--r--client/tests/rttester/rttester.py12
-rw-r--r--client/tests/scrashme/scrashme.py17
-rw-r--r--client/tests/selftest/selftest.py9
-rw-r--r--client/tests/signaltest/signaltest.py9
-rw-r--r--client/tests/sleeptest/control7
-rwxr-xr-xclient/tests/sleeptest/sleeptest.py4
-rwxr-xr-xclient/tests/sparse/sparse.py15
-rwxr-xr-xclient/tests/spew/spew.py17
-rw-r--r--client/tests/stress/stress.py19
-rw-r--r--client/tests/sysbench/sysbench.py53
-rwxr-xr-xclient/tests/tbench/tbench.py17
-rw-r--r--client/tests/tiobench/tiobench.py17
-rwxr-xr-xclient/tests/tsc/tsc.py14
-rwxr-xr-xclient/tests/unixbench/unixbench.py21
-rw-r--r--client/tests/xmtest/xmtest.py20
51 files changed, 487 insertions, 390 deletions
diff --git a/client/tests/aborttest/aborttest.py b/client/tests/aborttest/aborttest.py
index 5131cd19..44ceb178 100755
--- a/client/tests/aborttest/aborttest.py
+++ b/client/tests/aborttest/aborttest.py
@@ -1,5 +1,5 @@
-from autotest.client.common_lib import error
-from autotest_client.bin import test
+from autotest_lib.client.common_lib import error
+from autotest_lib.client.bin import test
class aborttest(test.test):
version = 1
diff --git a/client/tests/aio_dio_bugs/aio_dio_bugs.py b/client/tests/aio_dio_bugs/aio_dio_bugs.py
index 7c54b396..44611f98 100644
--- a/client/tests/aio_dio_bugs/aio_dio_bugs.py
+++ b/client/tests/aio_dio_bugs/aio_dio_bugs.py
@@ -1,5 +1,7 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
# tests is a simple array of "cmd" "arguments"
tests = [["aio-dio-invalidate-failure", "poo"],
@@ -23,15 +25,16 @@ class aio_dio_bugs(test.test):
def setup(self):
os.chdir(self.srcdir)
- system('make ' + '"CFLAGS=' + self.gcc_flags + '"')
+ utils.system('make ' + '"CFLAGS=' + self.gcc_flags + '"')
def execute(self, args = ''):
os.chdir(self.tmpdir)
- libs = self.autodir+'/deps/libaio/lib/'
- ld_path = prepend_path(libs, environ('LD_LIBRARY_PATH'))
+ libs = self.autodir + '/deps/libaio/lib/'
+ ld_path = autotest_utils.prepend_path(libs,
+ environ('LD_LIBRARY_PATH'))
var_ld_path = 'LD_LIBRARY_PATH=' + ld_path
for test in tests:
cmd = self.srcdir + '/' + test[name] + ' ' \
+ args + ' ' + test[arglist]
- system(var_ld_path + ' ' + cmd)
+ utils.system(var_ld_path + ' ' + cmd)
diff --git a/client/tests/aiostress/aiostress.py b/client/tests/aiostress/aiostress.py
index e200b527..2ef13760 100755
--- a/client/tests/aiostress/aiostress.py
+++ b/client/tests/aiostress/aiostress.py
@@ -4,8 +4,9 @@
# NOTE - this should also have the ability to mount a filesystem,
# run the tests, unmount it, then fsck the filesystem
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class aiostress(test.test):
version = 2
@@ -22,22 +23,24 @@ class aiostress(test.test):
print self.srcdir, self.bindir, self.tmpdir
os.mkdir(self.srcdir)
os.chdir(self.srcdir)
- system('cp ' + self.bindir+'/aio-stress.c .')
+ utils.system('cp ' + self.bindir+'/aio-stress.c .')
os.chdir(self.srcdir)
self.gcc_flags += ' -Wall -lpthread -laio'
- system('gcc ' + self.gcc_flags + ' aio-stress.c -o aio-stress')
+ cmd = 'gcc ' + self.gcc_flags + ' aio-stress.c -o aio-stress'
+ utils.system(cmd)
def execute(self, args = ''):
os.chdir(self.tmpdir)
libs = self.autodir+'/deps/libaio/lib/'
- ld_path = prepend_path(libs, environ('LD_LIBRARY_PATH'))
+ ld_path = autotest_utils.prepend_path(libs,
+ environ('LD_LIBRARY_PATH'))
var_ld_path = 'LD_LIBRARY_PATH=' + ld_path
cmd = self.srcdir + '/aio-stress ' + args + ' poo'
profilers = self.job.profilers
if not profilers.only():
- system(var_ld_path + ' ' + cmd)
+ utils.system(var_ld_path + ' ' + cmd)
report = open(self.debugdir + '/stderr')
keyval = open(self.resultsdir + '/keyval', 'w')
_format_results(report, keyval)
@@ -45,7 +48,7 @@ class aiostress(test.test):
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system(var_ld_path + ' ' + cmd)
+ utils.system(var_ld_path + ' ' + cmd)
profilers.stop(self)
profilers.report(self)
if profilers.only():
diff --git a/client/tests/barriertest/barriertest.py b/client/tests/barriertest/barriertest.py
index 859b0ad6..cf890ad4 100644
--- a/client/tests/barriertest/barriertest.py
+++ b/client/tests/barriertest/barriertest.py
@@ -1,5 +1,5 @@
-import test, time
-from autotest_utils import *
+import time
+from autotest_utils.client.bin import test
class barriertest(test.test):
version = 1
diff --git a/client/tests/bonnie/bonnie.py b/client/tests/bonnie/bonnie.py
index 85405ef8..f7302aff 100755
--- a/client/tests/bonnie/bonnie.py
+++ b/client/tests/bonnie/bonnie.py
@@ -1,5 +1,5 @@
-import test, os_dep
-from autotest_utils import *
+import autotest_lib.client.bin import test, os_dep, autotest_utils
+import autotest_lib.client.common_lib import utils
def convert_size(values):
@@ -28,13 +28,14 @@ class bonnie(test.test):
# http://www.coker.com.au/bonnie++/bonnie++-1.03a.tgz
def setup(self, tarball = 'bonnie++-1.03a.tgz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
os_dep.command('g++')
- system('./configure')
- system('make')
+ utils.system('./configure')
+ utils.system('make')
def execute(self, testdir = None, iterations = 1, extra_args = '', user = 'root'):
if not testdir:
@@ -46,13 +47,14 @@ class bonnie(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- results.append(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(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 36b6b719..439a2131 100644
--- a/client/tests/btreplay/btreplay.py
+++ b/client/tests/btreplay/btreplay.py
@@ -1,14 +1,16 @@
-import test, os_dep
import time
-from autotest_utils import *
+from autotest_lib.client.bin import test, os_dep, autotest_utils
+from autotest_lib.client.common_lib import error, utils
+
class btreplay(test.test):
version = 1
# http://brick.kernel.dk/snaps/blktrace-git-latest.tar.gz
def setup(self, tarball = 'blktrace-git-latest.tar.gz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['libaio'])
libs = '-L' + self.autodir + '/deps/libaio/lib -laio'
@@ -18,8 +20,8 @@ class btreplay(test.test):
self.make_flags = var_libs + ' ' + var_cflags
os.chdir(self.srcdir)
- system('patch -p1 < ../Makefile.patch')
- system(self.make_flags + ' make')
+ utils.system('patch -p1 < ../Makefile.patch')
+ utils.system(self.make_flags + ' make')
def initialize(self):
@@ -35,33 +37,33 @@ class btreplay(test.test):
# convert the trace (assumed to be in this test's base
# directory) into btreplay's required format
- system("./btreplay/btrecord -d .. -D "+tmpdir+" "+dev)
+ utils.system("./btreplay/btrecord -d .. -D "+tmpdir+" "+dev)
# time a replay that omits "thinktime" between requests
# (by use of the -N flag)
- 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
- system("./blktrace -D "+tmpdir+" "+alldevs+" >/dev/null &")
- system(self.ldlib+" ./btreplay/btreplay -d "+tmpdir+" -W "+\
+ utils.system("./blktrace -D "+tmpdir+" "+alldevs+" >/dev/null &")
+ utils.system(self.ldlib+" ./btreplay/btreplay -d "+tmpdir+" -W "+\
dev+" "+extra_args)
- system("killall -INT blktrace")
+ utils.system("killall -INT blktrace")
# wait until blktrace is really done
slept = 0.0
- while system("ps -C blktrace > /dev/null",
+ while utils.system("ps -C blktrace > /dev/null",
ignore_status=True) == 0:
time.sleep(0.1)
slept += 0.1
if slept > 30.0:
- system("killall -9 blktrace")
- raise TestError("blktrace failed to exit after 30 seconds")
- system("./blkparse -q -D "+tmpdir+" -d "+tmpdir+\
+ 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")
- system("./btt/btt -i "+tmpdir+"/trace.bin")
+ utils.system("./btt/btt -i "+tmpdir+"/trace.bin")
def execute(self, iterations = 1, dev="", devices="",
extra_args = '', tmpdir = None):
diff --git a/client/tests/cpu_hotplug/cpu_hotplug.py b/client/tests/cpu_hotplug/cpu_hotplug.py
index 26d750fa..ed55bb8a 100644
--- a/client/tests/cpu_hotplug/cpu_hotplug.py
+++ b/client/tests/cpu_hotplug/cpu_hotplug.py
@@ -1,44 +1,46 @@
-import test, time
-from autotest_utils import *
+import time
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
class cpu_hotplug(test.test):
version = 2
# http://developer.osdl.org/dev/hotplug/tests/lhcs_regression-1.6.tgz
def setup(self, tarball = 'lhcs_regression-1.6.tgz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
def execute(self):
# Check if the kernel supports cpu hotplug
if running_config():
- check_for_kernel_feature('HOTPLUG_CPU')
+ autotest_utils.check_for_kernel_feature('HOTPLUG_CPU')
# Check cpu nums, if equals 1, quit.
- if count_cpus() == 1:
+ if autotest_utils.count_cpus() == 1:
print 'Just only single cpu online, quiting...'
sys.exit()
# Have a simple and quick check first, FIX me please.
- system('dmesg -c > /dev/null')
+ utils.system('dmesg -c > /dev/null')
for cpu in cpu_online_map():
if os.path.isfile('/sys/devices/system/cpu/cpu%s/online' % cpu):
- system('echo 0 > /sys/devices/system/cpu/cpu%s/online' % cpu, 1)
- system('dmesg -c')
+ utils.system('echo 0 > /sys/devices/system/cpu/cpu%s/online' % cpu, 1)
+ utils.system('dmesg -c'
time.sleep(3)
- system('echo 1 > /sys/devices/system/cpu/cpu%s/online' % cpu, 1)
- system('dmesg -c')
+ utils.system('echo 1 > /sys/devices/system/cpu/cpu%s/online' % cpu, 1
+ utils.system('dmesg -c'
time.sleep(3)
# Begin this cpu hotplug test big guru.
os.chdir(self.srcdir)
profilers = self.job.profilers
if not profilers.only():
- system('./runtests.sh')
+ utils.system('./runtests.sh')
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system('./runtests.sh')
+ utils.system('./runtests.sh')
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/cyclictest/cyclictest.py b/client/tests/cyclictest/cyclictest.py
index 0b353e7a..95a6416f 100755
--- a/client/tests/cyclictest/cyclictest.py
+++ b/client/tests/cyclictest/cyclictest.py
@@ -1,5 +1,6 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test
+from autotest_lib.client.common_lib import utils
+
class cyclictest(test.test):
version = 2
@@ -9,7 +10,7 @@ class cyclictest(test.test):
def setup(self):
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, args = '-t 10 -l 100000'):
- system(self.srcdir + '/cyclictest ' + args)
+ utils.system(self.srcdir + '/cyclictest ' + args)
diff --git a/client/tests/dacapo/dacapo.py b/client/tests/dacapo/dacapo.py
index d9f681cb..7d3c8c88 100644
--- a/client/tests/dacapo/dacapo.py
+++ b/client/tests/dacapo/dacapo.py
@@ -7,11 +7,11 @@
# institutions, as part of the DaCapo research project, which was funded by a
# National Science Foundation ITR Grant, CCR-0085792.
#
-import test
import os
-import package
-from autotest_utils import *
-from test_config import config_loader
+from autotest_lib.client.bin import autotest_utils, package
+from autotest_lib.client.bin.test_config import config_loader
+from autotest_lib.client.common_lib import utils
+
class dacapo(test.test):
version = 1
@@ -56,26 +56,28 @@ class dacapo(test.test):
else:
self.dacapo_url = my_config.get('dacapo', 'tarball_url_alt')
if not self.dacapo_url:
- raise TestError('Could not read dacapo URL from conf file')
+ raise error.TestError('Could not read dacapo URL from conf file')
# We can cache the dacapo package file if we take some
# precautions (checking md5 sum of the downloaded file)
self.dacapo_md5 = my_config.get('dacapo', 'package_md5')
if not self.dacapo_md5:
e_msg = 'Could not read dacapo package md5sum from conf file'
- raise TestError(e_msg)
+ raise error.TestError(e_msg)
self.dacapo_pkg = \
- unmap_url_cache(self.cachedir, self.dacapo_url, self.dacapo_md5)
+ autotest_utils.unmap_url_cache(self.cachedir, self.dacapo_url,
+ self.dacapo_md5)
# Get jvm package URL
self.jvm_pkg_url = my_config.get(jvm, 'jvm_pkg_url')
if not self.jvm_pkg_url:
- raise TestError('Could not read java vm URL from conf file')
+ raise error.TestError('Could not read java vm URL from conf file')
# Let's cache the jvm package as well
self.jvm_pkg_md5 = my_config.get(jvm, 'package_md5')
if not self.jvm_pkg_md5:
- raise TestError('Could not read java package_md5 from conf file')
+ raise error.TestError('Could not read java package_md5 from conf file')
self.jvm_pkg = \
- unmap_url_cache(self.cachedir, self.jvm_pkg_url, self.jvm_pkg_md5)
+ autotest_utils.unmap_url_cache(self.cachedir, self.jvm_pkg_url,
+ self.jvm_pkg_md5)
# Install the jvm pakage
package.install(self.jvm_pkg)
@@ -83,7 +85,7 @@ class dacapo(test.test):
# Basic Java environment variables setup
self.java_root = my_config.get(jvm, 'java_root')
if not self.java_root:
- raise TestError('Could not read java root dir from conf file')
+ raise error.TestError('Could not read java root dir from conf file')
self.set_java_environment(jvm, self.java_root)
# If use_global is set to 'yes', then we want to use the global
@@ -104,9 +106,9 @@ class dacapo(test.test):
+ self.iterations + test
# Execute the actual test
try:
- system('java -jar %s %s' % (self.dacapo_pkg, self.args))
+ utils.system('java -jar %s %s' % (self.dacapo_pkg, self.args))
except:
e_msg = \
'Test %s has failed, command line options "%s"' % (test, self.args)
- raise TestError(e_msg)
+ raise error.TestError(e_msg)
diff --git a/client/tests/dbt2/dbt2.py b/client/tests/dbt2/dbt2.py
index 5c970c11..945768fe 100644
--- a/client/tests/dbt2/dbt2.py
+++ b/client/tests/dbt2/dbt2.py
@@ -1,5 +1,6 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+
# Dbt-2 is a fair-use implementation of the TPC-C benchmark. The test is
# currently hardcoded to use PostgreSQL but the kit also supports MySQL.
@@ -9,33 +10,34 @@ 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 = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['pgsql', 'pgpool', 'mysql'])
#
# Extract one copy of the kit for MySQL.
#
- system('cp -pR ' + self.srcdir + ' ' + self.srcdir + '.mysql')
+ utils.system('cp -pR ' + self.srcdir + ' ' + self.srcdir + '.mysql')
os.chdir(self.srcdir + '.mysql')
- system('./configure --with-mysql=%s/deps/mysql/mysql' \
+ utils.system('./configure --with-mysql=%s/deps/mysql/mysql' \
% self.autodir)
- system('make')
+ utils.system('make')
#
# Extract one copy of the kit for PostgreSQL.
#
- system('cp -pR ' + self.srcdir + ' ' + self.srcdir + '.pgsql')
+ utils.system('cp -pR ' + self.srcdir + ' ' + self.srcdir + '.pgsql')
os.chdir(self.srcdir + '.pgsql')
- system('./configure --with-postgresql=%s/deps/pgsql/pgsql' \
+ utils.system('./configure --with-postgresql=%s/deps/pgsql/pgsql' \
% self.autodir)
- system('make')
+ utils.system('make')
# Create symlinks to autotest's results directory from dbt-2's
# preferred results directory to self.resultsdir
- system('ln -s %s %s' % (self.resultsdir, \
+ utils.system('ln -s %s %s' % (self.resultsdir, \
self.srcdir + '.mysql/scripts/output'))
- system('ln -s %s %s' % (self.resultsdir, \
+ utils.system('ln -s %s %s' % (self.resultsdir, \
self.srcdir + '.pgsql/scripts/output'))
def execute(self, db_type, args = ''):
@@ -50,22 +52,22 @@ class dbt2(test.test):
def execute_mysql(self, args = ''):
args = args
- system(self.srcdir + '.mysql/scripts/mysql/build_db.sh -g -w 1')
- system(self.srcdir + '.mysql/scripts/run_workload.sh ' + args)
+ utils.system(self.srcdir + '.mysql/scripts/mysql/build_db.sh -g -w 1')
+ utils.system(self.srcdir + '.mysql/scripts/run_workload.sh ' + args
def execute_pgpool(self, args = ''):
- system('%s/deps/pgpool/pgpool/bin/pgpool -f %s/../pgpool.conf' \
+ utils.system('%s/deps/pgpool/pgpool/bin/pgpool -f %s/../pgpool.conf' \
% (self.autodir, self.srcdir))
self.execute_pgsql(args)
- system('%s/deps/pgpool/pgpool/bin/pgpool stop' % self.autodir)
+ utils.system('%s/deps/pgpool/pgpool/bin/pgpool stop' % self.autodir)
def execute_pgsql(self, args = ''):
- system(self.srcdir + '.pgsql/scripts/pgsql/build_db.sh -g -w 1')
- system(self.srcdir + '.pgsql/scripts/run_workload.sh ' + args)
+ utils.system(self.srcdir + '.pgsql/scripts/pgsql/build_db.sh -g -w 1')
+ utils.system(self.srcdir + '.pgsql/scripts/run_workload.sh ' + args)
#
# Clean up by dropping the database after the test.
#
- system(self.srcdir + '.pgsql/scripts/pgsql/start_db.sh')
- system(self.srcdir + '.pgsql/scripts/pgsql/drop_db.sh')
- system(self.srcdir + '.pgsql/scripts/pgsql/stop_db.sh')
+ utils.system(self.srcdir + '.pgsql/scripts/pgsql/start_db.sh')
+ utils.system(self.srcdir + '.pgsql/scripts/pgsql/drop_db.sh')
+ utils.system(self.srcdir + '.pgsql/scripts/pgsql/stop_db.sh')
diff --git a/client/tests/disktest/disktest.py b/client/tests/disktest/disktest.py
index 85c2997b..400cf902 100755
--- a/client/tests/disktest/disktest.py
+++ b/client/tests/disktest/disktest.py
@@ -1,7 +1,8 @@
-import test
-from autotest_utils import *
import os, sys
-from subprocess import *
+import subprocess
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils, errors
+
class disktest(test.test):
version = 1
@@ -9,10 +10,10 @@ class disktest(test.test):
def setup(self):
os.mkdir(self.srcdir)
os.chdir(self.bindir)
- system('cp disktest.c src/')
+ utils.system('cp disktest.c src/')
os.chdir(self.srcdir)
cflags = '-D_FILE_OFFSET_BITS=64 -D _GNU_SOURCE -static -Wall'
- system('cc disktest.c ' + cflags + ' -o disktest')
+ utils.system('cc disktest.c ' + cflags + ' -o disktest')
def test_one_disk_chunk(self, disk, chunk):
@@ -20,7 +21,7 @@ class disktest(test.test):
(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)
- p = Popen(cmd, shell=True)
+ p = subprocess.Popen(cmd, shell=True)
return(p.pid)
@@ -33,16 +34,16 @@ class disktest(test.test):
if not gigabytes:
free = 100 # cap it at 100GB by default
for disk in disks:
- free = min(freespace(disk) / 1024**3, free)
+ free = min(autotest_utils.freespace(disk) / 1024**3, free)
gigabytes = free
print "resizing to %s GB" % gigabytes
sys.stdout.flush()
self.chunk_mb = chunk_mb
- self.memory_mb = memtotal()/1024
+ self.memory_mb = autotest_utils.memtotal()/1024
if self.memory_mb > chunk_mb:
e_msg = "Too much RAM (%dMB) for this test to work" % self.memory_mb
- raise TestError(e_msg)
+ raise error.TestError(e_msg)
chunks = (1024 * gigabytes) / chunk_mb
@@ -57,5 +58,5 @@ class disktest(test.test):
if (retval != 0):
errors.append(retval)
if errors:
- raise TestError("Errors from children: %s" % errors)
+ raise error.TestError("Errors from children: %s" % errors)
diff --git a/client/tests/fio/fio.py b/client/tests/fio/fio.py
index 86c3b91e..6cfc0654 100644
--- a/client/tests/fio/fio.py
+++ b/client/tests/fio/fio.py
@@ -1,13 +1,15 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test
+from autotest_lib.client.common_lib import utils
+
class fio(test.test):
version = 2
# http://brick.kernel.dk/snaps/fio-1.16.5.tar.bz2
def setup(self, tarball = 'fio-1.16.5.tar.bz2'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['libaio'])
ldflags = '-L' + self.autodir + '/deps/libaio/lib'
@@ -16,8 +18,8 @@ class fio(test.test):
var_cflags = 'CFLAGS="' + cflags + '"'
os.chdir(self.srcdir)
- system('patch -p1 < ../Makefile.patch')
- system('%s %s make' % (var_ldflags, var_cflags))
+ utils.system('patch -p1 < ../Makefile.patch')
+ utils.system('%s %s make' % (var_ldflags, var_cflags))
def execute(self, args = '', user = 'root'):
os.chdir(self.srcdir)
@@ -25,12 +27,12 @@ class fio(test.test):
vars = 'LD_LIBRARY_PATH="' + self.autodir + '/deps/libaio/lib"'
##args = '-m -o ' + self.resultsdir + '/fio-tio.log ' + self.srcdir + '/examples/tiobench-example';
args = '--output ' + self.resultsdir + '/fio-mixed.log ' + self.bindir + '/fio-mixed.job';
- system(vars + ' ./fio ' + args)
+ util.system(vars + ' ./fio ' + args)
# Do a profiling run if necessary
profilers = self.job.profilers
if profilers.present():
profilers.start(self)
- system(vars + ' ./fio ' + args)
+ util.system(vars + ' ./fio ' + args)
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/fs_mark/fs_mark.py b/client/tests/fs_mark/fs_mark.py
index eb69875d..cc3c69db 100644
--- a/client/tests/fs_mark/fs_mark.py
+++ b/client/tests/fs_mark/fs_mark.py
@@ -1,16 +1,17 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+
class fs_mark(test.test):
version = 1
# http://developer.osdl.org/dev/doubt/fs_mark/archive/fs_mark-3.2.tgz
def setup(self, tarball = 'fs_mark-3.2.tgz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, dir, iterations = 2, args = None):
os.chdir(self.srcdir)
@@ -20,11 +21,11 @@ class fs_mark(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- system('./fs_mark -d %s %s' %(dir, args))
+ utils.system('./fs_mark -d %s %s' %(dir, args))
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system('./fs_mark -d %s %s' %(dir, args))
+ utils.system('./fs_mark -d %s %s' %(dir, args))
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/fsfuzzer/fsfuzzer.py b/client/tests/fsfuzzer/fsfuzzer.py
index a39f25ed..5abda511 100755
--- a/client/tests/fsfuzzer/fsfuzzer.py
+++ b/client/tests/fsfuzzer/fsfuzzer.py
@@ -1,27 +1,29 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.bin import utils
+
class fsfuzzer(test.test):
version = 1
# http://people.redhat.com/sgrubb/files/fsfuzzer-0.6.tar.gz
def setup(self, tarball = 'fsfuzzer-0.6.tar.gz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, iterations = 1, fstype = 'iso9660'):
profilers = self.job.profilers
args = fstype + ' 1'
if not profilers.only():
for i in range(iterations):
- system(self.srcdir + '/run_test ' + args)
+ utils.system(self.srcdir + '/run_test ' + args)
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system(self.srcdir + '/run_test ' + args)
+ utils.system(self.srcdir + '/run_test ' + args)
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/fsstress/fsstress.py b/client/tests/fsstress/fsstress.py
index 314ca3f4..87c6f145 100644
--- a/client/tests/fsstress/fsstress.py
+++ b/client/tests/fsstress/fsstress.py
@@ -1,17 +1,20 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
+
class fsstress(test.test):
version = 1
# http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz
def setup(self, tarball = 'ext3-tools.tar.gz'):
- self.tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(self.tarball, self.srcdir)
+ self.tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
- system('patch -p1 < ../fsstress-ltp.patch')
- system('make fsstress')
+ utils.system('patch -p1 < ../fsstress-ltp.patch')
+ utils.system('make fsstress')
def execute(self, testdir = None, extra_args = '', nproc = '1000', nops = '1000'):
@@ -23,11 +26,11 @@ class fsstress(test.test):
cmd = self.srcdir + '/fsstress ' + args
profilers = self.job.profilers
if not profilers.only():
- system(cmd)
+ utils.system(cmd)
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system(cmd)
+ utils.system(cmd)
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/fsx/fsx.py b/client/tests/fsx/fsx.py
index a688cb21..df4db709 100755
--- a/client/tests/fsx/fsx.py
+++ b/client/tests/fsx/fsx.py
@@ -4,16 +4,18 @@
# NOTE - this should also have the ability to mount a filesystem,
# run the tests, unmount it, then fsck the filesystem
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class fsx(test.test):
version = 3
# http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz
def setup(self, tarball = 'ext3-tools.tar.gz'):
- self.tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(self.tarball, self.srcdir)
+ self.tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autoetst_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
self.job.setup_dep(['libaio'])
ldflags = '-L' + self.autodir + '/deps/libaio/lib'
@@ -23,8 +25,8 @@ class fsx(test.test):
self.make_flags = var_ldflags + ' ' + var_cflags
os.chdir(self.srcdir)
- system('patch -p1 < ../fsx-linux.diff')
- system(self.make_flags + ' make fsx-linux')
+ utils.system('patch -p1 < ../fsx-linux.diff')
+ utils.system(self.make_flags + ' make fsx-linux')
def execute(self, testdir = None, repeat = '100000'):
@@ -33,16 +35,17 @@ class fsx(test.test):
testdir = self.tmpdir
os.chdir(testdir)
libs = self.autodir+'/deps/libaio/lib/'
- ld_path = prepend_path(libs, environ('LD_LIBRARY_PATH'))
+ ld_path = autotest_utils.prepend_path(libs,
+ environ('LD_LIBRARY_PATH'))
var_ld_path = 'LD_LIBRARY_PATH=' + ld_path
cmd = self.srcdir + '/fsx-linux ' + args + ' poo'
profilers = self.job.profilers
if not profilers.only():
- system(var_ld_path + ' ' + cmd)
+ utils.system(var_ld_path + ' ' + cmd)
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system(var_ld_path + ' ' + cmd)
+ utils.system(var_ld_path + ' ' + cmd)
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/interbench/interbench.py b/client/tests/interbench/interbench.py
index 38c615b5..60b1d802 100644
--- a/client/tests/interbench/interbench.py
+++ b/client/tests/interbench/interbench.py
@@ -1,16 +1,18 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class interbench(test.test):
version = 1
# 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 = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, iterations = 1, args = ''):
os.chdir(self.tmpdir)
@@ -19,13 +21,13 @@ class interbench(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- system("%s/interbench -m 'run #%s' %s" % \
+ utils.system("%s/interbench -m 'run #%s' %s" % \
(self.srcdir, i, args))
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system("%s/interbench -m 'profile run' %s" % \
+ utils.system("%s/interbench -m 'profile run' %s" % \
(self.srcdir, args))
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/iozone/iozone.py b/client/tests/iozone/iozone.py
index c3d61f83..9cd705e0 100644
--- a/client/tests/iozone/iozone.py
+++ b/client/tests/iozone/iozone.py
@@ -1,26 +1,28 @@
#!/usr/bin/python
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
-import test
-from autotest_utils import *
class iozone(test.test):
version = 1
# http://www.iozone.org/src/current/iozone3_283.tar
def setup(self, tarball = 'iozone3_283.tar'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_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'))
- arch = get_current_kernel_arch()
+ arch = autotest_utils.get_current_kernel_arch()
if (arch == 'ppc'):
- system('make linux-powerpc')
+ utils.system('make linux-powerpc')
elif (arch == 'ppc64'):
- system('make linux-powerpc64')
+ utils.system('make linux-powerpc64')
elif (arch == 'x86_64'):
- system('make linux-AMD64')
+ utils.system('make linux-AMD64')
else:
- system('make linux')
+ utils.system('make linux')
def execute(self, dir = None, iterations=1, args = None):
@@ -34,14 +36,14 @@ class iozone(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- output = system_output('%s/src/current/iozone %s' %
+ output = utils.system_output('%s/src/current/iozone %s' %
(self.srcdir, args))
self.__format_results(output)
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- output = system_output('%s/src/current/iozone %s' %
+ output = utils.system_output('%s/src/current/iozone %s' %
(self.srcdir, args))
self.__format_results(output)
profilers.stop(self)
diff --git a/client/tests/isic/isic.py b/client/tests/isic/isic.py
index 40cac997..a9af20fe 100644
--- a/client/tests/isic/isic.py
+++ b/client/tests/isic/isic.py
@@ -1,5 +1,6 @@
-import test, os_dep
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class isic(test.test):
version = 2
@@ -11,13 +12,14 @@ class isic(test.test):
self.job.setup_dep(['libnet'])
def setup(self, tarball = 'isic-0.06.tar.bz2'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('patch -p1 < ../build-fixes.patch')
- system('PREFIX=' + self.autodir + '/deps/libnet/libnet/ ./configure')
- system('make')
+ utils.system('patch -p1 < ../build-fixes.patch')
+ utils.system('PREFIX=' + self.autodir + '/deps/libnet/libnet/ ./configure')
+ utils.system('make')
def execute(self, args = '-s rand -d 127.0.0.1 -p 10000000'):
- system(self.srcdir + '/isic ' + args)
+ utils.system(self.srcdir + '/isic ' + args)
diff --git a/client/tests/kernbench/kernbench.py b/client/tests/kernbench/kernbench.py
index 8e8695b8..8abf6a36 100755
--- a/client/tests/kernbench/kernbench.py
+++ b/client/tests/kernbench/kernbench.py
@@ -1,6 +1,5 @@
import re, pickle, os
-import test
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import autotest_utils, test
from autotest_lib.client.common_lib import utils
diff --git a/client/tests/kernelbuild/kernelbuild.py b/client/tests/kernelbuild/kernelbuild.py
index a4dccbe5..95b639a2 100755
--- a/client/tests/kernelbuild/kernelbuild.py
+++ b/client/tests/kernelbuild/kernelbuild.py
@@ -1,5 +1,5 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, kernel
+
class kernelbuild(test.test):
version = 1
diff --git a/client/tests/kvmtest/kvmtest.py b/client/tests/kvmtest/kvmtest.py
index 5bbf91db..4cabe697 100644
--- a/client/tests/kvmtest/kvmtest.py
+++ b/client/tests/kvmtest/kvmtest.py
@@ -1,15 +1,17 @@
-import test
-import random
-from autotest_utils import *
+import random, os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils, error
+
class kvmtest(test.test):
version = 1
def setup(self, tarball = 'kvm-test.tar.gz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('python setup.py install')
+ utils.system('python setup.py install')
def execute(self, testdir = '', args = ''):
@@ -36,7 +38,7 @@ class kvmtest(test.test):
logfile = replaydir + "/%s.log" %(os.path.basename(d))
os.chdir(d)
- rv = system("kvm-test-replay > %s" %(logfile), 1)
+ rv = utils.system("kvm-test-replay > %s" %(logfile), 1)
results.append((d, rv))
if rv != 0:
@@ -46,10 +48,10 @@ class kvmtest(test.test):
dest = os.path.join(replaydir,expected)
# make a copy of the screen shot
- system("cp %s %s" %(screenshot, dest), 1)
+ utils.system("cp %s %s" %(screenshot, dest), 1)
# move the failure
- system("mv failure-*.png %s" %(replaydir), 1)
+ utils.system("mv failure-*.png %s" %(replaydir), 1)
# generate html output
self.__format_results(results)
@@ -66,7 +68,7 @@ class kvmtest(test.test):
print("Summary: Passed %d Failed %d" %(passed, failed))
# if we had any tests not passed, fail entire test
if failed != 0:
- raise TestError('kvm-test-replay')
+ raise error.TestError('kvm-test-replay')
def __get_expected_file(self, logfile):
@@ -97,7 +99,7 @@ class kvmtest(test.test):
# return the display whack existing server first, then spawn it
vncdisplay = "1"
print("Spawning vncserver on port %s"%(vncdisplay))
- system('vncserver :%s' %(vncdisplay))
+ utils.system('vncserver :%s' %(vncdisplay))
return ':%s.0' %(vncdisplay)
diff --git a/client/tests/libhugetlbfs/libhugetlbfs.py b/client/tests/libhugetlbfs/libhugetlbfs.py
index 78c4b9d8..dcab973b 100644
--- a/client/tests/libhugetlbfs/libhugetlbfs.py
+++ b/client/tests/libhugetlbfs/libhugetlbfs.py
@@ -1,13 +1,14 @@
-import test, re, os
-from autotest_lib.client.bin import autotest_utils
-from autotest_lib.client.common_lib import utils
+import re, os
+from autotest_lib.client.bin import autotest_utils, tests
+from autotest_lib.client.common_lib import utils, error
class libhugetlbfs(test.test):
version = 4
# 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 = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
@@ -28,10 +29,10 @@ class libhugetlbfs(test.test):
str(pages_requested))
pages_available = int(open('/proc/sys/vm/nr_hugepages', 'r').readline())
else:
- raise TestNAError('Kernel does not support hugepages')
+ raise error.TestNAError('Kernel does not support hugepages')
if pages_available < pages_requested:
- raise TestError('%d huge pages available, < %d pages requested' % (pages_available, pages_requested))
+ raise error.TestError('%d huge pages available, < %d pages requested' % (pages_available, pages_requested))
# Check if hugetlbfs has been mounted
if not autotest_utils.file_contains_pattern('/proc/mounts', 'hugetlbfs'):
diff --git a/client/tests/linus_stress/linus_stress.py b/client/tests/linus_stress/linus_stress.py
index 9c19fd45..6532668e 100755
--- a/client/tests/linus_stress/linus_stress.py
+++ b/client/tests/linus_stress/linus_stress.py
@@ -1,5 +1,7 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class linus_stress(test.test):
version = 1
@@ -7,9 +9,9 @@ class linus_stress(test.test):
def setup(self):
os.mkdir(self.srcdir)
os.chdir(self.bindir)
- system('cp linus_stress.c src/')
+ utils.system('cp linus_stress.c src/')
os.chdir(self.srcdir)
- system('cc linus_stress.c -D_POSIX_C_SOURCE=200112 -o linus_stress')
+ utils.system('cc linus_stress.c -D_POSIX_C_SOURCE=200112 -o linus_stress')
def run_the_test(self, iterations):
@@ -24,7 +26,7 @@ class linus_stress(test.test):
profilers.start(self)
for i in range(iterations):
- system(cmd + ' ' + args)
+ utils.system(cmd + ' ' + args)
if profilers.present():
profilers.stop(self)
@@ -32,10 +34,10 @@ class linus_stress(test.test):
def execute(self, iterations = 1):
- dirty_ratio = read_one_line('/proc/sys/vm/dirty_ratio')
- dirty_background_ratio = read_one_line('/proc/sys/vm/dirty_background_ratio')
+ dirty_ratio = autotest_utils.read_one_line('/proc/sys/vm/dirty_ratio')
+ dirty_background_ratio = autotest_utils.read_one_line('/proc/sys/vm/dirty_background_ratio')
try:
self.run_the_test(iterations)
finally:
- write_one_line('/proc/sys/vm/dirty_ratio', dirty_ratio)
- write_one_line('/proc/sys/vm/dirty_background_ratio', dirty_background_ratio)
+ autotest_utils.write_one_line('/proc/sys/vm/dirty_ratio', dirty_ratio)
+ autotest_utils.write_one_line('/proc/sys/vm/dirty_background_ratio', dirty_background_ratio)
diff --git a/client/tests/lmbench/lmbench.py b/client/tests/lmbench/lmbench.py
index c63c7798..cf225867 100755
--- a/client/tests/lmbench/lmbench.py
+++ b/client/tests/lmbench/lmbench.py
@@ -1,20 +1,22 @@
# This will need more work on the configuration stuff before it will function
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class lmbench(test.test):
version = 2
def setup(self, tarball = 'lmbench3.tar.bz2'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
# http://www.bitmover.com/lm/lmbench/lmbench3.tar.gz
# + lmbench3.diff
# removes Makefile references to bitkeeper
# default mail to no, fix job placement defaults (masouds)
- extract_tarball_to_dir(tarball, self.srcdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, iterations = 1, mem = '', fastmem = 'NO',
@@ -31,15 +33,15 @@ class lmbench(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- system(cmd)
+ utils.system(cmd)
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system(cmd)
+ utils.system(cmd)
profilers.stop(self)
profilers.report(self)
# Get the results:
outputdir = self.srcdir + "/results"
results = self.resultsdir + "/summary.txt"
- system("make -C " + outputdir + " summary > " + results)
+ utils.system("make -C " + outputdir + " summary > " + results)
diff --git a/client/tests/lsb_dtk/lsb_dtk.py b/client/tests/lsb_dtk/lsb_dtk.py
index 648293cf..6cdbfe23 100644
--- a/client/tests/lsb_dtk/lsb_dtk.py
+++ b/client/tests/lsb_dtk/lsb_dtk.py
@@ -1,11 +1,10 @@
# Wrapper to LSB testsuite
# Copyright 2008, IBM Corp.
-import test
-import os
-import package
-import glob
-from autotest_utils import *
-from test_config import config_loader
+import os, glob
+from autotest_lib.client.bin import test, autotest_utils, package
+from autotest_lib.client.bin.test_config import config_loader
+from autotest_lib.client.common_lib import utils, error
+
__author__ = '''
pnaregun@in.ibm.com (Pavan Naregundi)
@@ -15,7 +14,7 @@ lucasmr@br.ibm.com (Lucas Meneghel Rodrigues)
class lsb_dtk(test.test):
version = 1
def get_lsb_arch(self):
- self.arch = get_current_kernel_arch()
+ self.arch = autotest_utils.get_current_kernel_arch()
if self.arch in ['i386', 'i486', 'i586', 'i686', 'athlon']:
return 'ia32'
elif self.arch == 'ppc':
@@ -24,7 +23,7 @@ class lsb_dtk(test.test):
return self.arch
else:
e_msg = 'Architecture %s not supported by LSB' % self.arch
- raise TestError(e_msg)
+ raise error.TestError(e_msg)
def install_lsb_packages(self, srcdir, cachedir, my_config):
@@ -32,13 +31,13 @@ class lsb_dtk(test.test):
self.dtk_manager_arch = my_config.get('dtk-manager', 'arch-%s' % self.get_lsb_arch())
self.dtk_manager_url = my_config.get('dtk-manager', 'tarball_url') % self.dtk_manager_arch
if not self.dtk_manager_url:
- raise TestError('Could not get DTK manager URL from configuration file')
+ raise error.TestError('Could not get DTK manager URL from configuration file')
self.dtk_md5 = my_config.get('dtk-manager', 'md5-%s' % self.get_lsb_arch())
if self.dtk_md5:
print 'Caching LSB DTK manager RPM'
- self.dtk_manager_pkg = unmap_url_cache(cachedir, self.dtk_manager_url, self.dtk_md5)
+ self.dtk_manager_pkg = autotest_utils.unmap_url_cache(cachedir, self.dtk_manager_url, self.dtk_md5)
else:
- raise TestError('Could not find DTK manager package md5, cannot cache DTK manager tarball')
+ raise error.TestError('Could not find DTK manager package md5, cannot cache DTK manager tarball')
# Get LSB tarball, cache it and uncompress under autotest srcdir
if my_config.get('lsb', 'override_default_url') == 'no':
@@ -51,11 +50,11 @@ class lsb_dtk(test.test):
self.lsb_md5 = my_config.get('lsb', self.md5_key)
if self.lsb_md5:
print 'Caching LSB tarball'
- self.lsb_pkg = unmap_url_cache(self.cachedir, self.lsb_url, self.lsb_md5)
+ self.lsb_pkg = autotest_utils.unmap_url_cache(self.cachedir, self.lsb_url, self.lsb_md5)
else:
- raise TestError('Could not find LSB package md5, cannot cache LSB tarball')
+ raise error.TestError('Could not find LSB package md5, cannot cache LSB tarball')
- extract_tarball_to_dir(self.lsb_pkg, srcdir)
+ autotest_utils.extract_tarball_to_dir(self.lsb_pkg, srcdir)
# Lets load a file that contains the list of RPMs
os.chdir(srcdir)
@@ -84,7 +83,7 @@ class lsb_dtk(test.test):
self.distro_type = 'debian-based'
else:
e_msg = 'Package conversion not supported. Cannot handle LSB package installation'
- raise EnvironmentError()
+ raise EnvironmentError(e_msg)
elif distro_pkg_support['rpm']:
print 'Red Hat based distro detected'
self.distro_type = 'redhat-based'
@@ -160,7 +159,7 @@ class lsb_dtk(test.test):
if profilers.present():
profilers.start(self)
print 'Executing LSB main test script'
- system(cmd)
+ utils.system(cmd)
if profilers.present():
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/ltp/ltp.py b/client/tests/ltp/ltp.py
index ab79f9c1..98535b81 100755
--- a/client/tests/ltp/ltp.py
+++ b/client/tests/ltp/ltp.py
@@ -1,6 +1,5 @@
import os
-import test
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import autotest_utils, test
from autotest_lib.client.common_lib import utils
class ltp(test.test):
diff --git a/client/tests/netperf2/netperf2.py b/client/tests/netperf2/netperf2.py
index 65e5cdde..8555b45d 100755
--- a/client/tests/netperf2/netperf2.py
+++ b/client/tests/netperf2/netperf2.py
@@ -1,17 +1,19 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils, error
+
class netperf2(test.test):
version = 1
# ftp://ftp.netperf.org/netperf/netperf-2.4.1.tar.gz
def setup(self, tarball = 'netperf-2.4.1.tar.gz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('./configure')
- system('make')
+ utils.system('./configure')
+ utils.system('make')
def initialize(self):
@@ -45,7 +47,7 @@ class netperf2(test.test):
self.client(script, server_ip, args)
job.barrier(client_tag, 'stop', 30).rendevous(*all)
else:
- raise UnhandledError('invalid role specified')
+ raise error.UnhandledError('invalid role specified')
def server_start(self):
diff --git a/client/tests/parallel_dd/parallel_dd.py b/client/tests/parallel_dd/parallel_dd.py
index 2c06d737..ddc941a7 100755
--- a/client/tests/parallel_dd/parallel_dd.py
+++ b/client/tests/parallel_dd/parallel_dd.py
@@ -1,7 +1,7 @@
-import test
-from autotest_utils import *
-import re, time
-from subprocess import *
+import re, time, subprocess
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class parallel_dd(test.test):
version = 1
@@ -13,7 +13,7 @@ class parallel_dd(test.test):
dd = 'dd if=/dev/zero of=%s bs=4K count=%d' % \
(self.fs.device, self.blocks)
print dd
- system(dd + ' > /dev/null')
+ utils.system(dd + ' > /dev/null')
def raw_read(self):
@@ -22,7 +22,7 @@ class parallel_dd(test.test):
dd = 'dd if=%s of=/dev/null bs=4K count=%d' % \
(self.fs.device, self.blocks)
print dd
- system(dd + ' > /dev/null')
+ utils.system(dd + ' > /dev/null')
def fs_write(self):
@@ -34,7 +34,8 @@ 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(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):
@@ -50,7 +51,7 @@ class parallel_dd(test.test):
file = os.path.join(self.job.tmpdir, 'poo%d' % (i+1))
dd = 'dd if=%s of=/dev/null bs=4K count=%d' % \
(file, self.blocks_per_file)
- system(dd + ' > /dev/null')
+ utils.system(dd + ' > /dev/null')
def test(self, tag):
diff --git a/client/tests/pi_tests/pi_tests.py b/client/tests/pi_tests/pi_tests.py
index 67064b91..d7bd56c8 100644
--- a/client/tests/pi_tests/pi_tests.py
+++ b/client/tests/pi_tests/pi_tests.py
@@ -1,5 +1,6 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class pi_tests(test.test):
version = 1
@@ -8,12 +9,13 @@ class pi_tests(test.test):
def setup(self, tarball = 'pi_tests.tar.bz2'):
check_glibc_ver('2.5')
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, args = '1 300'):
os.chdir(self.srcdir)
- system('./start.sh ' + args)
+ utils.system('./start.sh ' + args)
diff --git a/client/tests/pktgen/pktgen.py b/client/tests/pktgen/pktgen.py
index c5183bbd..5cc5e5f4 100755
--- a/client/tests/pktgen/pktgen.py
+++ b/client/tests/pktgen/pktgen.py
@@ -1,5 +1,6 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils, error
+
class pktgen(test.test):
version = 1
@@ -7,9 +8,9 @@ class pktgen(test.test):
def execute(self, eth='eth0', count=50000, clone_skb=1, \
dst_ip='192.168.210.210', dst_mac='01:02:03:04:05:07'):
if not os.path.exists('/proc/net/pktgen'):
- system('/sbin/modprobe pktgen')
+ utils.system('/sbin/modprobe pktgen')
if not os.path.exists('/proc/net/pktgen'):
- raise UnhandledError('pktgen not loaded')
+ raise error.UnhandledError('pktgen not loaded')
print 'Adding devices to run'
self.pgdev = '/proc/net/pktgen/kpktgend_0'
@@ -37,7 +38,7 @@ class pktgen(test.test):
self.pgset('start')
output = os.path.join(self.resultsdir, eth)
- system ('cp %s %s' % (self.ethdev, output))
+ utils.system ('cp %s %s' % (self.ethdev, output))
def pgset(self, command):
@@ -47,6 +48,6 @@ class pktgen(test.test):
if not grep('Result: OK', self.pgdev):
if not grep('Result: NA', self.pgdev):
- system('cat ' + self.pgdev)
+ utils.system('cat ' + self.pgdev)
# raise UnhandledError('Result not OK')
diff --git a/client/tests/posixtest/posixtest.py b/client/tests/posixtest/posixtest.py
index 09f9ee20..9eb15aa9 100755
--- a/client/tests/posixtest/posixtest.py
+++ b/client/tests/posixtest/posixtest.py
@@ -1,7 +1,9 @@
# POSIX test suite wrapper class. More information about the suite can be found
# at http://posixtest.sourceforge.net/
-import test, os
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
__author__ = '''mohd.omar@in.ibm.com (Mohammed Omar)'''
@@ -9,16 +11,19 @@ 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 = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(self.posix_tarball, self.srcdir)
+ self.posix_tarball = autotest_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
- system('patch -p1 < ../posix-linux.patch')
- system('make')
+ utils.system('patch -p1 < ../posix-linux.patch')
+ utils.system('make')
def execute(self):
os.chdir(self.srcdir)
- system('./run_tests THR')
+ utils.system('./run_tests THR')
diff --git a/client/tests/raisetest/raisetest.py b/client/tests/raisetest/raisetest.py
index 63f9b8d3..1c968b4b 100755
--- a/client/tests/raisetest/raisetest.py
+++ b/client/tests/raisetest/raisetest.py
@@ -1,8 +1,9 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test
+from autotest_lib.client.common_lib import error
+
class raisetest(test.test):
version = 1
def execute(self):
- raise TestError('Arrrrrrrrggggh. You are DOOOMED')
+ raise error.TestError('Arrrrrrrrggggh. You are DOOOMED')
diff --git a/client/tests/reaim/reaim.py b/client/tests/reaim/reaim.py
index b37c0fb7..51815f93 100755
--- a/client/tests/reaim/reaim.py
+++ b/client/tests/reaim/reaim.py
@@ -1,14 +1,17 @@
# Needs autoconf & automake & libtool to be installed. Ewwwwwwwwwwwwwwwwwwwwww
-import test, os_dep, re
-from autotest_utils import *
+import re, os
+from autotest_lib.client.bin import test, autotest_utils, os_dep
+from autotest_lib.client.common_lib import utils
+
class reaim(test.test):
version = 1
# 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 = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['libaio'])
libs = '-L' + self.autodir + '/deps/libaio/lib -laio'
@@ -19,15 +22,15 @@ class reaim(test.test):
os_dep.commands('autoconf', 'automake', 'libtoolize')
os.chdir(self.srcdir)
- system('./bootstrap')
- system('./configure')
+ utils.system('./bootstrap')
+ utils.system('./configure')
# we can't use patch here, as the Makefile is autogenerated
# so we can't tell exactly what it looks like.
# Perform some foul in-place sed hackery instead.
for file in ('Makefile', 'src/Makefile'):
- system('sed -i "s/^CFLAGS =/CFLAGS +=/" ' + file)
- system('sed -i "s/^LIBS =/LIBS +=/" ' + file)
- system(self.make_flags + ' make')
+ utils.system('sed -i "s/^CFLAGS =/CFLAGS +=/" ' + file)
+ utils.system('sed -i "s/^LIBS =/LIBS +=/" ' + file)
+ utils.system(self.make_flags + ' make')
os.rename('src/reaim', 'reaim')
@@ -48,7 +51,7 @@ class reaim(test.test):
workfile = os.path.join('data', workfile)
args = "-f %s -s %d -e %d -i %d" %(workfile,start,end,increment)
config = os.path.join(self.srcdir, 'reaim.config')
- system('cp -f %s/reaim.config %s' % (self.bindir, config))
+ utils.system('cp -f %s/reaim.config %s' % (self.bindir, config))
args += ' -c ./reaim.config'
open(config, 'a+').write("DISKDIR %s\n" % (tmpdir))
os.chdir(self.srcdir)
@@ -60,13 +63,14 @@ class reaim(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- results.append(system_output(cmd,
+ results.append(utils.system_output(cmd,
retain_output=True))
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- resuls.append(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 9b745a6b..f4cf3af1 100644
--- a/client/tests/rmaptest/rmaptest.py
+++ b/client/tests/rmaptest/rmaptest.py
@@ -1,5 +1,7 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test
+from autotest_lib.client.common_lib import utils
+
# tests is a simple array of "cmd" "arguments"
tests = [["rmaptest", "-h -i100 -n100 -s100 -t100 -V10 -v file1.dat"],
@@ -15,7 +17,7 @@ class rmaptest(test.test):
def setup(self):
os.chdir(self.srcdir)
- system('gcc -Wall -o rmaptest rmap-test.c')
+ utils.system('gcc -Wall -o rmaptest rmap-test.c')
def execute(self, args = ''):
@@ -23,4 +25,4 @@ class rmaptest(test.test):
for test in tests:
cmd = self.srcdir + '/' + test[name] + ' ' \
+ args + ' ' + test[arglist]
- system(cmd)
+ utils.system(cmd)
diff --git a/client/tests/rtlinuxtests/rtlinuxtests.py b/client/tests/rtlinuxtests/rtlinuxtests.py
index 41ade38a..bafb24df 100644
--- a/client/tests/rtlinuxtests/rtlinuxtests.py
+++ b/client/tests/rtlinuxtests/rtlinuxtests.py
@@ -1,5 +1,7 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
# tests is a simple array of "cmd" "arguments"
tests = [["./run.sh", "tests=func"],
@@ -16,13 +18,14 @@ class rtlinuxtests(test.test):
def setup(self, tarball = 'tests.tar.bz2'):
check_glibc_ver('2.5')
- self.tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(self.tarball, self.srcdir)
+ self.tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
- system('patch -p1 < ../path-fix.patch')
+ utils.system('patch -p1 < ../path-fix.patch')
def execute(self, args = ''):
os.chdir(self.srcdir)
for test in tests:
cmd = 'echo y | ' + test[name] + ' ' + args + ' ' + test[arglist]
- system(cmd)
+ utils.system(cmd)
diff --git a/client/tests/rttester/rttester.py b/client/tests/rttester/rttester.py
index 2e4330b7..b3c96525 100644
--- a/client/tests/rttester/rttester.py
+++ b/client/tests/rttester/rttester.py
@@ -1,5 +1,6 @@
-import test, os_dep
-from autotest_utils import *
+from autotest_lib.client.bin import test, autotest_utils, os_dep
+from autotest_lib.client.common_lib import utils
+
class rttester(test.test):
version = 1
@@ -7,9 +8,10 @@ class rttester(test.test):
# http://www.stardust.webpages.pl/files/patches/autotest/rttester.tar.bz2
def setup(self, tarball = 'rttester.tar.bz2'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
def execute(self):
os.chdir(self.srcdir)
- system(self.srcdir + '/check-all.sh')
+ utils.system(self.srcdir + '/check-all.sh')
diff --git a/client/tests/scrashme/scrashme.py b/client/tests/scrashme/scrashme.py
index 75d72e4e..7c7dd1e9 100644
--- a/client/tests/scrashme/scrashme.py
+++ b/client/tests/scrashme/scrashme.py
@@ -1,16 +1,19 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class scrashme(test.test):
version = 1
# 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 = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, iterations = 1, args_list = ''):
if len(args_list) != 0:
@@ -21,11 +24,11 @@ class scrashme(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- system(self.srcdir + '/scrashme ' + args)
+ utils.system(self.srcdir + '/scrashme ' + args)
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system(self.srcdir + '/scrashme ' + args)
+ utils.system(self.srcdir + '/scrashme ' + args)
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/selftest/selftest.py b/client/tests/selftest/selftest.py
index 877c364d..1baecf9a 100644
--- a/client/tests/selftest/selftest.py
+++ b/client/tests/selftest/selftest.py
@@ -1,6 +1,7 @@
-import test
-from autotest_utils import *
-from common.error import *
+import os
+from autotest_lib.client.bin import test
+from autotest_lib.client.common_lib import error
+
class selftest(test.test):
version = 1
@@ -28,7 +29,7 @@ class selftest(test.test):
print "checkpoint %d %d" % (current, checkpoint)
if (current != checkpoint):
- raise JobError("selftest: sequence was " +
+ raise error.JobError("selftest: sequence was " +
"%d when %d expected" % (current, checkpoint))
def __throw(self):
diff --git a/client/tests/signaltest/signaltest.py b/client/tests/signaltest/signaltest.py
index 9b8ed3c9..c0b22ff0 100644
--- a/client/tests/signaltest/signaltest.py
+++ b/client/tests/signaltest/signaltest.py
@@ -1,5 +1,6 @@
-import test
-from autotest_utils import *
+from autotest_lib.client.bin import test
+from autotest_lib.client.common_lib import utils
+
class signaltest(test.test):
version = 1
@@ -9,7 +10,7 @@ class signaltest(test.test):
def setup(self):
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, args = '-t 10 -l 100000'):
- system(self.srcdir + '/signaltest ' + args)
+ utils.system(self.srcdir + '/signaltest ' + args)
diff --git a/client/tests/sleeptest/control b/client/tests/sleeptest/control
index 07fd7552..a26d74f8 100644
--- a/client/tests/sleeptest/control
+++ b/client/tests/sleeptest/control
@@ -1,4 +1,9 @@
-TIME="SHORT"
+AUTHOR = "Autotest Team"
+NAME = "Sleeptest"
+TIME = "SHORT"
+TEST_CATEGORY = "Functional"
+TEST_CLASS = "General"
+TEST_TYPE = "client"
DOC = """
This test simply sleeps for 1 second. It's a good way to test profilers and
diff --git a/client/tests/sleeptest/sleeptest.py b/client/tests/sleeptest/sleeptest.py
index 6c5df713..76c03831 100755
--- a/client/tests/sleeptest/sleeptest.py
+++ b/client/tests/sleeptest/sleeptest.py
@@ -1,5 +1,5 @@
-import test, time
-from autotest_utils import *
+import time
+from autotest_lib.client.bin import test
class sleeptest(test.test):
version = 1
diff --git a/client/tests/sparse/sparse.py b/client/tests/sparse/sparse.py
index 3d61d13d..6f31b624 100755
--- a/client/tests/sparse/sparse.py
+++ b/client/tests/sparse/sparse.py
@@ -1,17 +1,20 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils, kernel
+from autotest_lib.client.common_lib import utils
+
class sparse(test.test):
version = 1
# 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 = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
- system('ln check sparse')
+ utils.system('make')
+ utils.system('ln check sparse')
self.top_dir = self.job.tmpdir+'/sparse'
diff --git a/client/tests/spew/spew.py b/client/tests/spew/spew.py
index 59c41969..cf12136e 100755
--- a/client/tests/spew/spew.py
+++ b/client/tests/spew/spew.py
@@ -1,17 +1,20 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class spew(test.test):
version = 1
# 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 = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(self.tarball, self.srcdir)
+ self.tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
- system('./configure')
- system('make')
+ utils.system('./configure')
+ utils.system('make')
def execute(self, testdir = None, iterations = 1, filesize='100M', type='write', pattern='random'):
@@ -32,7 +35,7 @@ class spew(test.test):
open(self.resultsdir + '/command', 'w').write(cmd + '\n')
self.job.stdout.redirect(results)
try:
- system(cmd)
+ utils.system(cmd)
finally:
self.job.stdout.restore()
diff --git a/client/tests/stress/stress.py b/client/tests/stress/stress.py
index 915e7680..d5120b86 100644
--- a/client/tests/stress/stress.py
+++ b/client/tests/stress/stress.py
@@ -1,17 +1,20 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class stress(test.test):
version = 1
# http://weather.ou.edu/~apw/projects/stress/stress-0.18.8.tar.gz
def setup(self, tarball = 'stress-0.18.8.tar.gz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('./configure')
- system('make')
+ utils.system('./configure')
+ utils.system('make')
def execute(self, iterations = 1, args = ''):
@@ -23,12 +26,12 @@ class stress(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- system(self.srcdir + '/src/stress ' + args)
+ utils.system(self.srcdir + '/src/stress ' + args)
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system(self.srcdir + '/src/stress ' + args)
+ utils.system(self.srcdir + '/src/stress ' + args)
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/sysbench/sysbench.py b/client/tests/sysbench/sysbench.py
index 219b0082..7a19745f 100644
--- a/client/tests/sysbench/sysbench.py
+++ b/client/tests/sysbench/sysbench.py
@@ -1,13 +1,16 @@
-import test, time, re, pwd
-from autotest_utils import *
+import time, re, pwd
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class sysbench(test.test):
version = 1
# http://osdn.dl.sourceforge.net/sourceforge/sysbench/sysbench-0.4.8.tar.gz
def setup(self, tarball = 'sysbench-0.4.8.tar.bz2'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['pgsql', 'mysql'])
os.chdir(self.srcdir)
@@ -16,8 +19,8 @@ class sysbench(test.test):
mysql_dir = os.path.join(self.autodir, 'deps/mysql/mysql')
# configure wants to get at pg_config, so add its path
- system('PATH=%s/bin:$PATH ./configure --with-mysql=%s --with-pgsql' % (pgsql_dir, mysql_dir))
- system('make -j %d' % count_cpus())
+ utils.system('PATH=%s/bin:$PATH ./configure --with-mysql=%s --with-pgsql' % (pgsql_dir, mysql_dir))
+ utils.system('make -j %d' % count_cpus())
def execute(self, db_type = 'pgsql', build = 1, \
@@ -36,7 +39,7 @@ class sysbench(test.test):
# Check for nobody user
try:
- system(self.sudo + '/bin/true')
+ utils.system(self.sudo + '/bin/true')
except:
raise TestError('Unable to run as nobody')
@@ -54,14 +57,14 @@ class sysbench(test.test):
log = os.path.join(self.debugdir, 'pgsql.log')
if build == 1:
- system('rm -rf ' + data)
+ utils.system('rm -rf ' + data)
os.mkdir(data)
os.chown(data, self.dbuid, 0)
- system(self.sudo + bin + '/initdb -D ' + data)
+ utils.system(self.sudo + bin + '/initdb -D ' + data)
# Database must be able to write its output into debugdir
os.chown(self.debugdir, self.dbuid, 0)
- system(self.sudo + bin + '/pg_ctl -D ' + data + \
+ utils.system(self.sudo + bin + '/pg_ctl -D ' + data + \
' -l ' + log + ' start')
# Wait for database to start
@@ -73,9 +76,9 @@ class sysbench(test.test):
'--pgsql-user=' + self.dbuser
if build == 1:
- system(self.sudo + bin + '/createdb sbtest')
+ utils.system(self.sudo + bin + '/createdb sbtest')
cmd = base_cmd +' prepare'
- system(cmd)
+ utils.system(cmd)
cmd = base_cmd + \
' --num-threads=' + str(num_threads) + \
@@ -89,22 +92,22 @@ class sysbench(test.test):
profilers = self.job.profilers
if not profilers.only():
- results.append(system_output(cmd + ' run',
+ results.append(utils.system_output(cmd + ' run',
retain_output=True))
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
results.append("Profiling run ...")
- results.append(system_output(cmd + ' run',
+ results.append(utils.system_output(cmd + ' run',
retain_output=True))
profilers.stop(self)
profilers.report(self)
except:
- system(self.sudo + bin + '/pg_ctl -D ' + data + ' stop')
+ utils.system(self.sudo + bin + '/pg_ctl -D ' + data + ' stop')
raise
- system(self.sudo + bin + '/pg_ctl -D ' + data + ' stop')
+ utils.system(self.sudo + bin + '/pg_ctl -D ' + data + ' stop')
self.__format_results("\n".join(results))
@@ -115,12 +118,12 @@ class sysbench(test.test):
log = os.path.join(self.debugdir, 'mysql.log')
if build == 1:
- system('rm -rf ' + data)
+ utils.system('rm -rf ' + data)
os.mkdir(data)
os.chown(data, self.dbuid, 0)
- system(bin + '/mysql_install_db --user=' + self.dbuser)
+ utils.system(bin + '/mysql_install_db --user=' + self.dbuser)
- system(bin + '/mysqld_safe --log-error=' + log + \
+ utils.system(bin + '/mysqld_safe --log-error=' + log + \
' --user=' + self.dbuser + ' &')
# Wait for database to start
@@ -132,10 +135,10 @@ class sysbench(test.test):
'--mysql-user=root'
if build == 1:
- system('echo "create database sbtest" | ' + \
+ utils.system('echo "create database sbtest" | ' + \
bin + '/mysql -u root')
cmd = base_cmd +' prepare'
- system(cmd)
+ utils.system(cmd)
cmd = base_cmd + \
' --num-threads=' + str(num_threads) + \
@@ -149,22 +152,22 @@ class sysbench(test.test):
profilers = self.job.profilers
if not profilers.only():
- results.append(system_output(cmd + ' run',
+ results.append(utils.system_output(cmd + ' run',
retain_output=True))
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
results.append("Profiling run ...")
- results.append(system_output(cmd + ' run',
+ results.append(utils.system_output(cmd + ' run',
retain_output=True))
profilers.stop(self)
profilers.report(self)
except:
- system(bin + '/mysqladmin shutdown')
+ utils.system(bin + '/mysqladmin shutdown')
raise
- system(bin + '/mysqladmin shutdown')
+ utils.system(bin + '/mysqladmin shutdown')
self.__format_results("\n".join(results))
diff --git a/client/tests/tbench/tbench.py b/client/tests/tbench/tbench.py
index 62a06890..7e2fd390 100755
--- a/client/tests/tbench/tbench.py
+++ b/client/tests/tbench/tbench.py
@@ -1,17 +1,20 @@
-import test,time,os,signal
-from autotest_utils import *
+import time, os, signal, re
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class tbench(test.test):
version = 2
# http://samba.org/ftp/tridge/dbench/dbench-3.04.tar.gz
def setup(self, tarball = 'dbench-3.04.tar.gz'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('./configure')
- system('make')
+ utils.system('./configure')
+ utils.system('make')
def execute(self, iterations = 1, nprocs = None, args = ''):
# only supports combined server+client model at the moment
@@ -42,7 +45,7 @@ class tbench(test.test):
client = self.srcdir + '/client.txt'
args = '-c ' + client + ' ' + '%s' % args
cmd = os.path.join(self.srcdir, "tbench") + " " + args
- results = system_output(cmd, retain_output=True)
+ results = utils.system_output(cmd, retain_output=True)
os.kill(pid, signal.SIGTERM) # clean up the server
else: # child
server = self.srcdir + '/tbench_srv'
diff --git a/client/tests/tiobench/tiobench.py b/client/tests/tiobench/tiobench.py
index c082528a..cd7c165e 100644
--- a/client/tests/tiobench/tiobench.py
+++ b/client/tests/tiobench/tiobench.py
@@ -1,16 +1,19 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
+
class tiobench(test.test):
version = 1
# http://prdownloads.sourceforge.net/tiobench/tiobench-0.3.3.tar.gz
def setup(self, tarball = 'tiobench-0.3.3.tar.bz2'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, dir = None, iterations=1, args = None):
if not dir:
@@ -21,12 +24,12 @@ class tiobench(test.test):
profilers = self.job.profilers
if not profilers.only():
for i in range(iterations):
- system('./tiobench.pl --dir %s %s' %(dir, args))
+ utils.system('./tiobench.pl --dir %s %s' %(dir, args))
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system('./tiobench.pl --dir %s %s' %(dir, args))
+ utils.system('./tiobench.pl --dir %s %s' %(dir, args))
profilers.stop(self)
profilers.report(self)
diff --git a/client/tests/tsc/tsc.py b/client/tests/tsc/tsc.py
index 45bcdee0..6476eb98 100755
--- a/client/tests/tsc/tsc.py
+++ b/client/tests/tsc/tsc.py
@@ -1,16 +1,18 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
class tsc(test.test):
version = 1
def setup(self, tarball = 'checktsc.tar'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('make')
+ utils.system('make')
def execute(self, iterations = 1, args = ''):
for i in range(iterations):
- system(self.srcdir + '/checktsc ' + args)
+ utils.system(self.srcdir + '/checktsc ' + args)
diff --git a/client/tests/unixbench/unixbench.py b/client/tests/unixbench/unixbench.py
index 4dc380ef..6d8c810e 100755
--- a/client/tests/unixbench/unixbench.py
+++ b/client/tests/unixbench/unixbench.py
@@ -1,17 +1,20 @@
-import test
-from autotest_utils import *
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils, error
+
class unixbench(test.test):
version = 2
# http://www.tux.org/pub/tux/niemi/unixbench/unixbench-4.1.0.tgz
def setup(self, tarball = 'unixbench-4.1.0.tar.bz2'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('patch -p1 < ../unixbench.patch')
- system('make')
+ utils.system('patch -p1 < ../unixbench.patch')
+ utils.system('make')
def execute(self, iterations = 1, args = '', stepsecs=0):
@@ -29,20 +32,20 @@ class unixbench(test.test):
if not profilers.only():
for i in range(iterations):
os.chdir(self.srcdir)
- system(vars + ' ./Run ' + args)
+ utils.system(vars + ' ./Run ' + args)
report = open(self.resultsdir + '/report')
self.format_results(report, keyval)
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- system(vars + ' ./Run ' + args)
+ utils.system(vars + ' ./Run ' + args)
profilers.stop(self)
profilers.report(self)
# check err string and possible throw
if self.err != None:
- raise TestError(self.err)
+ raise error.TestError(self.err)
def check_for_error(self, words):
diff --git a/client/tests/xmtest/xmtest.py b/client/tests/xmtest/xmtest.py
index d4327523..e8b2b69c 100644
--- a/client/tests/xmtest/xmtest.py
+++ b/client/tests/xmtest/xmtest.py
@@ -3,9 +3,10 @@
# Description:
# Autotest script for running Xen xm-test
# This should be run from a Xen domain0
+import os
+from autotest_lib.client.bin import test, autotest_utils
+from autotest_lib.client.common_lib import utils
-import test
-from autotest_utils import *
class xmtest(test.test):
version = 1
@@ -17,15 +18,16 @@ class xmtest(test.test):
# cd tools
# tar -czf xm-test.tgz xm-test
def setup(self, tarball = 'xm-test.tar.bz2'):
- tarball = unmap_url(self.bindir, tarball, self.tmpdir)
- extract_tarball_to_dir(tarball, self.srcdir)
+ tarball = autotest_utils.unmap_url(self.bindir, tarball,
+ self.tmpdir)
+ autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
- system('./autogen')
- system('./configure')
- system('make existing')
+ utils.system('./autogen')
+ utils.system('./configure')
+ utils.system('make existing')
def execute(self, args = ''):
os.chdir(self.srcdir)
- system('./runtest.sh ' + args)
- system('mv xmtest.* ' + self.resultsdir)
+ utils.system('./runtest.sh ' + args)
+ utils.system('mv xmtest.* ' + self.resultsdir)