From patchwork Wed Sep 16 18:47:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 48051 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8GIlBOO010254 for ; Wed, 16 Sep 2009 18:47:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754214AbZIPSrF (ORCPT ); Wed, 16 Sep 2009 14:47:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753485AbZIPSrF (ORCPT ); Wed, 16 Sep 2009 14:47:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28675 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752853AbZIPSrD (ORCPT ); Wed, 16 Sep 2009 14:47:03 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8GIl6o2018162; Wed, 16 Sep 2009 14:47:06 -0400 Received: from [10.11.12.159] (vpn-12-159.rdu.redhat.com [10.11.12.159]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8GIl4Nn029288; Wed, 16 Sep 2009 14:47:05 -0400 Subject: [PATCH] Autotest 0.11.1: KVM test: Unbreaking release tag detection From: Lucas Meneghel Rodrigues To: Autotest mailing list Cc: KVM mailing list Date: Wed, 16 Sep 2009 15:47:02 -0300 Message-Id: <1253126822.2882.7.camel@localhost.localdomain> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This makes the KVM release tag detection fix available for autotest 0.11.1. Signed-off-by: Lucas Meneghel Rodrigues --- -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: 0.11.1/client/tests/kvm/control =================================================================== --- 0.11.1/client/tests/kvm/control (revision 3662) +++ 0.11.1/client/tests/kvm/control (working copy) @@ -91,8 +91,11 @@ ## specify a release tag. If you omit it, the test will get the latest ## release tag available. #"release_tag": '84', - "release_dir": 'http://downloads.sourceforge.net/kvm/', + "release_dir": 'http://downloads.sourceforge.net/project/kvm/', + # This is the place that contains the sourceforge project list of files + "release_listing": 'http://sourceforge.net/projects/kvm/files/', + ## Install from a kvm snapshot location ("mode": "snapshot"). You can ## optionally specify a snapshot date. If you omit it, the test will get ## yesterday's snapshot. Index: 0.11.1/client/tests/kvm/kvm_utils.py =================================================================== --- 0.11.1/client/tests/kvm/kvm_utils.py (revision 3662) +++ 0.11.1/client/tests/kvm/kvm_utils.py (working copy) @@ -127,18 +127,17 @@ return False -def get_latest_kvm_release_tag(release_dir): +def get_latest_kvm_release_tag(release_listing): """ Fetches the latest release tag for KVM. - @param release_dir: KVM source forge download location. + @param release_listing: URL that contains a list of the Source Forge + KVM project files. """ try: - page_url = os.path.join(release_dir, "showfiles.php") - local_web_page = utils.unmap_url("/", page_url, "/tmp") - f = open(local_web_page, "r") - data = f.read() - f.close() + release_page = utils.urlopen(release_listing) + data = release_page.read() + release_page.close() rx = re.compile("kvm-(\d+).tar.gz", re.IGNORECASE) matches = rx.findall(data) # In all regexp matches to something that looks like a release tag, Index: 0.11.1/client/tests/kvm/kvm_install.py =================================================================== --- 0.11.1/client/tests/kvm/kvm_install.py (revision 3662) +++ 0.11.1/client/tests/kvm/kvm_install.py (working copy) @@ -129,9 +129,11 @@ if install_mode == 'release': release_tag = params.get("release_tag") release_dir = params.get("release_dir") + release_listing = params.get("release_listing") logging.info("Installing KVM from release tarball") if not release_tag: - release_tag = kvm_utils.get_latest_kvm_release_tag(release_dir) + release_tag = kvm_utils.get_latest_kvm_release_tag( + release_listing) tarball = os.path.join(release_dir, "kvm-%s.tar.gz" % release_tag) logging.info("Retrieving release kvm-%s" % release_tag) tarball = utils.unmap_url("/", tarball, "/tmp")