@@ -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")
@@ -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
@@ -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,
Sourceforge changes again their URL schema so it's time to fix it. Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> --- 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(-)