From patchwork Thu Jul 15 15:57:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 112259 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6FFvee3008886 for ; Thu, 15 Jul 2010 15:57:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932936Ab0GOP5g (ORCPT ); Thu, 15 Jul 2010 11:57:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50922 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932437Ab0GOP5e (ORCPT ); Thu, 15 Jul 2010 11:57:34 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6FFvXst003636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Jul 2010 11:57:34 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6FFvX22008376; Thu, 15 Jul 2010 11:57:33 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o6FFvUQL021960; Thu, 15 Jul 2010 11:57:32 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 2/9] KVM test: allow definition of multiple cdroms Date: Thu, 15 Jul 2010 18:57:31 +0300 Message-Id: <1279209458-19590-2-git-send-email-mgoldish@redhat.com> In-Reply-To: <1279209458-19590-1-git-send-email-mgoldish@redhat.com> References: <1279209458-19590-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 15 Jul 2010 15:57:40 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 248aeca..bdc9aab 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -414,18 +414,13 @@ class VM: if smp: qemu_cmd += add_smp(help, smp) - iso = params.get("cdrom") - if iso: - iso = kvm_utils.get_path(root_dir, iso) - qemu_cmd += add_cdrom(help, iso, 2) - - # Even though this is not a really scalable approach, - # it doesn't seem like we are going to need more than - # 2 CDs active on the same VM. - iso_extra = params.get("cdrom_extra") - if iso_extra: - iso_extra = kvm_utils.get_path(root_dir, iso_extra) - qemu_cmd += add_cdrom(help, iso_extra, 3) + cdroms = kvm_utils.get_sub_dict_names(params, "cdroms") + for cdrom in cdroms: + cdrom_params = kvm_utils.get_sub_dict(params, cdrom) + iso = cdrom_params.get("cdrom") + if iso: + qemu_cmd += add_cdrom(help, kvm_utils.get_path(root_dir, iso), + cdrom_params.get("drive_index")) # We may want to add {floppy_otps} parameter for -fda # {fat:floppy:}/path/. However vvfat is not usually recommended. diff --git a/client/tests/kvm/tests.cfg.sample b/client/tests/kvm/tests.cfg.sample index 6d5f244..e01406e 100644 --- a/client/tests/kvm/tests.cfg.sample +++ b/client/tests/kvm/tests.cfg.sample @@ -13,8 +13,8 @@ include cdkeys.cfg # * All image files are expected under /tmp/kvm_autotest_root/images/ # * All iso files are expected under /tmp/kvm_autotest_root/isos/ qemu_img_binary = /usr/bin/qemu-img -image_name.* ?<= /tmp/kvm_autotest_root/images/ -cdrom.* ?<= /tmp/kvm_autotest_root/isos/ +image_name(_.*)? ?<= /tmp/kvm_autotest_root/images/ +cdrom(_.*)? ?<= /tmp/kvm_autotest_root/isos/ # Here are the test sets variants. The variant 'qemu_kvm_windows_quick' is # fully commented, the following ones have comments only on noteworthy points diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index c2def29..d0b8acb 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -3,9 +3,10 @@ # Define the objects we'll be using vms = vm1 images = image1 +cdroms = cd1 nics = nic1 monitors = humanmonitor1 -login_timeout = 360 + # Choose the main VM and monitor main_vm = vm1 main_monitor = humanmonitor1 @@ -33,8 +34,10 @@ qemu_img_binary = qemu-img smp = 1 mem = 512 image_size = 10G +drive_index_image1 = 0 shell_port = 22 display = vnc +drive_index_cd1 = 2 # Monitor params monitor_type = human @@ -56,6 +59,7 @@ run_tcpdump = yes # Misc profilers = kvm_stat +login_timeout = 360 # Tests @@ -1044,7 +1048,9 @@ variants: unattended_install.cdrom: timeout = 7200 finish_program = deps/finish.exe - cdrom_extra = windows/winutils.iso + cdroms += " extracd" + cdrom_extracd = windows/winutils.iso + drive_index_extracd = 3 migrate: migration_test_command = ver && vol migration_bg_command = start ping -t localhost