blob: d9ff70ce23d2b56a116ca4f93f5b3b14dca34a3b [file] [log] [blame]
AUTHOR = """
uril@redhat.com (Uri Lublin)
drusso@redhat.com (Dror Russo)
mgoldish@redhat.com (Michael Goldish)
dhuff@redhat.com (David Huff)
aeromenk@redhat.com (Alexey Eromenko)
mburns@redhat.com (Mike Burns)
"""
TIME = 'MEDIUM'
NAME = 'KVM test'
TEST_TYPE = 'client'
TEST_CLASS = 'Virtualization'
TEST_CATEGORY = 'Functional'
DOC = """
Executes the KVM test framework on a given host. This module is separated in
minor functions, that execute different tests for doing Quality Assurance on
KVM (both kernelspace and userspace) code.
For online docs, please refer to http://www.linux-kvm.org/page/KVM-Autotest
"""
import sys, os, logging
# Add the KVM tests dir to the python path
kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm')
sys.path.append(kvm_test_dir)
# Now we can import modules inside the KVM tests dir
import kvm_utils, kvm_config
# set English environment (command output might be localized, need to be safe)
os.environ['LANG'] = 'en_US.UTF-8'
str = """
# This string will be parsed after build.cfg. Make any desired changes to the
# build configuration here. For example:
#release_tag = 84
"""
parser = kvm_config.Parser()
parser.parse_file(os.path.join(kvm_test_dir, "build.cfg"))
parser.parse_string(str)
if not kvm_utils.run_tests(parser, job):
logging.error("KVM build step failed, exiting.")
sys.exit(1)
str = """
# This string will be parsed after tests.cfg. Make any desired changes to the
# test configuration here. For example:
#display = sdl
#install, setup: timeout_multiplier = 3
"""
parser = kvm_config.Parser()
parser.parse_file(os.path.join(kvm_test_dir, "tests.cfg"))
if args:
# We get test parameters from command line
for arg in args:
try:
(key, value) = re.findall("(.*)=(.*)", arg)[0]
if key == "only":
str += "only %s\n" % value
elif key == "no":
str += "no %s\n" % value
else:
str += "%s = %s\n" % (key, value)
except IndexError:
pass
parser.parse_string(str)
kvm_utils.run_tests(parser, job)
# Generate a nice HTML report inside the job's results dir
kvm_utils.create_report(kvm_test_dir, job.resultdir)