Skip to content

KVMAutotest TestStructure

adereis edited this page Jan 5, 2012 · 2 revisions

KVM autotest Test structure

Understanding the test structure better might help to understand the preparation steps better and therefore, making the whole process smoother, so you are advised to keep reading this session.

The KVM test is a regular autotest client test, but it has some distinctive characteristics, such as:

  • It's larger than the average autotest client test, and it has a significantly higher amount of files.
  • It has its own configuration files and configuration system

Top level files

  • kvm.py: This is the actual autotest kvm test class. As the KVM test spans through subtests, this is just a class that loads the kvm subtests, located under the tests directory accordingly.
  • control: The autotest control file. This is what the autotest client will parse in order to execute your set of tests. It is pretty much a python program and it supports all python syntax. The only thing you might find a bit weird is that the autotest client automatically brings into the control file namespace some names and objects that you don't see explicitely loaded in the file itself. Don't worry with this.
  • kvm_config.py: Test configuration parser and debugger. Prior to test execution, you can check what test configurations your config file yields by running it as a stand alone program.
  • address_pools.cfg.sample: Sample configuration file containing IP and mac address ranges for the VMs that will be used by the test in case you use TAP device mode for VM networking.
  • build.cfg.sample: Sample configuration file containing parameters for the build test. The build test is disabled by default.
  • cdkeys.cfg.sample: Sample configuration file containing CD keys. * tests_base.cfg.sample: Library with test functions.
  • tests.cfg.sample: Sample main configuration file.
  • kvm_preprocessing.py: Utility functions to create vms, and eventually modify their internal set of options.
  • kvm_subprocess.py: Library to control subprocesses attending to the very special needs of the kvm testing framework. It's mainly used to control qemu, even though it can be used by any subprocess.
  • kvm_vm.py: Contains the representation of a KVM based virtual machine. It implements its methods mainly by controlling and manipulating qemu processes.
  • kvm_utils.py: Utility functions.
  • kvm_test_utils.py: Higher level test utility functions.
  • ppm_utils.py: Utility functions to deal with ppm files (qemu screendump image files).
  • cd_hash.py: Program to calculate several types of hashes (md5, sha1) for CD images (well, in fact it could be used by any file).
  • common.py: Allows all stand alone programs inside this dir to load the autotest library.
  • html_report.py: This is a simple program that can parse autotest results and create a fancy (and static) HTML file with a structured execution report.
  • scan_results.py: Can scan autotest result directories and generate a textual results report.
  • step_editor.py: GTK+ application that can load and edit step files.

Subdirectory structure - static (part of the source distribution)

  • tests: Contains the KVM subtests. As tests are where the actual action happens.
  • scripts: Contains scripts that will be used to perform environment setup for some kvm subtests. Those scripts should be written in python when possible.
  • unattended: Contains unattended install files (kickstart for red hat based distros, answer files for windows). Unattended install is the default and preferred OS install method.
  • steps: Contains step files (those describe the OS install process for one of the guest OS install methods).
  • autoit: Contains scripts for the Windows GUI testing automation system autoit (http://www.autoitscript.com/autoit3/). It's used by the autoit kvm subtest.
  • autotest_control: Contains autotest control files that we desire to run on guests, used by the autotest subtest.
  • deps: Contains dependencies created specially for kvm testing. The rss remote shell for communication with windows guests is an example of external dependency.

Subdirectory structure - static (user have to provide)

  • isos: Contains iso files used to install operating systems on KVM guests. You need to provide a location with the needed CDs (you can figure out what those are by looking into the configuration file), either by symlinking an nfs share on your system with the CDs or any other method you rule as being convenient.
  • images: Will hold the virtual machine disk images that the test will generate as it is being executed. Please provide a location on your filesystem with plenty of space for kvm test usage.

Subdirectory structure - dynamically generated

  • src: qemu and kvm source code will be downloaded to this folder, provided that you run the build test.
  • build: If you choose to run the build test, KVM will be installed to this location and symlinks will be created accordingly.
Clone this wiki locally