Home | History | Annotate | Download | only in kvm
      1 AUTHOR = """
      2 uril (a] redhat.com (Uri Lublin)
      3 drusso (a] redhat.com (Dror Russo)
      4 mgoldish (a] redhat.com (Michael Goldish)
      5 dhuff (a] redhat.com (David Huff)
      6 aeromenk (a] redhat.com (Alexey Eromenko)
      7 mburns (a] redhat.com (Mike Burns)
      8 """
      9 TIME = 'MEDIUM'
     10 NAME = 'KVM test'
     11 TEST_TYPE = 'client'
     12 TEST_CLASS = 'Virtualization'
     13 TEST_CATEGORY = 'Functional'
     14 
     15 DOC = """
     16 Executes the KVM test framework on a given host. This module is separated in
     17 minor functions, that execute different tests for doing Quality Assurance on
     18 KVM (both kernelspace and userspace) code.
     19 
     20 For online docs, please refer to http://www.linux-kvm.org/page/KVM-Autotest
     21 """
     22 
     23 import sys, os, logging
     24 from autotest_lib.client.common_lib import cartesian_config
     25 from autotest_lib.client.virt import virt_utils
     26 
     27 # set English environment (command output might be localized, need to be safe)
     28 os.environ['LANG'] = 'en_US.UTF-8'
     29 
     30 str = """
     31 # This string will be parsed after build.cfg.  Make any desired changes to the
     32 # build configuration here.  For example:
     33 #release_tag = 84
     34 """
     35 
     36 parser = cartesian_config.Parser()
     37 kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm')
     38 parser.parse_file(os.path.join(kvm_test_dir, "build.cfg"))
     39 parser.parse_string(str)
     40 if not virt_utils.run_tests(parser, job):
     41     logging.error("KVM build step failed, exiting.")
     42     sys.exit(1)
     43 
     44 str = """
     45 # This string will be parsed after tests.cfg.  Make any desired changes to the
     46 # test configuration here.  For example:
     47 #display = sdl
     48 #install, setup: timeout_multiplier = 3
     49 """
     50 
     51 parser = cartesian_config.Parser()
     52 parser.parse_file(os.path.join(kvm_test_dir, "tests.cfg"))
     53 
     54 if args:
     55     # We get test parameters from command line
     56     for arg in args:
     57         try:
     58             (key, value) = re.findall("^(\w+)=(.*)", arg)[0]
     59             if key == "only":
     60                 str += "only %s\n" % value
     61             elif key == "no":
     62                 str += "no %s\n" % value
     63             else:
     64                 str += "%s = %s\n" % (key, value)
     65         except IndexError:
     66             pass
     67 parser.parse_string(str)
     68 
     69 virt_utils.run_tests(parser, job)
     70