From patchwork Wed Nov 17 18:07:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 333821 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAHI7ENe004317 for ; Wed, 17 Nov 2010 18:07:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935096Ab0KQSHK (ORCPT ); Wed, 17 Nov 2010 13:07:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28525 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934809Ab0KQSHJ (ORCPT ); Wed, 17 Nov 2010 13:07:09 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAHI78Nh015628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Nov 2010 13:07:08 -0500 Received: from freedom.redhat.com (vpn-10-232.rdu.redhat.com [10.11.10.232]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAHI76jc002020; Wed, 17 Nov 2010 13:07:07 -0500 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, ehabkost@redhat.com, Lucas Meneghel Rodrigues Subject: [PATCH] KVM test: build subtest: Add path_to_rom_images Date: Wed, 17 Nov 2010 16:07:04 -0200 Message-Id: <1290017224-4298-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 (demeter1.kernel.org [140.211.167.41]); Wed, 17 Nov 2010 18:07:14 +0000 (UTC) diff --git a/client/tests/kvm/build.cfg.sample b/client/tests/kvm/build.cfg.sample index 860192b..b6a20f7 100644 --- a/client/tests/kvm/build.cfg.sample +++ b/client/tests/kvm/build.cfg.sample @@ -23,6 +23,9 @@ variants: # release_tag = 84 release_dir = http://downloads.sourceforge.net/project/kvm/ release_listing = http://sourceforge.net/projects/kvm/files/ + # In some cases, you might want to provide a ROM dir, so ROM + # files can be copied from there to your source based install + # path_to_rom_images = /usr/share/kvm - snapshot: mode = snapshot ## Install from a kvm snapshot location. You can optionally @@ -30,14 +33,23 @@ variants: ## yesterday's snapshot. # snapshot_date = 20090712 snapshot_dir = http://foo.org/kvm-snapshots/ + # In some cases, you might want to provide a ROM dir, so ROM + # files can be copied from there to your source based install + # path_to_rom_images = /usr/share/kvm - localtar: mode = localtar ## Install from tarball located on the host's filesystem. tarball = /tmp/kvm-84.tar.gz + # In some cases, you might want to provide a ROM dir, so ROM + # files can be copied from there to your source based install + # path_to_rom_images = /usr/share/kvm - localsrc: mode = localsrc ## Install from tarball located on the host's filesystem. srcdir = /tmp/kvm-84 + # In some cases, you might want to provide a ROM dir, so ROM + # files can be copied from there to your source based install + # path_to_rom_images = /usr/share/kvm - git: mode = git ## Install KVM from git repositories. @@ -64,6 +76,9 @@ variants: # kmod_lbranch = kmod_lbranch_name # kmod_commit = kmod_commit_name # kmod_patches = ['http://foo.com/patch1', 'http://foo.com/patch2'] + # In some cases, you might want to provide a ROM dir, so ROM + # files can be copied from there to your source based install + # path_to_rom_images = /usr/share/kvm - yum: mode = yum src_pkg = qemu diff --git a/client/tests/kvm/tests/build.py b/client/tests/kvm/tests/build.py index c4f0b18..bb3e2dc 100644 --- a/client/tests/kvm/tests/build.py +++ b/client/tests/kvm/tests/build.py @@ -154,6 +154,15 @@ def create_symlinks(test_bindir, prefix=None, bin_list=None, unittest=None): os.symlink(unittest, qemu_unittest_path) +def install_roms(rom_dir, prefix): + logging.debug("Path to roms specified. Copying roms to install prefix") + rom_dst_dir = os.path.join(prefix, 'share', 'qemu') + for rom_src in glob.glob('%s/*.bin' % rom_dir): + rom_dst = os.path.join(rom_dst_dir, os.path.basename(rom_src)) + logging.debug("Copying rom file %s to %s", rom_src, rom_dst) + shutil.copy(rom_src, rom_dst) + + def save_build(build_dir, dest_dir): logging.debug('Saving the result of the build on %s', dest_dir) base_name = os.path.basename(build_dir) @@ -314,6 +323,7 @@ class SourceDirInstaller(BaseInstaller): install_mode = params["mode"] srcdir = params.get("srcdir", None) + self.path_to_roms = params.get("path_to_rom_images", None) if install_mode == 'localsrc': if srcdir is None: @@ -391,6 +401,8 @@ class SourceDirInstaller(BaseInstaller): utils.system("make -C qemu install") elif self.repo_type == 2: utils.system("make install") + if self.path_to_roms: + install_roms(self.path_to_roms, self.prefix) create_symlinks(self.test_bindir, self.prefix) @@ -559,6 +571,8 @@ class GitInstaller(SourceDirInstaller): def _install(self): os.chdir(self.userspace_srcdir) utils.system('make install') + if self.path_to_roms: + install_roms(self.path_to_roms, self.prefix) create_symlinks(test_bindir=self.test_bindir, prefix=self.prefix, bin_list=None, unittest=self.unittest_prefix)