aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-04-14 11:11:14 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-04-14 11:11:14 +0200
commitb15b09cce8fa5870650d03c5087d9e0df29c24dc (patch)
tree7ba25be300426ee726f13501e6984fd8342ddf9a
parent5c8c06ec2dc08fc326357395b3044874122de658 (diff)
downloadrumba-b15b09cce8fa5870650d03c5087d9e0df29c24dc.tar.gz
rumba-b15b09cce8fa5870650d03c5087d9e0df29c24dc.zip
testbeds: jfed: Download jFed CLI if not found
If the jFed CLI was not found, then Rumba will download it in the current directory.
-rw-r--r--rumba/testbeds/jfed.py19
-rw-r--r--setup.py2
2 files changed, 18 insertions, 3 deletions
diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py
index 0dfc904..33d89f8 100644
--- a/rumba/testbeds/jfed.py
+++ b/rumba/testbeds/jfed.py
@@ -21,22 +21,37 @@
import subprocess
import getpass
import xml.dom.minidom as xml
+import os.path
+import wget
+import tarfile
import rumba.model as mod
class Testbed(mod.Testbed):
- def __init__(self, exp_name, username, cert_file, jfed_jar, exp_hours="2",
+ def __init__(self, exp_name, username, cert_file, exp_hours="2",
proj_name="ARCFIRE", authority="wall2.ilabt.iminds.be"):
passwd = getpass.getpass(prompt="Password for certificate file: ")
mod.Testbed.__init__(self, exp_name, username, passwd, proj_name)
self.authority = "urn:publicid:IDN+" + authority + "+authority+cm"
self.auth_name = authority
self.cert_file = cert_file
- self.jfed_jar = jfed_jar
self.exp_hours = exp_hours
self.if_id = dict()
self.rspec = self.exp_name + ".rspec"
self.manifest = self.exp_name + ".rrspec"
+ self.jfed_jar = "jfed_cli/experimenter-cli.jar"
+
+ if os.path.exists(self.jfed_jar) == False:
+ print("Couldn't find jFed CLI. Downloading.")
+ tarball = "jfed_cli.tar.gz"
+ url = "http://jfed.iminds.be/downloads/stable/jar/" + tarball
+ wget.download(url)
+ tar = tarfile.open(tarball)
+ tar.extractall()
+ tar.close()
+ print("Extracted in current directory")
+ os.remove(tarball)
+
def create_rspec(self, experiment):
impl = xml.getDOMImplementation()
diff --git a/setup.py b/setup.py
index 4b8afae..e294437 100644
--- a/setup.py
+++ b/setup.py
@@ -18,5 +18,5 @@ setup(
description = "Rumba measurement framework for RINA",
long_description = long_description,
packages = ["rumba", "rumba.testbeds", "rumba.prototypes"],
- install_requires = ["paramiko", "wheel"]
+ install_requires = ["paramiko", "wheel", "wget"]
)