From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KMQYE-0001SV-Qu for qemu-devel@nongnu.org; Fri, 25 Jul 2008 12:53:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KMQYD-0001S3-0m for qemu-devel@nongnu.org; Fri, 25 Jul 2008 12:53:54 -0400 Received: from [199.232.76.173] (port=34983 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KMQYC-0001Rn-Ko for qemu-devel@nongnu.org; Fri, 25 Jul 2008 12:53:52 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:34509) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KMQYB-00071z-RC for qemu-devel@nongnu.org; Fri, 25 Jul 2008 12:53:52 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m6PGrkYp010156 for ; Fri, 25 Jul 2008 12:53:46 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m6PGrk5b110530 for ; Fri, 25 Jul 2008 10:53:46 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m6PGrkNu029868 for ; Fri, 25 Jul 2008 10:53:46 -0600 From: Ryan Harper Date: Fri, 25 Jul 2008 11:53:24 -0500 Message-Id: <1217004805-13955-1-git-send-email-ryanh@us.ibm.com> Subject: [Qemu-devel] [PATCH 0/1] integrate qemu-test into kvm-userspace Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org Cc: Anthony Liguori , Ryan Harper , qemu-devel@nongnu.org This patch provides a relatively simple method for exercising various features of qemu/kvm by interacting with the guest via serial and qemu via the monitor that individual developers can use to validate that their changes having broken fundamental feature/function. Such tests need to be very accessable and easy-to-use to encourge there use by users/developers. As a bonus, in-tree make test is trivially integrated into higher-level test frameworks such as autotest. Using such interfaces the guest requirements are very low (serial login) and thus we can execute tests across a large number of differing guests. Writing new test cases should also be fairly simple, for example, the host_shutdown.py test logic is as follows: def run_test(vm): vm.wait_for_boot() vm.login() vm.guest_command("echo pressing power button") output = vm.monitor_command('system_powerdown') if vm.wait_for_shutdown(): return 1 There is a configuration file (test/CONFIG) which can be used to provide per-distro overrides for various functions. The current defaults have been tested against: RHEL5, openSUSE 11, Ubuntu 8.04, and Fedora 9 w.r.t the regular expressions used for login, and prompt. Getting started is relatively simple for someone familiar with configuring a guest for serial login and boot output via serial. Once completed, add a file to $(TOPDIR)/test/images like the following: % cat images/rhel5.2 DISK="/home/rharper/work/images/rhel5.2_x86_64_10G.qcow2" COMMAND="qemu-system-x86_64 -m 512 -smp 2 -net tap -net nic,model=e1000 -net nic,model=rtl8139 -drive file=${DISK},if=ide,boot=on -vnc none" You can omit the COMMAND variable and a default qemu command will be run instead (see run.sh). For additional guest image or config just add a new file in the images dir. To run the tests, at the toplevel run: % make && sudo make test ************************************************************ Results: 5 passed, 4 FAILED passed: e820_memory.py:fedora-9-x86_64 passed: host_shutdown.py:fedora-9-x86_64 passed: networking.py:fedora-9-x86_64 passed: reboot.py:fedora-9-x86_64 passed: smp_hotplug.py:fedora-9-x86_64 FAILED: Test:host_reset.py,Image:fedora-9-x86_64 FAILED: Test:migrate.py,Image:fedora-9-x86_64 FAILED: Test:timedrift.py,Image:fedora-9-x86_64 FAILED: Test:writeverify.py,Image:fedora-9-x86_64 ************************************************************ Ultimately, I'd like to push this into qemu since nothing we're doing here is arch or kvm specific. To do so, I'd move the test bits into qemu/tests and invoke run.sh from there, iterating over the various QEMU_PROG names available for each configured TARGET_DIRS so that we support running when qemu has been configured with multiple targets. The current kvm-userspace integration handles removing and loading the compiled modules in the kernel dir and some additional symlink-fu to ensure we run qemu from the build tree and don't need to have run make install. This integration would stay in the kvm-userspace tree and change to recursing into qemu and invoking make test. There is still plenty to do on the framework as well as the test, but I wanted to get feedback on the current setup before investing significant efforts.