-- Note: Links & email addy--expired. This information is most useful 'if updated'. Thanks: stanz

Running automated desktop tests on real hardware is useful, but can be dangerous to your data. Thus, it's often best to run them in an emulated or virtual machine. This page tells you how to do that with KVM. Note that your host machine, the one that runs KVM, needs to be fairly fast, and should have a lof of RAM.

There is a Qemu image file for running automated tests, which has all the things you need pre-installed and pre-configured. It also works for KVM. The address is below, in a mangled form, to prevent anyone from accidentally downloading it. Remove ".not.really" from the end of the link to actually download it.


It is quite big, about 700 megabytes, even in its compressed form. You then need to uncompress it to use it, and that will require several gigabytes of space. To uncompress:

unlzma autoguitest.qemu.lzma

If you have login access to people.ubuntu.com, you can use rsync to update using the uncompressed version. Unfortunately, rsyncing the compressed version isn't useful. (We'll figure out a way to put the uncompressed version somewhere anyone can rsync, later.)

To use the image, you should set up KVM. See KvmVirtManagerEtc for the full story, but briefly:

apt-get install kvm
adduser $USERNAME kvm

You will then want to log out and and log back in. You should do this in hardy, not gutsy, since the version of kvm in hardy is much better.

To actually run the virtual machine, do this:

kvm -m 1024 autoguitest.qemu -snapshot

This boots a virtual instance of Ubuntu. "-m 1024" instructs kvm to give the emulated machine 1024 megabytes of emulated memory. If you have less than that real memory in your machine, use 512 or 256 instead. If you have less real memory than that, you probably don't want to use KVM, unless you are quite patient.

The "-snapshot" option means that KVM won't write any of the changes you make back to the autoguitest.qemu file, but to a temporary location instead. This means that you can do anthing you like and it will be OK. If you do want to save your changes, please first make a copy of the autoguitest.qemu file so that you can always get back to a known, working state. (And also, so you can efficiently update it with rsync.)

When you get to the graphical login screen, you need to log in. The username is "tomjon" and the password is "password1".

After you have logged in, open a terminal window and run the following commands in the shell:

sudo ./reinstall.sh

The reinstall.sh script removes and then reinstalls the packages with the automated testing scripts, and the second command actually runs them.

How to determine if the test succeeded: if there are no error messages from the hwtest-desktop-cli command, and no other windows left open when it finished except the terminal window you ran it from, then all is OK. If not, there is a problem and you should report it.

Currently, LarsWirzenius (lars@ubuntu.com) is the best target for reports. Once any problems with the test setup get shaken out, you can start reporting normal bugs directly to Launchpad.

Testing/Automation/KVM (last edited 2011-01-24 03:47:11 by 64)