diff options
-rw-r--r-- | rumba/testbeds/jfed.py | 19 | ||||
-rw-r--r-- | setup.py | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py index f09bb4e..8ad173b 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() @@ -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"] ) |