From patchwork Tue Sep 15 07:03:59 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: 47591 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 n8F74AHc004360 for ; Tue, 15 Sep 2009 07:04:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758139AbZIOHEF (ORCPT ); Tue, 15 Sep 2009 03:04:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758133AbZIOHEE (ORCPT ); Tue, 15 Sep 2009 03:04:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65456 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758118AbZIOHEB (ORCPT ); Tue, 15 Sep 2009 03:04:01 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8F744GO007681; Tue, 15 Sep 2009 03:04:04 -0400 Received: from localhost.localdomain (vpn-12-102.rdu.redhat.com [10.11.12.102]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8F73xfq010763; Tue, 15 Sep 2009 03:04:03 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH 2/2] KVM test: Fixing KVM release tag detection Date: Tue, 15 Sep 2009 04:03:59 -0300 Message-Id: <1252998239-4949-2-git-send-email-lmr@redhat.com> In-Reply-To: <1252998239-4949-1-git-send-email-lmr@redhat.com> References: <1252998239-4949-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Sourceforge changes again their URL schema so it's time to fix it. Signed-off-by: Lucas Meneghel Rodrigues --- client/tests/kvm/build.py | 4 +++- client/tests/kvm/control | 4 +++- client/tests/kvm/kvm_utils.py | 13 ++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/client/tests/kvm/build.py b/client/tests/kvm/build.py index 9ad0e92..f6856ad 100755 --- a/client/tests/kvm/build.py +++ b/client/tests/kvm/build.py @@ -129,9 +129,11 @@ class SourceDirInstaller: 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") diff --git a/client/tests/kvm/control b/client/tests/kvm/control index 5e8d857..72658f1 100644 --- a/client/tests/kvm/control +++ b/client/tests/kvm/control @@ -93,7 +93,9 @@ params = { ## 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 diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index e73346e..b0c2119 100644 --- a/client/tests/kvm/kvm_utils.py +++ b/client/tests/kvm/kvm_utils.py @@ -282,18 +282,17 @@ def kill_process_tree(pid, sig=signal.SIGKILL): safe_kill(pid, signal.SIGCONT) -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,