Rename autotest_utils to utils
Fixes longstanding hangover ugliness from the original change away
from doing "from autotest_utils import *".
Signed-off-by: Martin J. Bligh <[email protected]>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2595 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/base_sysinfo.py b/client/bin/base_sysinfo.py
index f1ff36a..d84be2e 100644
--- a/client/bin/base_sysinfo.py
+++ b/client/bin/base_sysinfo.py
@@ -1,7 +1,7 @@
import os, shutil, re, glob, subprocess
-from autotest_lib.client.common_lib import utils, log
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.common_lib import log
+from autotest_lib.client.bin import utils
_DEFAULT_COMMANDS_TO_LOG_PER_TEST = []
@@ -276,7 +276,7 @@
keyval["sysinfo-memtotal-in-kb"] = match.group(1)
# guess the system's total physical memory, including sys tables
- keyval["sysinfo-phys-mbytes"] = autotest_utils.rounded_memtotal()//1024
+ keyval["sysinfo-phys-mbytes"] = utils.rounded_memtotal()//1024
# return what we collected
return keyval
diff --git a/client/bin/cpuset.py b/client/bin/cpuset.py
index e7aa0b1..99131dd 100644
--- a/client/bin/cpuset.py
+++ b/client/bin/cpuset.py
@@ -1,8 +1,8 @@
__author__ = """Copyright Google, Peter Dahl, Martin J. Bligh 2007"""
import os, sys, re, glob, math
-from autotest_lib.client.bin import autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import utils
+from autotest_lib.client.common_lib import error
super_root = "/dev/cpuset"
@@ -69,12 +69,12 @@
def mbytes_per_mem_node():
# Get mbyte size of each numa mem node, as float
- # Replaces autotest_utils.node_size().
+ # Replaces utils.node_size().
# Based on guessed total physical mem size, not on kernel's
# lesser 'available memory' after various system tables.
# Can be non-integer when kernel sets up 15 nodes instead of 16.
- nodecnt = len(autotest_utils.numa_nodes())
- return autotest_utils.rounded_memtotal() / (nodecnt * 1024.0)
+ nodecnt = len(utils.numa_nodes())
+ return utils.rounded_memtotal() / (nodecnt * 1024.0)
def get_cpus(container_full_name):
@@ -102,7 +102,7 @@
memtotal = node_size_ * len(rangelist_to_list(mems))
tasks = ','.join(get_tasks(dir))
print "cpuset %s: size %s; tasks %s; cpus %s; mems %s" % \
- (name, autotest_utils.human_format(memtotal), tasks, cpus, mems)
+ (name, utils.human_format(memtotal), tasks, cpus, mems)
def print_all_cpusets():
diff --git a/client/bin/fsdev_disks.py b/client/bin/fsdev_disks.py
index 40ad707..ade1825 100644
--- a/client/bin/fsdev_disks.py
+++ b/client/bin/fsdev_disks.py
@@ -1,7 +1,7 @@
import sys, os, re, string
-from autotest_lib.client.bin import autotest_utils, fsinfo, fsdev_mgr
-from autotest_lib.client.common_lib import error, utils
+from autotest_lib.client.bin import utils, fsinfo, fsdev_mgr
+from autotest_lib.client.common_lib import error
import partition
@@ -198,7 +198,7 @@
disk["fs_opts"] = fs_mnt_opt
# Try to wipe the file system slate clean
- autotest_utils.drop_caches()
+ utils.drop_caches()
# XXX(gps): Remove this code once refactoring is complete to get rid of these
diff --git a/client/bin/harness_ABAT.py b/client/bin/harness_ABAT.py
index 8e22f98..91d3f1e 100755
--- a/client/bin/harness_ABAT.py
+++ b/client/bin/harness_ABAT.py
@@ -5,8 +5,7 @@
__author__ = """Copyright Andy Whitcroft 2006"""
-from autotest_lib.client.bin import autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import utils
import os, harness, time, re
def autobench_load(fn):
@@ -117,7 +116,7 @@
# For RedHat installs we do not load up the module.conf
# as they cannot be builtin. Pass them as arguments.
- vendor = autotest_utils.get_os_vendor()
+ vendor = utils.get_os_vendor()
if vendor in ['Red Hat', 'Fedora Core'] and 'modules' in conf:
args = '--allow-missing'
for mod in conf['modules']:
diff --git a/client/bin/job.py b/client/bin/job.py
index 25be95e..f82a54c 100755
--- a/client/bin/job.py
+++ b/client/bin/job.py
@@ -7,18 +7,17 @@
import copy, os, platform, re, shutil, sys, time, traceback, types
import cPickle as pickle
-from autotest_lib.client.bin import autotest_utils, parallel, kernel, xen
+from autotest_lib.client.bin import utils, parallel, kernel, xen
from autotest_lib.client.bin import profilers, fd_stack, boottool, harness
from autotest_lib.client.bin import config, sysinfo, cpuset, test, partition
-from autotest_lib.client.common_lib import error, barrier, log, utils
+from autotest_lib.client.common_lib import error, barrier, log
from autotest_lib.client.common_lib import packages, debug
LAST_BOOT_TAG = object()
NO_DEFAULT = object()
JOB_PREAMBLE = """
from autotest_lib.client.common_lib.error import *
-from autotest_lib.client.common_lib.utils import *
-from autotest_lib.client.bin.autotest_utils import *
+from autotest_lib.client.bin.utils import *
"""
@@ -41,7 +40,7 @@
self.harness.run_test_complete()
if self.drop_caches:
print "Dropping caches"
- autotest_utils.drop_caches()
+ utils.drop_caches()
wrapped.__name__ = f.__name__
wrapped.__doc__ = f.__doc__
wrapped.__dict__.update(f.__dict__)
@@ -103,13 +102,13 @@
harness_type: An alternative server harness. [None]
use_external_logging: If true, the enable_external_logging
method will be called during construction. [False]
- drop_caches: If true, autotest_utils.drop_caches() is
+ drop_caches: If true, utils.drop_caches() is
called before and between all tests. [True]
"""
self.drop_caches = drop_caches
if self.drop_caches:
print "Dropping caches"
- autotest_utils.drop_caches()
+ utils.drop_caches()
self.drop_caches_between_iterations = False
self.autodir = os.environ['AUTODIR']
self.bindir = os.path.join(self.autodir, 'bin')
@@ -608,7 +607,7 @@
def new_container(self, mbytes=None, cpus=None, root=None, name=None,
network=None, disk=None, kswapd_merge=False):
- if not autotest_utils.grep('cpuset', '/proc/filesystems'):
+ if not utils.grep('cpuset', '/proc/filesystems'):
print "Containers not enabled by latest reboot"
return # containers weren't enabled in this kernel boot
pid = os.getpid()
@@ -629,7 +628,7 @@
def cpu_count(self):
if self.container:
return len(self.container.cpus)
- return autotest_utils.count_cpus() # use total system count
+ return utils.count_cpus() # use total system count
def start_reboot(self):
@@ -655,7 +654,7 @@
"mark=%d identity='%s' type='%s'") %
(expected_when, expected_id, type))
- running_id = autotest_utils.running_os_ident()
+ running_id = utils.running_os_ident()
cmdline = utils.read_one_line("/proc/cmdline")
@@ -1167,7 +1166,7 @@
def start(self):
- self.initial_space = autotest_utils.freespace(self.device)
+ self.initial_space = utils.freespace(self.device)
self.start_time = time.time()
@@ -1177,7 +1176,7 @@
if not self.max_mb_per_hour:
return
- final_space = autotest_utils.freespace(self.device)
+ final_space = utils.freespace(self.device)
used_space = self.initial_space - final_space
stop_time = time.time()
total_time = stop_time - self.start_time
diff --git a/client/bin/job_unittest.py b/client/bin/job_unittest.py
index 27d8403..7f21ddb 100644
--- a/client/bin/job_unittest.py
+++ b/client/bin/job_unittest.py
@@ -4,9 +4,8 @@
import common
from autotest_lib.client.bin import job, boottool, config, sysinfo, harness
-from autotest_lib.client.bin import test, xen, kernel, autotest_utils, cpuset
-from autotest_lib.client.bin import autotest_utils
-from autotest_lib.client.common_lib import packages, utils, error, log
+from autotest_lib.client.bin import test, xen, kernel, utils, cpuset
+from autotest_lib.client.common_lib import packages, error, log
from autotest_lib.client.common_lib.test_utils import mock
@@ -39,7 +38,7 @@
self.god.stub_function(shutil, 'copyfile')
self.god.stub_function(job, 'open')
self.god.stub_function(utils, 'system')
- self.god.stub_function(autotest_utils, 'drop_caches')
+ self.god.stub_function(utils, 'drop_caches')
self.god.stub_function(harness, 'select')
self.god.stub_function(sysinfo, 'log_per_reboot_data')
@@ -73,7 +72,7 @@
pkgdir = os.path.join(self.autodir, 'packages')
# record
- autotest_utils.drop_caches.expect_call()
+ utils.drop_caches.expect_call()
self.job._load_state.expect_call()
self.job.get_state.expect_call("__run_test_cleanup",
default=True).and_return(True)
@@ -349,7 +348,7 @@
self.job.record.expect_call("END ERROR", testname, testname,
first_line_comparator(str(real_error)))
self.job.harness.run_test_complete.expect_call()
- autotest_utils.drop_caches.expect_call()
+ utils.drop_caches.expect_call()
# run and check
self.job.run_test(testname)
@@ -389,7 +388,7 @@
self.job._decrement_group_level.expect_call()
self.job.record.expect_call("END ERROR", testname, testname, reason)
self.job.harness.run_test_complete.expect_call()
- autotest_utils.drop_caches.expect_call()
+ utils.drop_caches.expect_call()
# run and check
self.job.run_test(testname)
@@ -400,15 +399,14 @@
self.construct_job(True)
# set up stubs
- self.god.stub_function(autotest_utils, "grep")
+ self.god.stub_function(utils, "grep")
self.god.stub_function(os, "getpid")
self.god.stub_class(cpuset, "cpuset")
pid = 100
name = 'test%d' % pid
# record
- autotest_utils.grep.expect_call('cpuset',
- '/proc/filesystems').and_return(True)
+ utils.grep.expect_call('cpuset', '/proc/filesystems').and_return(True)
os.getpid.expect_call().and_return(pid)
container = cpuset.cpuset.expect_new(name, job_size=None, job_pid=pid,
@@ -514,8 +512,8 @@
# set up the job class
self.job.group_level = 2
- self.god.stub_function(autotest_utils, "running_os_ident")
- autotest_utils.running_os_ident.expect_call().and_return("2.6.15-smp")
+ self.god.stub_function(utils, "running_os_ident")
+ utils.running_os_ident.expect_call().and_return("2.6.15-smp")
self.god.stub_function(utils, "read_one_line")
utils.read_one_line.expect_call("/proc/cmdline").and_return(
@@ -538,8 +536,8 @@
# set up the job class
self.job.group_level = 2
- self.god.stub_function(autotest_utils, "running_os_ident")
- autotest_utils.running_os_ident.expect_call().and_return("2.6.15-smp")
+ self.god.stub_function(utils, "running_os_ident")
+ utils.running_os_ident.expect_call().and_return("2.6.15-smp")
self.god.stub_function(utils, "read_one_line")
utils.read_one_line.expect_call("/proc/cmdline").and_return(
diff --git a/client/bin/kernel.py b/client/bin/kernel.py
index 0432761..806bcb7 100755
--- a/client/bin/kernel.py
+++ b/client/bin/kernel.py
@@ -1,8 +1,8 @@
import os, shutil, copy, pickle, re, glob, time
from autotest_lib.client.bin.fd_stack import tee_output_logdir_mark
from autotest_lib.client.bin import kernel_config, os_dep, kernelexpand, test
-from autotest_lib.client.bin import autotest_utils
-from autotest_lib.client.common_lib import log, utils, error, packages
+from autotest_lib.client.bin import utils
+from autotest_lib.client.common_lib import log, error, packages
class kernel(object):
@@ -84,7 +84,7 @@
self.build_target = 'bzImage'
self.build_image = None
- arch = autotest_utils.get_current_kernel_arch()
+ arch = utils.get_current_kernel_arch()
if arch == 's390' or arch == 's390x':
self.build_target = 'image'
elif arch == 'ia64':
@@ -190,12 +190,12 @@
if local.endswith('.bz2') or local.endswith('.gz'):
ref = spec
else:
- ref = autotest_utils.force_copy(local, self.results_dir)
+ ref = utils.force_copy(local, self.results_dir)
ref = self.job.relative_path(ref)
patch_id = "%s %s %s" % (spec, ref, md5sum)
log = "PATCH: " + patch_id + "\n"
print log
- autotest_utils.cat_file_to_cmd(local, 'patch -p1 > /dev/null')
+ utils.cat_file_to_cmd(local, 'patch -p1 > /dev/null')
self.logfile.write(log)
self.applied_patches.append(patch_id)
@@ -215,7 +215,7 @@
tarball = os.path.join(self.src_dir, os.path.basename(base_tree))
utils.get_file(base_tree, tarball)
print 'Extracting kernel tarball:', tarball, '...'
- autotest_utils.extract_tarball_to_dir(tarball, self.build_dir)
+ utils.extract_tarball_to_dir(tarball, self.build_dir)
def extraversion(self, tag, append=1):
@@ -248,7 +248,7 @@
# Not needed on 2.6, but hard to tell -- handle failure
utils.system('make dep', ignore_status=True)
- threads = 2 * autotest_utils.count_cpus()
+ threads = 2 * utils.count_cpus()
build_string = 'make -j %d %s %s' % (threads, make_opts,
self.build_target)
# eg make bzImage, or make zImage
@@ -261,7 +261,7 @@
kernel_version = re.sub('-autotest', '', kernel_version)
self.logfile.write('BUILD VERSION: %s\n' % kernel_version)
- autotest_utils.force_copy(self.build_dir+'/System.map',
+ utils.force_copy(self.build_dir+'/System.map',
self.results_dir)
@@ -307,7 +307,7 @@
initrd
initrd image file to build
"""
- vendor = autotest_utils.get_os_vendor()
+ vendor = utils.get_os_vendor()
if os.path.isfile(initrd):
print "Existing %s file, will remove it." % initrd
@@ -375,11 +375,11 @@
self.initrd = ''
# copy to boot dir
- autotest_utils.force_copy('vmlinux', self.vmlinux)
+ utils.force_copy('vmlinux', self.vmlinux)
if (self.build_image != 'vmlinux'):
- autotest_utils.force_copy(self.build_image, self.image)
- autotest_utils.force_copy('System.map', self.system_map)
- autotest_utils.force_copy('.config', self.config_file)
+ utils.force_copy(self.build_image, self.image)
+ utils.force_copy('System.map', self.system_map)
+ utils.force_copy('.config', self.config_file)
if not kernel_config.modules_needed('.config'):
return
@@ -428,7 +428,7 @@
Work out the current kernel architecture (as a kernel arch)
"""
if not arch:
- arch = autotest_utils.get_current_kernel_arch()
+ arch = utils.get_current_kernel_arch()
if re.match('i.86', arch):
return 'i386'
elif re.match('sun4u', arch):
@@ -557,7 +557,7 @@
# If no 'target_arch' given assume native compilation
if target_arch is None:
- target_arch = autotest_utils.get_current_kernel_arch()
+ target_arch = utils.get_current_kernel_arch()
if target_arch == 'ppc64':
if self.build_target == 'bzImage':
self.build_target = 'vmlinux'
diff --git a/client/bin/kernel_config.py b/client/bin/kernel_config.py
index 6389fe1..2ceaad7 100755
--- a/client/bin/kernel_config.py
+++ b/client/bin/kernel_config.py
@@ -2,8 +2,8 @@
# the repo.
import shutil, os
-from autotest_lib.client.bin import autotest_utils, kernel_versions
-from autotest_lib.client.common_lib import error, utils
+from autotest_lib.client.bin import utils, kernel_versions
+from autotest_lib.client.common_lib import error
def apply_overrides(orig_file, changes_file, output_file):
override = dict()
@@ -44,8 +44,7 @@
def modules_needed(config):
- return (autotest_utils.grep('CONFIG_MODULES=y', config)
- and autotest_utils.grep('=m', config))
+ return (utils.grep('CONFIG_MODULES=y', config) and utils.grep('=m', config))
def config_by_name(name, set):
diff --git a/client/bin/kernel_unittest.py b/client/bin/kernel_unittest.py
index dd127a4..a0437ba 100755
--- a/client/bin/kernel_unittest.py
+++ b/client/bin/kernel_unittest.py
@@ -9,8 +9,7 @@
fd_stack.tee_output_logdir_mark = lambda f: f
# finish up imports
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import kernel, job, autotest_utils, kernelexpand
+from autotest_lib.client.bin import kernel, job, utils, kernelexpand
from autotest_lib.client.bin import kernel_config, boottool, os_dep
# we need to reload the kernel to make sure its fresh so that our
@@ -37,12 +36,12 @@
self.god.stub_function(utils, "system")
self.god.stub_function(utils, "system_output")
self.god.stub_function(utils, "get_file")
- self.god.stub_function(autotest_utils, "get_current_kernel_arch")
- self.god.stub_function(autotest_utils, "cat_file_to_cmd")
- self.god.stub_function(autotest_utils, "force_copy")
- self.god.stub_function(autotest_utils, "extract_tarball_to_dir")
- self.god.stub_function(autotest_utils, "count_cpus")
- self.god.stub_function(autotest_utils, "get_os_vendor")
+ self.god.stub_function(utils, "get_current_kernel_arch")
+ self.god.stub_function(utils, "cat_file_to_cmd")
+ self.god.stub_function(utils, "force_copy")
+ self.god.stub_function(utils, "extract_tarball_to_dir")
+ self.god.stub_function(utils, "count_cpus")
+ self.god.stub_function(utils, "get_os_vendor")
self.god.stub_function(kernelexpand, "expand_classic")
self.god.stub_function(kernel_config, "modules_needed")
self.god.stub_function(glob, "glob")
@@ -87,7 +86,7 @@
logpath = os.path.join(self.log_dir, 'build_log')
self.logfile = self.god.create_mock_class(file, "file")
kernel.open.expect_call(logpath, 'w+').and_return(self.logfile)
- autotest_utils.get_current_kernel_arch.expect_call().and_return('ia64')
+ utils.get_current_kernel_arch.expect_call().and_return('ia64')
self.logfile.write.expect_call('BASE: %s\n' % self.base_tree)
self.kernel.extract.expect_call(self.base_tree)
@@ -273,25 +272,25 @@
patch_id = "%s %s %s" % ('patch1', 'patch1', 'md5sum1')
log = "PATCH: " + patch_id + "\n"
- autotest_utils.cat_file_to_cmd.expect_call('patch1.gz',
+ utils.cat_file_to_cmd.expect_call('patch1.gz',
'patch -p1 > /dev/null')
self.logfile.write.expect_call(log)
applied_patches.append(patch_id)
patch_id = "%s %s %s" % ('patch2', 'patch2', 'md5sum2')
log = "PATCH: " + patch_id + "\n"
- autotest_utils.cat_file_to_cmd.expect_call('patch2.bz2',
+ utils.cat_file_to_cmd.expect_call('patch2.bz2',
'patch -p1 > /dev/null')
self.logfile.write.expect_call(log)
applied_patches.append(patch_id)
- autotest_utils.force_copy.expect_call('patch3',
+ utils.force_copy.expect_call('patch3',
self.results_dir).and_return('local_patch3')
self.job.relative_path.expect_call('local_patch3').and_return(
'rel_local_patch3')
patch_id = "%s %s %s" % ('patch3', 'rel_local_patch3', 'md5sum3')
log = "PATCH: " + patch_id + "\n"
- autotest_utils.cat_file_to_cmd.expect_call('patch3',
+ utils.cat_file_to_cmd.expect_call('patch3',
'patch -p1 > /dev/null')
self.logfile.write.expect_call(log)
applied_patches.append(patch_id)
@@ -322,7 +321,7 @@
os.chdir.expect_call(os.path.dirname(self.src_dir))
tarball = os.path.join(self.src_dir, os.path.basename(self.base_tree))
utils.get_file.expect_call(self.base_tree, tarball)
- autotest_utils.extract_tarball_to_dir.expect_call(tarball,
+ utils.extract_tarball_to_dir.expect_call(tarball,
self.build_dir)
# run and check
@@ -360,7 +359,7 @@
self.kernel.extraversion.expect_call('autotest')
self.kernel.set_cross_cc.expect_call()
utils.system.expect_call('make dep', ignore_status=True)
- autotest_utils.count_cpus.expect_call().and_return(4)
+ utils.count_cpus.expect_call().and_return(4)
threads = 2 * 4
build_string = 'make -j %d %s %s' % (threads, '', 'build_target')
utils.system.expect_call(build_string)
@@ -369,7 +368,7 @@
self.kernel.get_kernel_build_ver.expect_call().and_return('2.6.24')
kernel_version = re.sub('-autotest', '', '2.6.24')
self.logfile.write.expect_call('BUILD VERSION: %s\n' % kernel_version)
- autotest_utils.force_copy.expect_call(self.build_dir+'/System.map',
+ utils.force_copy.expect_call(self.build_dir+'/System.map',
self.results_dir)
self.job.record.expect_call('GOOD', self.subdir, 'kernel.build')
@@ -414,7 +413,7 @@
self.construct_kernel()
# record
- autotest_utils.get_os_vendor.expect_call().and_return('Ubuntu')
+ utils.get_os_vendor.expect_call().and_return('Ubuntu')
os.path.isfile.expect_call('initrd').and_return(True)
os.remove.expect_call('initrd')
self.job.config_get.expect_call(
@@ -450,13 +449,13 @@
glob.glob.expect_call(
'arch/*/boot/' + 'build_target').and_return('')
build_image = self.kernel.build_target
- autotest_utils.force_copy.expect_call('vmlinux',
+ utils.force_copy.expect_call('vmlinux',
'/boot/vmlinux-autotest')
- autotest_utils.force_copy.expect_call('build_target',
+ utils.force_copy.expect_call('build_target',
'/boot/vmlinuz-autotest')
- autotest_utils.force_copy.expect_call('System.map',
+ utils.force_copy.expect_call('System.map',
'/boot/System.map-autotest')
- autotest_utils.force_copy.expect_call('.config',
+ utils.force_copy.expect_call('.config',
'/boot/config-autotest')
kernel_config.modules_needed.expect_call('.config').and_return(True)
utils.system.expect_call('make modules_install INSTALL_MOD_PATH=%s'
@@ -498,7 +497,7 @@
self.construct_kernel()
# record
- autotest_utils.get_current_kernel_arch.expect_call().and_return("i386")
+ utils.get_current_kernel_arch.expect_call().and_return("i386")
# run and check
self.assertEquals(self.kernel.get_kernel_build_arch(), "i386")
diff --git a/client/bin/net/net_tc.py b/client/bin/net/net_tc.py
index 06cf8bb..1f3cf77 100755
--- a/client/bin/net/net_tc.py
+++ b/client/bin/net/net_tc.py
@@ -39,8 +39,7 @@
import commands, os, re
import common
-from autotest_lib.client.common_lib import error, utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.common_lib import error
from autotest_lib.client.bin.net import net_utils
# TODO (chavey) clean up those global here and new_handle()
diff --git a/client/bin/net/net_tc_unittest.py b/client/bin/net/net_tc_unittest.py
index 7f8c036..576a2de 100755
--- a/client/bin/net/net_tc_unittest.py
+++ b/client/bin/net/net_tc_unittest.py
@@ -4,10 +4,10 @@
import unittest, os, socket, time, sys
import common
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
from autotest_lib.client.bin.net import net_tc, net_utils, net_utils_mock
from autotest_lib.client.common_lib.test_utils import mock
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.common_lib import error
class TestNetUtils(unittest.TestCase):
def setUp(self):
diff --git a/client/bin/net/net_utils.py b/client/bin/net/net_utils.py
index 960b581..4a7a566 100755
--- a/client/bin/net/net_utils.py
+++ b/client/bin/net/net_utils.py
@@ -4,8 +4,8 @@
"""
import commands, os, re, socket, sys, time, struct
-from autotest_lib.client.common_lib import error, utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.common_lib import error
+from autotest_lib.client.bin import utils
TIMEOUT = 10 # Used for socket timeout and barrier timeout
@@ -414,7 +414,7 @@
wait_time = 0
while wait_time < 100:
time.sleep(10)
- if not autotest_utils.ping_default_gateway():
+ if not utils.ping_default_gateway():
return True
wait_time += 10
return False
diff --git a/client/bin/net/net_utils_unittest.py b/client/bin/net/net_utils_unittest.py
index 453abd3..37d2eff 100755
--- a/client/bin/net/net_utils_unittest.py
+++ b/client/bin/net/net_utils_unittest.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
import unittest, os, socket, time, sys, struct
import common
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
from autotest_lib.client.bin.net import net_utils, net_utils_mock
from autotest_lib.client.common_lib.test_utils import mock
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.common_lib import error
class TestNetUtils(unittest.TestCase):
@@ -18,7 +18,7 @@
self.god = mock.mock_god()
self.god.stub_function(utils, "system")
self.god.stub_function(utils, "system_output")
- self.god.stub_function(autotest_utils, "module_is_loaded")
+ self.god.stub_function(utils, "module_is_loaded")
self.god.stub_function(net_utils, "open")
self.god.stub_function(time, 'sleep')
@@ -962,23 +962,23 @@
def test_bonding_wait_for_state_change(self):
- self.god.stub_function(autotest_utils, "ping_default_gateway")
+ self.god.stub_function(utils, "ping_default_gateway")
time.sleep.expect_call(10)
- autotest_utils.ping_default_gateway.expect_call().and_return(False)
+ utils.ping_default_gateway.expect_call().and_return(False)
self.assertEquals(net_utils.bond().wait_for_state_change(), True)
for x in xrange(9):
time.sleep.expect_call(10)
- autotest_utils.ping_default_gateway.expect_call().and_return(True)
+ utils.ping_default_gateway.expect_call().and_return(True)
time.sleep.expect_call(10)
- autotest_utils.ping_default_gateway.expect_call().and_return(False)
+ utils.ping_default_gateway.expect_call().and_return(False)
self.assertEquals(net_utils.bond().wait_for_state_change(), True)
for x in xrange(10):
time.sleep.expect_call(10)
- autotest_utils.ping_default_gateway.expect_call().and_return(True)
+ utils.ping_default_gateway.expect_call().and_return(True)
self.assertEquals(net_utils.bond().wait_for_state_change(), False)
diff --git a/client/bin/package.py b/client/bin/package.py
index a012b78..c5cd3c3 100644
--- a/client/bin/package.py
+++ b/client/bin/package.py
@@ -7,8 +7,8 @@
__author__ = '[email protected] (Lucas Meneghel Rodrigues)'
import os, re
-from autotest_lib.client.bin import os_dep, autotest_utils
-from autotest_lib.client.common_lib import error, utils
+from autotest_lib.client.bin import os_dep, utils
+from autotest_lib.client.common_lib import error
# As more package methods are implemented, this list grows up
KNOWN_PACKAGE_MANAGERS = ['rpm', 'dpkg']
diff --git a/client/bin/package_unittest.py b/client/bin/package_unittest.py
index 0133df9..28f7278 100644
--- a/client/bin/package_unittest.py
+++ b/client/bin/package_unittest.py
@@ -4,8 +4,7 @@
import unittest, os
import common
from autotest_lib.client.common_lib.test_utils import mock
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import package, os_dep
+from autotest_lib.client.bin import package, os_dep, utils
class TestPackage(unittest.TestCase):
diff --git a/client/bin/partition.py b/client/bin/partition.py
index fbb2a24..c6f2368 100755
--- a/client/bin/partition.py
+++ b/client/bin/partition.py
@@ -1,8 +1,8 @@
# Copyright Martin J. Bligh, Google, 2006-2008
import os, re, string, sys, fcntl
-from autotest_lib.client.bin import autotest_utils
-from autotest_lib.client.common_lib import error, utils
+from autotest_lib.client.bin import utils
+from autotest_lib.client.common_lib import error
class FsOptions(object):
diff --git a/client/bin/self-test/extract_tarball_to_dir b/client/bin/self-test/extract_tarball_to_dir
index cbba396..dd7505d 100755
--- a/client/bin/self-test/extract_tarball_to_dir
+++ b/client/bin/self-test/extract_tarball_to_dir
@@ -3,9 +3,9 @@
autodir = os.environ['AUTODIR']
sys.path.insert(0, autodir + '/bin')
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
os.chdir('/tmp')
-autotest_utils.extract_tarball_to_dir(autodir +
+utils.extract_tarball_to_dir(autodir +
'/tests/bonnie/bonnie++-1.03a.tgz',
'poo')
diff --git a/client/bin/self-test/test_redirect b/client/bin/self-test/test_redirect
index 6059f64..ab5f189 100755
--- a/client/bin/self-test/test_redirect
+++ b/client/bin/self-test/test_redirect
@@ -1,6 +1,4 @@
#!/usr/bin/python
-
-from autotest_lib.client.bin import autotest_utils
import os
stdout = fd_stack(1, sys.stdout)
diff --git a/client/bin/autotest_utils.py b/client/bin/utils.py
similarity index 85%
rename from client/bin/autotest_utils.py
rename to client/bin/utils.py
index 1214e8b..973ade3 100755
--- a/client/bin/autotest_utils.py
+++ b/client/bin/utils.py
@@ -1,10 +1,13 @@
-"""Convenience functions for use by tests or whomever.
"""
+Convenience functions for use by tests or whomever.
+NOTE: this is a mixin library that pulls in functions from both here and
+client/common_lib/utils.py (which are functions shared with the server code)
+"""
import os, shutil, sys, signal, commands, pickle, glob, statvfs
import math, re, string, fnmatch
-from autotest_lib.client.common_lib import error, utils
-
+from autotest_lib.client.common_lib import error
+from autotest_lib.client.common_lib.utils import *
def grep(pattern, file):
@@ -38,9 +41,9 @@
% (file, command))
if return_output:
- run_cmd = utils.system_output
+ run_cmd = system_output
else:
- run_cmd = utils.system
+ run_cmd = system
if file.endswith('.bz2'):
cat = 'bzcat'
@@ -93,11 +96,12 @@
"""Gets the md5sum of a file. You must provide a valid path to the file"""
if not os.path.isfile(file_path):
raise ValueError, 'invalid file %s to verify' % file_path
- return utils.system_output("md5sum " + file_path + " | awk '{print $1}'")
+ md5sum = system_output("md5sum " + file_path)
+ return md5sum.split()[0]
def unmap_url_cache(cachedir, url, expected_md5):
- """\
+ """
Downloads a file from a URL to a cache directory. If the file is already
at the expected position and has the expected md5 number, let's not
download it again.
@@ -106,7 +110,7 @@
cachedir = os.path.realpath(cachedir)
if not os.path.isdir(cachedir):
try:
- utils.system('mkdir -p ' + cachedir)
+ system('mkdir -p ' + cachedir)
except:
raise ValueError('Could not create cache directory %s' % cachedir)
file_from_url = os.path.basename(url)
@@ -122,7 +126,7 @@
else:
# File is not there, let's download it
src = url
- return utils.unmap_url(cachedir, src, cachedir)
+ return unmap_url(cachedir, src, cachedir)
def force_copy(src, dest):
@@ -137,14 +141,14 @@
def force_link(src, dest):
"""Link src to dest, overwriting it if it exists"""
- return utils.system("ln -sf %s %s" % (src, dest))
+ return system("ln -sf %s %s" % (src, dest))
def file_contains_pattern(file, pattern):
"""Return true if file contains the specified egrep pattern"""
if not os.path.isfile(file):
raise NameError('file %s does not exist' % file)
- return not utils.system('egrep -q "' + pattern + '" ' + file, ignore_status=True)
+ return not system('egrep -q "' + pattern + '" ' + file, ignore_status=True)
def list_grep(list, pattern):
@@ -184,10 +188,10 @@
Ahem. This is crap. Pray harder. Bad Martin.
"""
- vmlinux = '/boot/vmlinux-%s' % utils.system_output('uname -r')
+ vmlinux = '/boot/vmlinux-%s' % system_output('uname -r')
if os.path.isfile(vmlinux):
return vmlinux
- vmlinux = '/lib/modules/%s/build/vmlinux' % utils.system_output('uname -r')
+ vmlinux = '/lib/modules/%s/build/vmlinux' % system_output('uname -r')
if os.path.isfile(vmlinux):
return vmlinux
return None
@@ -198,10 +202,10 @@
Ahem. This is crap. Pray harder. Bad Martin.
"""
- map = '/boot/System.map-%s' % utils.system_output('uname -r')
+ map = '/boot/System.map-%s' % system_output('uname -r')
if os.path.isfile(map):
return map
- map = '/lib/modules/%s/build/System.map' % utils.system_output('uname -r')
+ map = '/lib/modules/%s/build/System.map' % system_output('uname -r')
if os.path.isfile(map):
return map
return None
@@ -209,7 +213,7 @@
def get_modules_dir():
"""Return the modules dir for the running kernel version"""
- kernel_version = utils.system_output('uname -r')
+ kernel_version = system_output('uname -r')
return '/lib/modules/%s/kernel' % kernel_version
@@ -241,7 +245,7 @@
def get_file_arch(filename):
# -L means follow symlinks
- file_data = utils.system_output('file -L ' + filename)
+ file_data = system_output('file -L ' + filename)
if file_data.count('80386'):
return 'i386'
return None
@@ -259,7 +263,7 @@
# Returns total memory in kb
def read_from_meminfo(key):
- meminfo = utils.system_output('grep %s /proc/meminfo' % key)
+ meminfo = system_output('grep %s /proc/meminfo' % key)
return int(re.search(r'\d+', meminfo).group(0))
@@ -272,9 +276,9 @@
def rounded_memtotal():
- # Get total of all physical mem, in Kbytes
- usable_Kbytes = memtotal()
- # usable_Kbytes is system's usable DRAM in Kbytes,
+ # Get total of all physical mem, in kbytes
+ usable_kbytes = memtotal()
+ # usable_kbytes is system's usable DRAM in kbytes,
# as reported by memtotal() from device /proc/meminfo memtotal
# after Linux deducts 1.5% to 5.1% for system table overhead
# Undo the unknown actual deduction by rounding up
@@ -290,26 +294,26 @@
# tighter spread between min and max possible deductions
# increase mem size by at least min deduction, without rounding
- min_Kbytes = int(usable_Kbytes / (1.0 - mindeduct))
+ min_kbytes = int(usable_kbytes / (1.0 - mindeduct))
# increase mem size further by 2**n rounding, by 0..roundKb or more
- round_Kbytes = int(usable_Kbytes / (1.0 - maxdeduct)) - min_Kbytes
+ round_kbytes = int(usable_kbytes / (1.0 - maxdeduct)) - min_kbytes
# find least binary roundup 2**n that covers worst-cast roundKb
- mod2n = 1 << int(math.ceil(math.log(round_Kbytes, 2)))
- # have round_Kbytes <= mod2n < round_Kbytes*2
- # round min_Kbytes up to next multiple of mod2n
- phys_Kbytes = min_Kbytes + mod2n - 1
- phys_Kbytes = phys_Kbytes - (phys_Kbytes % mod2n) # clear low bits
- return phys_Kbytes
+ mod2n = 1 << int(math.ceil(math.log(round_kbytes, 2)))
+ # have round_kbytes <= mod2n < round_kbytes*2
+ # round min_kbytes up to next multiple of mod2n
+ phys_kbytes = min_kbytes + mod2n - 1
+ phys_kbytes = phys_kbytes - (phys_kbytes % mod2n) # clear low bits
+ return phys_kbytes
def sysctl_kernel(key, value=None):
"""(Very) partial implementation of sysctl, for kernel params"""
if value:
# write
- utils.write_one_line('/proc/sys/kernel/%s' % key, str(value))
+ write_one_line('/proc/sys/kernel/%s' % key, str(value))
else:
# read
- out = utils.read_one_line('/proc/sys/kernel/%s' % key)
+ out = read_one_line('/proc/sys/kernel/%s' % key)
return int(re.search(r'\d+', out).group(0))
@@ -401,7 +405,7 @@
"""
Return path of config file of the currently running kernel
"""
- version = utils.system_output('uname -r')
+ version = system_output('uname -r')
for config in ('/proc/config.gz', \
'/boot/config-%s' % version,
'/lib/modules/%s/build/.config' % version):
@@ -422,7 +426,7 @@
grep = 'grep'
grep += ' ^CONFIG_%s= %s' % (feature, config)
- if not utils.system_output(grep, ignore_status=True):
+ if not system_output(grep, ignore_status=True):
raise ValueError("Kernel doesn't have a %s feature" % (feature))
@@ -445,7 +449,7 @@
(glibc_ver, ver))
def check_kernel_ver(ver):
- kernel_ver = utils.system_output('uname -r')
+ kernel_ver = system_output('uname -r')
kv_tmp = re.split(r'[-]', kernel_ver)[0:3]
if kv_tmp[0].split('.') < ver.split('.'):
raise error.TestError("Kernel too old (%s). Kernel > %s is needed." % \
@@ -528,7 +532,7 @@
def get_cpu_family():
- procinfo = utils.system_output('cat /proc/cpuinfo')
+ procinfo = system_output('cat /proc/cpuinfo')
CPU_FAMILY_RE = re.compile(r'^cpu family\s+:\s+(\S+)', re.M)
matches = CPU_FAMILY_RE.findall(procinfo)
if matches:
@@ -538,7 +542,7 @@
def get_disks():
- df_output = utils.system_output('df')
+ df_output = system_output('df')
disk_re = re.compile(r'^(/dev/hd[a-z]+)3', re.M)
return disk_re.findall(df_output)
@@ -548,17 +552,17 @@
if module_is_loaded(module_name):
return False
- utils.system('/sbin/modprobe ' + module_name)
+ system('/sbin/modprobe ' + module_name)
return True
def unload_module(module_name):
- utils.system('/sbin/rmmod ' + module_name)
+ system('/sbin/rmmod ' + module_name)
def module_is_loaded(module_name):
module_name = module_name.replace('-', '_')
- modules = utils.system_output('/sbin/lsmod').splitlines()
+ modules = system_output('/sbin/lsmod').splitlines()
for module in modules:
if module.startswith(module_name) and module[len(module_name)] == ' ':
return True
@@ -566,22 +570,22 @@
def get_loaded_modules():
- lsmod_output = utils.system_output('/sbin/lsmod').splitlines()[1:]
+ lsmod_output = system_output('/sbin/lsmod').splitlines()[1:]
return [line.split(None, 1)[0] for line in lsmod_output]
def get_huge_page_size():
- output = utils.system_output('grep Hugepagesize /proc/meminfo')
+ output = system_output('grep Hugepagesize /proc/meminfo')
return int(output.split()[1]) # Assumes units always in kB. :(
def get_num_huge_pages():
- raw_hugepages = utils.system_output('/sbin/sysctl vm.nr_hugepages')
+ raw_hugepages = system_output('/sbin/sysctl vm.nr_hugepages')
return int(raw_hugepages.split()[2])
def set_num_huge_pages(num):
- utils.system('/sbin/sysctl vm.nr_hugepages=%d' % num)
+ system('/sbin/sysctl vm.nr_hugepages=%d' % num)
def get_system_nodes():
@@ -601,11 +605,11 @@
def probe_cpus():
"""
- This routine returns a list of cpu devices found under /sys/devices/system/cpu.
+ This routine returns a list of cpu devices found under
+ /sys/devices/system/cpu.
"""
- output = utils.system_output(
- 'find /sys/devices/system/cpu/ -maxdepth 1 -type d -name cpu*')
- return output.splitlines()
+ cmd = 'find /sys/devices/system/cpu/ -maxdepth 1 -type d -name cpu*'
+ return system_output(cmd).splitlines()
def ping_default_gateway():
@@ -617,14 +621,16 @@
if m:
gw = m.group(1)
cmd = 'ping %s -c 5 > /dev/null' % gw
- return utils.system(cmd, ignore_status=True)
+ return system(cmd, ignore_status=True)
raise error.TestError('Unable to find default gateway')
def drop_caches():
"""Writes back all dirty pages to disk and clears all the caches."""
- utils.system("sync")
- utils.system("sync")
+ system("sync")
+ system("sync")
# We ignore failures here as this will fail on 2.6.11 kernels.
- utils.system("echo 3 > /proc/sys/vm/drop_caches", ignore_status=True)
+ system("echo 3 > /proc/sys/vm/drop_caches", ignore_status=True)
+
+
diff --git a/client/bin/xen.py b/client/bin/xen.py
index 2191ab9..6371b51 100644
--- a/client/bin/xen.py
+++ b/client/bin/xen.py
@@ -3,8 +3,7 @@
import os, shutil, copy, pickle, re, glob
from autotest_lib.client.bin import kernel, kernel_config, os_dep, test
-from autotest_lib.client.bin import autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import utils
class xen(kernel.kernel):
@@ -45,7 +44,7 @@
# build xen hypervisor and user-space tools
targets = ['xen', 'tools']
- threads = 2 * autotest_utils.count_cpus()
+ threads = 2 * utils.count_cpus()
for t in targets:
build_string = 'make -j %d %s %s' % (threads, make_opts, t)
self.log('build_string: %s' % build_string)
diff --git a/client/common_lib/test.py b/client/common_lib/test.py
index 22c25be..6d2b2c3 100644
--- a/client/common_lib/test.py
+++ b/client/common_lib/test.py
@@ -19,8 +19,8 @@
import fcntl, os, re, sys, shutil, tarfile, tempfile, time, traceback
import warnings
-from autotest_lib.client.common_lib import error, utils, packages, debug
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.common_lib import error, packages, debug
+from autotest_lib.client.bin import utils
class base_test:
@@ -101,7 +101,7 @@
def drop_caches_between_iterations(self):
if self.job.drop_caches_between_iterations:
print "Dropping caches between iterations"
- autotest_utils.drop_caches()
+ utils.drop_caches()
def execute(self, iterations=None, test_length=None, *args, **dargs):
diff --git a/client/deps/boottool/boottool.py b/client/deps/boottool/boottool.py
index 3e9b6a2..2718af1 100755
--- a/client/deps/boottool/boottool.py
+++ b/client/deps/boottool/boottool.py
@@ -2,8 +2,7 @@
import os
import common
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
# To use this, you have to set PERL5LIB to:
# autodir+'deps/boottool/lib/perl'
@@ -15,7 +14,7 @@
def setup(tarball, topdir):
srcdir = os.path.join(topdir, 'src')
- autotest_utils.extract_tarball_to_dir(tarball, srcdir)
+ utils.extract_tarball_to_dir(tarball, srcdir)
os.chdir(srcdir)
utils.system ('perl Makefile.PL PREFIX=' + topdir)
utils.system ('make')
diff --git a/client/deps/libaio/libaio.py b/client/deps/libaio/libaio.py
index b8e8a6f..6a27ab8 100755
--- a/client/deps/libaio/libaio.py
+++ b/client/deps/libaio/libaio.py
@@ -2,14 +2,13 @@
import os
import common
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
version = 1
def setup(tarball, topdir):
srcdir = os.path.join(topdir, 'src')
- autotest_utils.extract_tarball_to_dir(tarball, srcdir)
+ utils.extract_tarball_to_dir(tarball, srcdir)
os.chdir(srcdir)
utils.system ('make')
utils.system ('make prefix=%s install' % topdir)
diff --git a/client/deps/libcap/libcap.py b/client/deps/libcap/libcap.py
index 31de0a6..d599efe 100755
--- a/client/deps/libcap/libcap.py
+++ b/client/deps/libcap/libcap.py
@@ -1,14 +1,13 @@
#!/usr/bin/python
import os, common
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
version = 2
def setup(srcdir, tarball='libcap-2.16.tar.gz'):
topdir = os.getcwd()
- autotest_utils.extract_tarball_to_dir(tarball, srcdir)
+ utils.extract_tarball_to_dir(tarball, srcdir)
os.chdir(srcdir)
utils.system('make -C libcap LIBATTR=no')
os.chdir(topdir)
diff --git a/client/deps/libnet/libnet.py b/client/deps/libnet/libnet.py
index 3f23b97..32cb8ae 100755
--- a/client/deps/libnet/libnet.py
+++ b/client/deps/libnet/libnet.py
@@ -2,8 +2,7 @@
import os
import common
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
version = 1
@@ -12,7 +11,7 @@
if not os.path.exists(tarball):
utils.get_file('http://www.packetfactory.net/libnet/dist/libnet.tar.gz',
tarball)
- autotest_utils.extract_tarball_to_dir(tarball, 'src')
+ utils.extract_tarball_to_dir(tarball, 'src')
os.chdir(srcdir)
utils.system ('./configure --prefix=%s/libnet' % topdir)
utils.system('make')
diff --git a/client/deps/mysql/mysql.py b/client/deps/mysql/mysql.py
index 556f6bc..d8f0037 100755
--- a/client/deps/mysql/mysql.py
+++ b/client/deps/mysql/mysql.py
@@ -2,8 +2,7 @@
import os
import common
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
version = 3
@@ -11,11 +10,11 @@
srcdir = os.path.join(topdir, 'src')
if not os.path.exists(tarball):
utils.get_file('http://mirror.x10.com/mirror/mysql/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz', tarball)
- autotest_utils.extract_tarball_to_dir(tarball, 'src')
+ utils.extract_tarball_to_dir(tarball, 'src')
os.chdir(srcdir)
utils.system ('./configure --prefix=%s/mysql --enable-thread-safe-client' \
% topdir)
- utils.system('make -j %d' % autotest_utils.count_cpus())
+ utils.system('make -j %d' % utils.count_cpus())
utils.system('make install')
#
diff --git a/client/deps/pgpool/pgpool.py b/client/deps/pgpool/pgpool.py
index b551960..c4caab5 100755
--- a/client/deps/pgpool/pgpool.py
+++ b/client/deps/pgpool/pgpool.py
@@ -2,8 +2,7 @@
import os
import common
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
version = 1
@@ -13,13 +12,13 @@
srcdir = os.path.join(topdir, 'src')
if not os.path.exists(tarball):
utils.get_file('http://pgfoundry.org/frs/download.php/1083/pgpool-II-1.0.1.tar.gz', tarball)
- autotest_utils.extract_tarball_to_dir(tarball, 'src')
+ utils.extract_tarball_to_dir(tarball, 'src')
os.chdir(srcdir)
# FIXEME - Waiting to be able to use self.autodir instead of
# os.environ['AUTODIR']
utils.system('./configure --prefix=%s/pgpool --with-pgsql=%s/deps/pgsql/pgsql' \
% (topdir, os.environ['AUTODIR']))
- utils.system('make -j %d' % autotest_utils.count_cpus())
+ utils.system('make -j %d' % utils.count_cpus())
utils.system('make install')
os.chdir(topdir)
diff --git a/client/deps/pgsql/pgsql.py b/client/deps/pgsql/pgsql.py
index affef3ea..5df7a8d 100755
--- a/client/deps/pgsql/pgsql.py
+++ b/client/deps/pgsql/pgsql.py
@@ -2,8 +2,7 @@
import os
import common
-from autotest_lib.client.common_lib import utils
-from autotest_lib.client.bin import autotest_utils
+from autotest_lib.client.bin import utils
version = 4
@@ -11,10 +10,10 @@
srcdir = os.path.join(topdir, 'src')
if not os.path.exists(tarball):
utils.get_file('ftp://ftp.postgresql.org/pub/source/v8.3.1/postgresql-8.3.1.tar.bz2', tarball)
- autotest_utils.extract_tarball_to_dir(tarball, 'src')
+ utils.extract_tarball_to_dir(tarball, 'src')
os.chdir(srcdir)
utils.system ('./configure --without-readline --without-zlib --enable-debug --prefix=%s/pgsql' % topdir)
- utils.system('make -j %d' % autotest_utils.count_cpus())
+ utils.system('make -j %d' % utils.count_cpus())
utils.system('make install')
os.chdir(topdir)
diff --git a/client/profilers/lockmeter/lockmeter.py b/client/profilers/lockmeter/lockmeter.py
index b676ce4..830946a 100755
--- a/client/profilers/lockmeter/lockmeter.py
+++ b/client/profilers/lockmeter/lockmeter.py
@@ -10,8 +10,7 @@
But read the FAQ first.
"""
import os
-from autotest_lib.client.bin import autotest_utils, profiler
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import utils, profiler
class lockmeter(profiler.profiler):
version = 1
@@ -23,7 +22,7 @@
def setup(self, tarball = 'lockstat-1.4.11.tar.bz2'):
self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
@@ -51,6 +50,6 @@
def report(self, test):
- args = ' -m ' + autotest_utils.get_systemmap()
+ args = ' -m ' + utils.get_systemmap()
self.output = self.profdir + '/results/lockstat'
utils.system(self.cmd + args + ' print > ' + self.output)
diff --git a/client/profilers/lttng/lttng.py b/client/profilers/lttng/lttng.py
index 770bbae..bf1a2e7 100755
--- a/client/profilers/lttng/lttng.py
+++ b/client/profilers/lttng/lttng.py
@@ -21,8 +21,8 @@
"""
import os, shutil, time
-from autotest_lib.client.bin import autotest_utils, profiler
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import utils, profiler
+from autotest_lib.client.common_lib import error
class lttng(profiler.profiler):
version = 1
@@ -30,7 +30,7 @@
# http://ltt.polymtl.ca/lttng/ltt-control-0.51-12082008.tar.gz
def setup(self, tarball='ltt-control-0.51-12082008.tar.gz', **dargs):
self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('./configure')
diff --git a/client/profilers/oprofile/oprofile.py b/client/profilers/oprofile/oprofile.py
index c86326a..263b483 100755
--- a/client/profilers/oprofile/oprofile.py
+++ b/client/profilers/oprofile/oprofile.py
@@ -10,8 +10,7 @@
Will need some libaries to compile. Do 'apt-get build-dep oprofile'
"""
import os, shutil
-from autotest_lib.client.bin import autotest_utils, profiler
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import utils, profiler
class oprofile(profiler.profiler):
version = 5
@@ -33,7 +32,7 @@
try:
self.tarball = utils.unmap_url(self.bindir, tarball,
self.tmpdir)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
patch = os.path.join(self.bindir,"oprofile-69455.patch")
@@ -55,7 +54,7 @@
self.job.require_gcc()
if not vmlinux:
- self.vmlinux = autotest_utils.get_vmlinux()
+ self.vmlinux = utils.get_vmlinux()
else:
self.vmlinux = vmlinux
if not len(events):
@@ -110,8 +109,8 @@
reportfile = test.profdir + '/oprofile.kernel'
if self.vmlinux:
report = self.opreport + ' -l ' + self.vmlinux
- if os.path.exists(autotest_utils.get_modules_dir()):
- report += ' -p ' + autotest_utils.get_modules_dir()
+ if os.path.exists(utils.get_modules_dir()):
+ report += ' -p ' + utils.get_modules_dir()
utils.system(report + ' > ' + reportfile)
else:
utils.system("echo 'no vmlinux found.' > %s" % reportfile)
diff --git a/client/profilers/readprofile/readprofile.py b/client/profilers/readprofile/readprofile.py
index 54438e5..247317f 100755
--- a/client/profilers/readprofile/readprofile.py
+++ b/client/profilers/readprofile/readprofile.py
@@ -9,8 +9,8 @@
the procedure. The output is filled with blanks to ease readability.
"""
import os, shutil
-from autotest_lib.client.bin import autotest_utils, profiler
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import utils, profiler
+from autotest_lib.client.common_lib import error
class readprofile(profiler.profiler):
version = 1
@@ -18,7 +18,7 @@
# http://www.kernel.org/pub/linux/utils/util-linux/util-linux-2.12r.tar.bz2
def setup(self, tarball = 'util-linux-2.12r.tar.bz2'):
self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('./configure')
@@ -51,7 +51,7 @@
def report(self, test):
args = ' -n'
- args += ' -m ' + autotest_utils.get_systemmap()
+ args += ' -m ' + utils.get_systemmap()
args += ' -p ' + self.rawprofile
cmd = self.cmd + ' ' + args
txtprofile = test.profdir + '/profile.text'
diff --git a/client/profilers/sar/sar.py b/client/profilers/sar/sar.py
index 3d07a3d..6b55a00 100644
--- a/client/profilers/sar/sar.py
+++ b/client/profilers/sar/sar.py
@@ -7,8 +7,7 @@
import os, shutil, subprocess
-from autotest_lib.client.bin import autotest_utils, profiler
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import utils, profiler
class sar(profiler.profiler):
diff --git a/client/tests/aio_dio_bugs/aio_dio_bugs.py b/client/tests/aio_dio_bugs/aio_dio_bugs.py
index 9db1ffd..41ea0b9 100644
--- a/client/tests/aio_dio_bugs/aio_dio_bugs.py
+++ b/client/tests/aio_dio_bugs/aio_dio_bugs.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
# tests is a simple array of "cmd" "arguments"
@@ -33,8 +32,8 @@
def execute(self, args = ''):
os.chdir(self.tmpdir)
libs = self.autodir + '/deps/libaio/lib/'
- ld_path = autotest_utils.prepend_path(libs,
- autotest_utils.environ('LD_LIBRARY_PATH'))
+ ld_path = utils.prepend_path(libs,
+ utils.environ('LD_LIBRARY_PATH'))
var_ld_path = 'LD_LIBRARY_PATH=' + ld_path
for test in tests:
cmd = self.srcdir + '/' + test[name] + ' ' + args + ' ' \
diff --git a/client/tests/aiostress/aiostress.py b/client/tests/aiostress/aiostress.py
index d32bd5b..433a201 100755
--- a/client/tests/aiostress/aiostress.py
+++ b/client/tests/aiostress/aiostress.py
@@ -1,8 +1,7 @@
# This requires aio headers to build.
# Should work automagically out of deps now.
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class aiostress(test.test):
@@ -31,8 +30,8 @@
def run_once(self, args = ''):
os.chdir(self.tmpdir)
libs = self.autodir+'/deps/libaio/lib/'
- ld_path = autotest_utils.prepend_path(libs,
- autotest_utils.environ('LD_LIBRARY_PATH'))
+ ld_path = utils.prepend_path(libs,
+ utils.environ('LD_LIBRARY_PATH'))
var_ld_path = 'LD_LIBRARY_PATH=' + ld_path
cmd = self.srcdir + '/aio-stress ' + args + ' poo'
diff --git a/client/tests/bash_shared_mapping/bash_shared_mapping.py b/client/tests/bash_shared_mapping/bash_shared_mapping.py
index c1645b3..40c0df2 100755
--- a/client/tests/bash_shared_mapping/bash_shared_mapping.py
+++ b/client/tests/bash_shared_mapping/bash_shared_mapping.py
@@ -1,6 +1,5 @@
import signal, os
-from autotest_lib.client.bin import autotest_utils, test
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import utils, test
class bash_shared_mapping(test.test):
version = 3
@@ -8,7 +7,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make bash-shared-mapping usemem')
@@ -25,7 +24,7 @@
file = os.path.join(testdir, 'foo')
# Want to use 3/4 of all memory for each of
# bash-shared-mapping and usemem
- kilobytes = (3 * autotest_utils.memtotal()) / 4
+ kilobytes = (3 * utils.memtotal()) / 4
# Want two usemem -m megabytes in parallel in background.
pid = [None, None]
@@ -37,7 +36,7 @@
cmd = "%s/bash-shared-mapping %s %d -t %d -n %d" % \
(self.srcdir, file, kilobytes,
- autotest_utils.count_cpus(), iterations)
+ utils.count_cpus(), iterations)
os.system(cmd)
for i in (0, 1):
diff --git a/client/tests/bonnie/bonnie.py b/client/tests/bonnie/bonnie.py
index 01534bd..54b0ca6 100755
--- a/client/tests/bonnie/bonnie.py
+++ b/client/tests/bonnie/bonnie.py
@@ -1,6 +1,5 @@
import os, re
-from autotest_lib.client.bin import test, os_dep, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, os_dep, utils
def convert_size(values):
@@ -34,7 +33,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
os_dep.command('g++')
diff --git a/client/tests/btreplay/btreplay.py b/client/tests/btreplay/btreplay.py
index 6e807a7..17228ca 100644
--- a/client/tests/btreplay/btreplay.py
+++ b/client/tests/btreplay/btreplay.py
@@ -1,6 +1,6 @@
import time, os
-from autotest_lib.client.bin import test, os_dep, autotest_utils
-from autotest_lib.client.common_lib import error, utils
+from autotest_lib.client.bin import test, os_dep, utils
+from autotest_lib.client.common_lib import error
class btreplay(test.test):
@@ -9,7 +9,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['libaio'])
libs = '-L' + self.autodir + '/deps/libaio/lib -laio'
diff --git a/client/tests/cpu_hotplug/cpu_hotplug.py b/client/tests/cpu_hotplug/cpu_hotplug.py
index bfb629f..aafe37f 100644
--- a/client/tests/cpu_hotplug/cpu_hotplug.py
+++ b/client/tests/cpu_hotplug/cpu_hotplug.py
@@ -1,6 +1,5 @@
import time, os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class cpu_hotplug(test.test):
version = 2
@@ -8,22 +7,22 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
def initialize(self):
# Check if the kernel supports cpu hotplug
- if autotest_utils.running_config():
- autotest_utils.check_for_kernel_feature('HOTPLUG_CPU')
+ if utils.running_config():
+ utils.check_for_kernel_feature('HOTPLUG_CPU')
# Check cpu nums, if equals 1, quit.
- if autotest_utils.count_cpus() == 1:
+ if utils.count_cpus() == 1:
print 'Just only single cpu online, quiting...'
sys.exit()
# Have a simple and quick check first, FIX me please.
utils.system('dmesg -c > /dev/null')
- for cpu in autotest_utils.cpu_online_map():
+ for cpu in utils.cpu_online_map():
if os.path.isfile('/sys/devices/system/cpu/cpu%s/online' % cpu):
utils.system('echo 0 > /sys/devices/system/cpu/cpu%s/online' % cpu, 1)
utils.system('dmesg -c')
diff --git a/client/tests/dacapo/dacapo.py b/client/tests/dacapo/dacapo.py
index 549cc72..74d82dc 100644
--- a/client/tests/dacapo/dacapo.py
+++ b/client/tests/dacapo/dacapo.py
@@ -1,9 +1,9 @@
# Dacapo test suite wrapper
#
import os
-from autotest_lib.client.bin import autotest_utils, package, test
+from autotest_lib.client.bin import utils, package, test
from autotest_lib.client.bin.test_config import config_loader
-from autotest_lib.client.common_lib import error, utils
+from autotest_lib.client.common_lib import error
class dacapo(test.test):
@@ -55,7 +55,7 @@
e_msg = 'Could not read dacapo package md5sum from conf file'
raise error.TestError(e_msg)
self.dacapo_pkg = \
- autotest_utils.unmap_url_cache(self.cachedir, self.dacapo_url,
+ utils.unmap_url_cache(self.cachedir, self.dacapo_url,
self.dacapo_md5)
# Get jvm package URL
@@ -67,7 +67,7 @@
if not self.jvm_pkg_md5:
raise error.TestError('Could not read java package_md5 from conf file')
self.jvm_pkg = \
- autotest_utils.unmap_url_cache(self.cachedir, self.jvm_pkg_url,
+ utils.unmap_url_cache(self.cachedir, self.jvm_pkg_url,
self.jvm_pkg_md5)
# Install the jvm pakage
diff --git a/client/tests/dbench/dbench.py b/client/tests/dbench/dbench.py
index a54de17..6c4617d 100755
--- a/client/tests/dbench/dbench.py
+++ b/client/tests/dbench/dbench.py
@@ -1,7 +1,6 @@
import os, re
-from autotest_lib.client.bin import autotest_utils, test
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import utils, test
class dbench(test.test):
version = 3
@@ -9,7 +8,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('patch -p1 < ../dbench_startup.patch')
diff --git a/client/tests/dbt2/dbt2.py b/client/tests/dbt2/dbt2.py
index d0fd92b..9f341ef 100644
--- a/client/tests/dbt2/dbt2.py
+++ b/client/tests/dbt2/dbt2.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
# Dbt-2 is a fair-use implementation of the TPC-C benchmark. The test is
@@ -16,7 +15,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['pgsql', 'pgpool', 'mysql'])
#
diff --git a/client/tests/disktest/disktest.py b/client/tests/disktest/disktest.py
index ab91fde..c8b0a93 100755
--- a/client/tests/disktest/disktest.py
+++ b/client/tests/disktest/disktest.py
@@ -1,6 +1,6 @@
import os, sys, subprocess
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
class disktest(test.test):
@@ -29,7 +29,7 @@
def execute(self, disks = None, gigabytes = None,
- chunk_mb = autotest_utils.memtotal() / 1024):
+ chunk_mb = utils.memtotal() / 1024):
os.chdir(self.srcdir)
if not disks:
@@ -37,13 +37,13 @@
if not gigabytes:
free = 100 # cap it at 100GB by default
for disk in disks:
- free = min(autotest_utils.freespace(disk) / 1024**3, free)
+ free = min(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 = autotest_utils.memtotal()/1024
+ self.memory_mb = utils.memtotal()/1024
if self.memory_mb > chunk_mb:
e_msg = "Too much RAM (%dMB) for this test to work" % self.memory_mb
raise error.TestError(e_msg)
diff --git a/client/tests/fio/fio.py b/client/tests/fio/fio.py
index 096347c..08ae5d3 100644
--- a/client/tests/fio/fio.py
+++ b/client/tests/fio/fio.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class fio(test.test):
@@ -13,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['libaio'])
ldflags = '-L' + self.autodir + '/deps/libaio/lib'
diff --git a/client/tests/fs_mark/fs_mark.py b/client/tests/fs_mark/fs_mark.py
index 0f145d4..937694e 100644
--- a/client/tests/fs_mark/fs_mark.py
+++ b/client/tests/fs_mark/fs_mark.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class fs_mark(test.test):
@@ -13,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/fsdev/control b/client/tests/fsdev/control
index 6158c7a..b54a582 100644
--- a/client/tests/fsdev/control
+++ b/client/tests/fsdev/control
@@ -60,13 +60,13 @@
dir=disks[0]['mountpt'],
args='-l8 -u8 -M -s 8m -r16k +p80 -I -T -i0 -i8',
tag='small.'+tag)
- autotest_utils.drop_caches()
+ utils.drop_caches()
job.run_test('iozone',
dir=disks[0]['mountpt'],
args='-l8 -u8 -M -s 8g -r16k +p80 -I -T -i0 -i8',
tag='large.'+tag)
- autotest_utils.drop_caches()
+ utils.drop_caches()
# Clean up after the test
if using_one_disk:
diff --git a/client/tests/fsfuzzer/fsfuzzer.py b/client/tests/fsfuzzer/fsfuzzer.py
index f33d048..1c6e5e8 100755
--- a/client/tests/fsfuzzer/fsfuzzer.py
+++ b/client/tests/fsfuzzer/fsfuzzer.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class fsfuzzer(test.test):
@@ -13,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/fsstress/fsstress.py b/client/tests/fsstress/fsstress.py
index 6706782..9f81af6 100644
--- a/client/tests/fsstress/fsstress.py
+++ b/client/tests/fsstress/fsstress.py
@@ -1,7 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
-
+from autotest_lib.client.bin import test, utils
class fsstress(test.test):
@@ -14,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('patch -p1 < ../fsstress-ltp.patch')
diff --git a/client/tests/fsx/fsx.py b/client/tests/fsx/fsx.py
index 105ad87..38a3e26 100755
--- a/client/tests/fsx/fsx.py
+++ b/client/tests/fsx/fsx.py
@@ -4,8 +4,7 @@
# NOTE - this should also have the ability to mount a filesystem,
# run the tests, unmount it, then fsck the filesystem
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class fsx(test.test):
@@ -18,7 +17,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
self.job.setup_dep(['libaio'])
ldflags = '-L' + self.autodir + '/deps/libaio/lib'
@@ -38,8 +37,8 @@
dir = self.tmpdir
os.chdir(dir)
libs = self.autodir+'/deps/libaio/lib/'
- ld_path = autotest_utils.prepend_path(libs,
- autotest_utils.environ('LD_LIBRARY_PATH'))
+ ld_path = utils.prepend_path(libs,
+ utils.environ('LD_LIBRARY_PATH'))
var_ld_path = 'LD_LIBRARY_PATH=' + ld_path
cmd = self.srcdir + '/fsx-linux ' + args + ' poo'
utils.system(var_ld_path + ' ' + cmd)
diff --git a/client/tests/hackbench/hackbench.py b/client/tests/hackbench/hackbench.py
index 73b20d2..61323c2 100644
--- a/client/tests/hackbench/hackbench.py
+++ b/client/tests/hackbench/hackbench.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class hackbench(test.test):
diff --git a/client/tests/interbench/interbench.py b/client/tests/interbench/interbench.py
index c20bd54..c36d303 100644
--- a/client/tests/interbench/interbench.py
+++ b/client/tests/interbench/interbench.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class interbench(test.test):
@@ -13,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/iozone/iozone.py b/client/tests/iozone/iozone.py
index 9b4f4eb..e80c03b 100644
--- a/client/tests/iozone/iozone.py
+++ b/client/tests/iozone/iozone.py
@@ -1,7 +1,6 @@
#!/usr/bin/python
import os, re
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class iozone(test.test):
@@ -14,10 +13,10 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(os.path.join(self.srcdir, 'src/current'))
- arch = autotest_utils.get_current_kernel_arch()
+ arch = utils.get_current_kernel_arch()
if (arch == 'ppc'):
utils.system('make linux-powerpc')
elif (arch == 'ppc64'):
diff --git a/client/tests/iperf/iperf.py b/client/tests/iperf/iperf.py
index 69f1388..5e054f4 100644
--- a/client/tests/iperf/iperf.py
+++ b/client/tests/iperf/iperf.py
@@ -9,7 +9,7 @@
# http://downloads.sourceforge.net/iperf/iperf-2.0.4.tar.gz
def setup(self, tarball = 'iperf-2.0.4.tar.gz'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('./configure')
diff --git a/client/tests/isic/isic.py b/client/tests/isic/isic.py
index af59af7..07a86f1 100644
--- a/client/tests/isic/isic.py
+++ b/client/tests/isic/isic.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class isic(test.test):
@@ -16,7 +15,7 @@
def setup(self, tarball = 'isic-0.06.tar.bz2'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('patch -p1 < ../build-fixes.patch')
diff --git a/client/tests/kernbench/kernbench.py b/client/tests/kernbench/kernbench.py
index 732adfb..00edb8c 100755
--- a/client/tests/kernbench/kernbench.py
+++ b/client/tests/kernbench/kernbench.py
@@ -1,6 +1,5 @@
import re, pickle, os
-from autotest_lib.client.bin import autotest_utils, test
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import utils, test
class kernbench(test.test):
@@ -21,7 +20,7 @@
# On ia64, we default to 2.6.20, as it can't compile 2.6.14.
if version:
default_ver = version
- elif autotest_utils.get_current_kernel_arch() == 'ia64':
+ elif utils.get_current_kernel_arch() == 'ia64':
default_ver = '2.6.20'
else:
default_ver = '2.6.14'
@@ -80,6 +79,6 @@
def __format_results(self, results):
out = open('keyval', 'w')
- for result in autotest_utils.extract_all_time_results(results):
+ for result in utils.extract_all_time_results(results):
print >> out, "user=%s\nsystem=%s\nelapsed=%s\n" % result
out.close()
diff --git a/client/tests/kvmtest/control.with_modbuild b/client/tests/kvmtest/control.with_modbuild
index a620b6c..18c5d58 100644
--- a/client/tests/kvmtest/control.with_modbuild
+++ b/client/tests/kvmtest/control.with_modbuild
@@ -25,7 +25,7 @@
import test
import os, sys
from datetime import *
-from autotest_utils import *
+from utils import *
diff --git a/client/tests/kvmtest/kvmtest.py b/client/tests/kvmtest/kvmtest.py
index 666f23b..e2b77db 100644
--- a/client/tests/kvmtest/kvmtest.py
+++ b/client/tests/kvmtest/kvmtest.py
@@ -1,6 +1,6 @@
import random, os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
class kvmtest(test.test):
@@ -12,7 +12,7 @@
def setup(self, tarball = 'kvm-test.tar.gz'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('python setup.py install')
@@ -85,7 +85,7 @@
in the environment, then attempt to spawn a vncserver, and
change env DISPLAY so that kvmtest can run
"""
- for pidfile in autotest_utils.locate("*:*.pid", dirname):
+ for pidfile in utils.locate("*:*.pid", dirname):
pid = open(pidfile, 'r').readline().strip()
# if the server is still active, just use it for display
if os.path.exists('/proc/%s/status' % pid):
diff --git a/client/tests/libhugetlbfs/libhugetlbfs.py b/client/tests/libhugetlbfs/libhugetlbfs.py
index 18dcf35..dfaf263 100644
--- a/client/tests/libhugetlbfs/libhugetlbfs.py
+++ b/client/tests/libhugetlbfs/libhugetlbfs.py
@@ -1,6 +1,6 @@
import re, os
-from autotest_lib.client.bin import autotest_utils, test
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import utils, test
+from autotest_lib.client.common_lib import error
class libhugetlbfs(test.test):
version = 6
@@ -8,7 +8,7 @@
def initialize(self, dir = None, pages_requested = 20):
self.job.require_gcc()
- autotest_utils.check_kernel_ver("2.6.16")
+ utils.check_kernel_ver("2.6.16")
# Check huge page number
pages_available = 0
@@ -24,7 +24,7 @@
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'):
+ if not utils.file_contains_pattern('/proc/mounts', 'hugetlbfs'):
if not dir:
dir = os.path.join(self.tmpdir, 'hugetlbfs')
os.makedirs(dir)
@@ -35,7 +35,7 @@
# http://libhugetlbfs.ozlabs.org/releases/libhugetlbfs-2.0.tar.gz
def setup(self, tarball = 'libhugetlbfs-2.0.tar.gz'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
# make might fail if there are no proper headers for the 32 bit
diff --git a/client/tests/linus_stress/linus_stress.py b/client/tests/linus_stress/linus_stress.py
index fddb317..7ea4d98 100755
--- a/client/tests/linus_stress/linus_stress.py
+++ b/client/tests/linus_stress/linus_stress.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class linus_stress(test.test):
@@ -23,7 +22,7 @@
utils.write_one_line('/proc/sys/vm/dirty_background_ratio', '2')
cmd = os.path.join(self.srcdir, 'linus_stress')
- args = "%d" % (autotest_utils.memtotal() / 32)
+ args = "%d" % (utils.memtotal() / 32)
profilers = self.job.profilers
if profilers.present():
diff --git a/client/tests/lmbench/lmbench.py b/client/tests/lmbench/lmbench.py
index a65bfca..c375757 100755
--- a/client/tests/lmbench/lmbench.py
+++ b/client/tests/lmbench/lmbench.py
@@ -1,7 +1,6 @@
# This will need more work on the configuration stuff before it will function
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class lmbench(test.test):
@@ -17,7 +16,7 @@
# + lmbench3.diff
# removes Makefile references to bitkeeper
# default mail to no, fix job placement defaults (masouds)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/lsb_dtk/lsb_dtk.py b/client/tests/lsb_dtk/lsb_dtk.py
index f8d25df..770ec33 100644
--- a/client/tests/lsb_dtk/lsb_dtk.py
+++ b/client/tests/lsb_dtk/lsb_dtk.py
@@ -1,9 +1,9 @@
# Wrapper to LSB testsuite
# Copyright 2008, IBM Corp.
import os, glob, re
-from autotest_lib.client.bin import test, autotest_utils, package
+from autotest_lib.client.bin import test, utils, package
from autotest_lib.client.bin.test_config import config_loader
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.common_lib import error
__author__ = '''
@@ -14,7 +14,7 @@
class lsb_dtk(test.test):
version = 1
def get_lsb_arch(self):
- self.arch = autotest_utils.get_current_kernel_arch()
+ self.arch = utils.get_current_kernel_arch()
if self.arch in ['i386', 'i486', 'i586', 'i686', 'athlon']:
return 'ia32'
elif self.arch == 'ppc':
@@ -35,7 +35,7 @@
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 = autotest_utils.unmap_url_cache(cachedir, self.dtk_manager_url, self.dtk_md5)
+ self.dtk_manager_pkg = utils.unmap_url_cache(cachedir, self.dtk_manager_url, self.dtk_md5)
else:
raise error.TestError('Could not find DTK manager package md5, cannot cache DTK manager tarball')
@@ -50,11 +50,11 @@
self.lsb_md5 = my_config.get('lsb', self.md5_key)
if self.lsb_md5:
print 'Caching LSB tarball'
- self.lsb_pkg = autotest_utils.unmap_url_cache(self.cachedir, self.lsb_url, self.lsb_md5)
+ self.lsb_pkg = utils.unmap_url_cache(self.cachedir, self.lsb_url, self.lsb_md5)
else:
raise error.TestError('Could not find LSB package md5, cannot cache LSB tarball')
- autotest_utils.extract_tarball_to_dir(self.lsb_pkg, srcdir)
+ utils.extract_tarball_to_dir(self.lsb_pkg, srcdir)
# Lets load a file that contains the list of RPMs
os.chdir(srcdir)
diff --git a/client/tests/ltp/ltp.py b/client/tests/ltp/ltp.py
index 2f5d9cd..e8f4058 100755
--- a/client/tests/ltp/ltp.py
+++ b/client/tests/ltp/ltp.py
@@ -1,6 +1,6 @@
import os
-from autotest_lib.client.bin import autotest_utils, test
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import utils, test
+from autotest_lib.client.common_lib import error
class ltp(test.test):
version = 4
@@ -12,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('patch -p1 < ../ltp.patch')
@@ -24,7 +24,7 @@
utils.system('patch -p1 < ../ltp_capability.patch')
utils.system('cp ../scan.c pan/') # saves having lex installed
- utils.system('make -j %d' % autotest_utils.count_cpus())
+ utils.system('make -j %d' % utils.count_cpus())
utils.system('yes n | make install')
diff --git a/client/tests/memory_api/memory_api.py b/client/tests/memory_api/memory_api.py
index 954ebc5..fb58778 100755
--- a/client/tests/memory_api/memory_api.py
+++ b/client/tests/memory_api/memory_api.py
@@ -3,8 +3,8 @@
import re
import commands
-from autotest_lib.client.bin import autotest_utils, test
-from autotest_lib.client.common_lib import error, utils
+from autotest_lib.client.bin import utils, test
+from autotest_lib.client.common_lib import error
class memory_api(test.test):
version = 1
diff --git a/client/tests/netperf2/netperf2.py b/client/tests/netperf2/netperf2.py
index a8dcc77..d2774e5 100755
--- a/client/tests/netperf2/netperf2.py
+++ b/client/tests/netperf2/netperf2.py
@@ -9,7 +9,7 @@
# ftp://ftp.netperf.org/netperf/netperf-2.4.4.tar.gz
def setup(self, tarball = 'netperf-2.4.4.tar.gz'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
# Fixing up a compile issue under newer systems that have
diff --git a/client/tests/netpipe/netpipe.py b/client/tests/netpipe/netpipe.py
index c1c9bcc..2626af0 100644
--- a/client/tests/netpipe/netpipe.py
+++ b/client/tests/netpipe/netpipe.py
@@ -1,6 +1,6 @@
import os, time
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
class netpipe(test.test):
@@ -10,7 +10,7 @@
# http://www.scl.ameslab.gov/netpipe/code/NetPIPE-3.7.1.tar.gz
def setup(self, tarball='NetPIPE-3.7.1.tar.gz'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/parallel_dd/parallel_dd.py b/client/tests/parallel_dd/parallel_dd.py
index b5f0d6b..d50b09a 100755
--- a/client/tests/parallel_dd/parallel_dd.py
+++ b/client/tests/parallel_dd/parallel_dd.py
@@ -1,6 +1,6 @@
import os, re, time, subprocess, sys
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
class parallel_dd(test.test):
diff --git a/client/tests/perfmon/perfmon.py b/client/tests/perfmon/perfmon.py
index 34f05ea..7ccd343 100755
--- a/client/tests/perfmon/perfmon.py
+++ b/client/tests/perfmon/perfmon.py
@@ -1,6 +1,6 @@
import os, re
-from autotest_lib.client.bin import autotest_utils, test
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import utils, test
+from autotest_lib.client.common_lib import error
# test requires at least 2.6.26, will skip otherwise (check is internal)
class perfmon(test.test):
@@ -8,7 +8,7 @@
def setup(self, tarball = 'perfmon-tests-0.3.tar.gz'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/pi_tests/pi_tests.py b/client/tests/pi_tests/pi_tests.py
index bb1cf14..f6f9020 100644
--- a/client/tests/pi_tests/pi_tests.py
+++ b/client/tests/pi_tests/pi_tests.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class pi_tests(test.test):
@@ -12,9 +11,9 @@
# http://www.stardust.webpages.pl/files/patches/autotest/pi_tests.tar.bz2
def setup(self, tarball = 'pi_tests.tar.bz2'):
- autotest_utils.check_glibc_ver('2.5')
+ utils.check_glibc_ver('2.5')
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/pktgen/pktgen.py b/client/tests/pktgen/pktgen.py
index 59afb84..b578066 100755
--- a/client/tests/pktgen/pktgen.py
+++ b/client/tests/pktgen/pktgen.py
@@ -1,6 +1,6 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
class pktgen(test.test):
@@ -47,6 +47,6 @@
file.write(command + '\n');
file.close
- if not autotest_utils.grep('Result: OK', self.pgdev):
- if not autotest_utils.grep('Result: NA', self.pgdev):
+ if not utils.grep('Result: OK', self.pgdev):
+ if not utils.grep('Result: NA', self.pgdev):
utils.system('cat ' + self.pgdev)
diff --git a/client/tests/posixtest/posixtest.py b/client/tests/posixtest/posixtest.py
index 469cf49..cf68e6d 100755
--- a/client/tests/posixtest/posixtest.py
+++ b/client/tests/posixtest/posixtest.py
@@ -1,8 +1,7 @@
# POSIX test suite wrapper class. More information about the suite can be found
# at http://posixtest.sourceforge.net/
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
__author__ = '''[email protected] (Mohammed Omar)'''
@@ -17,7 +16,7 @@
# 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)
+ 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 a456a4e..f2fdb80 100755
--- a/client/tests/reaim/reaim.py
+++ b/client/tests/reaim/reaim.py
@@ -1,7 +1,6 @@
# Needs autoconf & automake & libtool to be installed. Ewwwwwwwwwwwwwwwwwwwwww
import re, os
-from autotest_lib.client.bin import test, autotest_utils, os_dep
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils, os_dep
class reaim(test.test):
@@ -10,7 +9,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['libaio'])
libs = '-L' + self.autodir + '/deps/libaio/lib -laio'
diff --git a/client/tests/real_time_tests/real_time_tests.py b/client/tests/real_time_tests/real_time_tests.py
index 20bed32..dd915f6 100644
--- a/client/tests/real_time_tests/real_time_tests.py
+++ b/client/tests/real_time_tests/real_time_tests.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class real_time_tests(test.test):
version = 1
@@ -8,9 +7,9 @@
# http://git.kernel.org/?p=linux/kernel/git/galak/ltp.git;a=tree;f=testcases/realtime
def setup(self, tarball = 'realtime-latest-git-snapshot.tar.bz2'):
- autotest_utils.check_glibc_ver('2.5')
+ utils.check_glibc_ver('2.5')
self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('patch -p1 < ../path-fix.patch')
diff --git a/client/tests/rttester/rttester.py b/client/tests/rttester/rttester.py
index f28ad35..ca815ea 100644
--- a/client/tests/rttester/rttester.py
+++ b/client/tests/rttester/rttester.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils, os_dep
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils, os_dep
class rttester(test.test):
@@ -10,7 +9,7 @@
def setup(self, tarball = 'rttester.tar.bz2'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
def execute(self):
os.chdir(self.srcdir)
diff --git a/client/tests/scrashme/scrashme.py b/client/tests/scrashme/scrashme.py
index acaa9e4..f85fd97 100644
--- a/client/tests/scrashme/scrashme.py
+++ b/client/tests/scrashme/scrashme.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class scrashme(test.test):
@@ -13,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/shrink_slab/shrink_slab.py b/client/tests/shrink_slab/shrink_slab.py
index 651bfe7..7bc3eac 100755
--- a/client/tests/shrink_slab/shrink_slab.py
+++ b/client/tests/shrink_slab/shrink_slab.py
@@ -1,6 +1,6 @@
import os, time
-from autotest_lib.client.bin import test, autotest_utils, cpuset
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils, cpuset
+from autotest_lib.client.common_lib import error
class shrink_slab(test.test):
@@ -29,7 +29,7 @@
def test1(self):
# Check that slab is reclaimed from the current container when there is
# memory pressure.
- autotest_utils.drop_caches()
+ utils.drop_caches()
utils.system('rm -rf %s/*' % self.tmpdir)
os.chdir(self.tmpdir)
@@ -54,7 +54,7 @@
def test2(self):
# Check that slab is not reclaimed from the main container when there is
# memory pressure in another container.
- autotest_utils.drop_caches()
+ utils.drop_caches()
utils.system('rm -rf %s/*' % self.tmpdir)
os.chdir(self.tmpdir)
diff --git a/client/tests/sparse/sparse.py b/client/tests/sparse/sparse.py
index 1cf427b..2a9d68c 100755
--- a/client/tests/sparse/sparse.py
+++ b/client/tests/sparse/sparse.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils, kernel
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils, kernel
class sparse(test.test):
@@ -13,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/spew/spew.py b/client/tests/spew/spew.py
index 2fa3d9d..0cbfae1 100755
--- a/client/tests/spew/spew.py
+++ b/client/tests/spew/spew.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class spew(test.test):
@@ -13,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(self.tarball, self.srcdir)
+ utils.extract_tarball_to_dir(self.tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('./configure')
diff --git a/client/tests/stress/stress.py b/client/tests/stress/stress.py
index 813e04e..593c22a 100644
--- a/client/tests/stress/stress.py
+++ b/client/tests/stress/stress.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class stress(test.test):
@@ -13,7 +12,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('./configure')
@@ -22,7 +21,7 @@
def run_once(self, args = ''):
if not args:
- threads = 2*autotest_utils.count_cpus()
+ threads = 2*utils.count_cpus()
args = '-c %d -i %d -m %d -d %d -t 60 -v' % \
(threads, threads, threads, threads)
diff --git a/client/tests/sysbench/sysbench.py b/client/tests/sysbench/sysbench.py
index 3be41a9..dd42c93 100644
--- a/client/tests/sysbench/sysbench.py
+++ b/client/tests/sysbench/sysbench.py
@@ -1,6 +1,6 @@
import os, time, re, pwd
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
class sysbench(test.test):
@@ -13,7 +13,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
self.job.setup_dep(['pgsql', 'mysql'])
os.chdir(self.srcdir)
@@ -25,17 +25,17 @@
utils.system(
'PATH=%s/bin:$PATH ./configure --with-mysql=%s --with-pgsql'
% (pgsql_dir, mysql_dir))
- utils.system('make -j %d' % autotest_utils.count_cpus())
+ utils.system('make -j %d' % utils.count_cpus())
def run_once(self, db_type = 'pgsql', build = 1, \
- num_threads = autotest_utils.count_cpus(), max_time = 60, \
+ num_threads = utils.count_cpus(), max_time = 60, \
read_only = 0, args = ''):
plib = os.path.join(self.autodir, 'deps/pgsql/pgsql/lib')
mlib = os.path.join(self.autodir, 'deps/mysql/mysql/lib/mysql')
- ld_path = autotest_utils.prepend_path(plib,
- autotest_utils.environ('LD_LIBRARY_PATH'))
- ld_path = autotest_utils.prepend_path(mlib, ld_path)
+ ld_path = utils.prepend_path(plib,
+ utils.environ('LD_LIBRARY_PATH'))
+ ld_path = utils.prepend_path(mlib, ld_path)
os.environ['LD_LIBRARY_PATH'] = ld_path
# The databases don't want to run as root so run them as nobody
diff --git a/client/tests/tbench/tbench.py b/client/tests/tbench/tbench.py
index 5ab95d8..1d32207 100755
--- a/client/tests/tbench/tbench.py
+++ b/client/tests/tbench/tbench.py
@@ -1,6 +1,5 @@
import time, os, signal, re
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class tbench(test.test):
@@ -14,7 +13,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('./configure')
diff --git a/client/tests/tiobench/tiobench.py b/client/tests/tiobench/tiobench.py
index 1fd89cb..e0693aa 100644
--- a/client/tests/tiobench/tiobench.py
+++ b/client/tests/tiobench/tiobench.py
@@ -1,6 +1,5 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.bin import test, utils
class tiobench(test.test):
@@ -9,7 +8,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('make')
diff --git a/client/tests/tsc/tsc.py b/client/tests/tsc/tsc.py
index 0cebb30..fcd1e8e 100755
--- a/client/tests/tsc/tsc.py
+++ b/client/tests/tsc/tsc.py
@@ -1,6 +1,6 @@
import os, re
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
class tsc(test.test):
version = 2
diff --git a/client/tests/unixbench/unixbench.py b/client/tests/unixbench/unixbench.py
index 81e8fae..3bae385 100755
--- a/client/tests/unixbench/unixbench.py
+++ b/client/tests/unixbench/unixbench.py
@@ -1,6 +1,6 @@
import os
-from autotest_lib.client.bin import test, autotest_utils
-from autotest_lib.client.common_lib import utils, error
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
class unixbench(test.test):
@@ -16,7 +16,7 @@
# 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)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('patch -p1 < ../unixbench.patch')
diff --git a/client/tests/xmtest/xmtest.py b/client/tests/xmtest/xmtest.py
index 787b85e..d5f8040 100644
--- a/client/tests/xmtest/xmtest.py
+++ b/client/tests/xmtest/xmtest.py
@@ -4,8 +4,7 @@
# 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
+from autotest_lib.client.bin import test, utils
class xmtest(test.test):
@@ -23,7 +22,7 @@
# tar -czf xm-test.tgz xm-test
def setup(self, tarball = 'xm-test.tar.bz2'):
tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
- autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
+ utils.extract_tarball_to_dir(tarball, self.srcdir)
os.chdir(self.srcdir)
utils.system('./autogen')