KVM-Autotest-Docs
Introduction
Recent autotest supports passing test parameters to control file through --args options. This is also been introduced in kvm-autotest which can let user do some basic tests configurations (variants limitation or excluding, parameters configuration) through command line.
You should have some basic understanding of the test parameters and configuration file format before using the command line. If not, you are suggested to read the test configuration file format and test parameters before continuing.
How to use
It's very simple for you to use the command line, suppose you are in the directory of kvm subtest, you can pass test parameters through:
../../bin/autotest control --args="key1=value1 key2=value2 ...... keyN=valueN"
KVM-Autotest supports two kinds of parameters:
- keywords "only" and "no": they serve as the same function as in configuration file, limit and exclude variants.
- For each "only=x", the control file would generate a "only x" and pass it to the configuration file analyzer
- For each "no=y", the control would generate a "no y" and pass it to the configuration file analyzer
- test parameters: all other are passed to the configuration analyzer untouched, that is to say, you could specify any test parameters by this way.
Limitations
The command line parameters interface can not provide the same flexibility as the configuration file and have the following limitations:
- The generation of the final test matrix still depends on the configuration file, you still need it as a base and do test. You still need a test template such as tests.cfg in order to utilize the command line interface.
- As all test parameters passed from the command line and analyzed after the configuration file, so any test parameters would override ALL previous ones defined in configuration file. So the command line interface is good at being used to do small configuration modifications to just one test.
- It can not be used to adding variants, if you want them, you must edit the configuration file.
Examples
Suppose you use the default tests.cfg.sample as the tests.cfg. The first step is comment the last line
As the default test matrix too huge to run, so the second thing is to know the eight kinds of variants which could be used to reduce the matrix.
- Operating Systems: We must specify the type of operating system of the image through which KVM-Autoest can decide the os-dependent parameters such as shell client and others. You can take a look at test_base.cfg.sample to get the accurate names.
- Test cases: The test case you want to run, see test_base.cfg.sample for details
- Type of virtual network card:
- {|
! variant name ! type |- | rtl8139 | Realtek 8139 |- | virtio_net | Virtio network card |- | e1000 | Interl e1000 network adapter |}
- Type of block device:
- {|
! variant name ! type |- | ide | IDE drive |- | scsi | SCSI drive |- | virtio_blk | Virtio block drive |}
- Type of image format
- {|
! variant name ! type |- | qcow2 | Qemu Copy-On-Write Version 2 diskformat |- | raw | raw format |- | vmdk | VMWare Virtual Machine Disk format |}
- Num of vcpus
- {|
! variant name ! type |- | up | only use one vcpu |- | smp2 | use two vcpus |}
- If I have a pre-installed image (RHEL.5.5.x86_64 locate at /tmp/x.qcow2 with password XYZ, and I want to run a reboot test on it, how can I do this through command line?
../../bin/autotest control --args="only=full only=
TODO
- support parameters surrounded by quotes
- cli support for build?
- auto completion?