public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: Autotest mailing list <autotest@test.kernel.org>
Cc: KVM mailing list <kvm@vger.kernel.org>
Subject: [PATCH] Autotest 0.11.1: KVM test: Unbreaking release tag detection
Date: Wed, 16 Sep 2009 15:47:02 -0300	[thread overview]
Message-ID: <1253126822.2882.7.camel@localhost.localdomain> (raw)

This makes the KVM release tag detection fix available for autotest
0.11.1.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
---

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")


                 reply	other threads:[~2009-09-16 18:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1253126822.2882.7.camel@localhost.localdomain \
    --to=lmr@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox