aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvmaffione <[email protected]>2017-04-19 16:56:03 +0000
committervmaffione <[email protected]>2017-04-19 16:56:03 +0000
commit558682e5b59e1a62b92368a37d90cd2249e313c3 (patch)
treecff7f9ae4f355fd7ee122b5239065060b3d2d3ae
parent1d3022acb3fa3067f2027ae1a2c61aa99790c024 (diff)
parentb15b09cce8fa5870650d03c5087d9e0df29c24dc (diff)
downloadrumba-558682e5b59e1a62b92368a37d90cd2249e313c3.tar.gz
rumba-558682e5b59e1a62b92368a37d90cd2249e313c3.zip
Merge branch 'wget-jfed' into 'master'
testbeds: jfed: Download jFed CLI if not found See merge request !33
-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 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()
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"]
)