diff options
Diffstat (limited to 'rhumba.py')
-rwxr-xr-x | rhumba.py | 57 |
1 files changed, 17 insertions, 40 deletions
@@ -20,7 +20,9 @@ # MA 02110-1301 USA import emulab_support as es +import jfed_support as js import abc +import getpass # Represents generic testbed info # @@ -30,8 +32,7 @@ import abc # @exp_name [string] experiment name # class Testbed: - def __init__(self, username = "", password = "", - proj_name = "", exp_name = ""): + def __init__(self, exp_name, username, password, proj_name): self.username = username self.password = password self.proj_name = proj_name @@ -41,58 +42,37 @@ class Testbed: def create_experiment(self, nodes, links): return - @abc.abstractmethod - def swap_exp_in(self): - return - - @abc.abstractmethod - def wait_until_nodes_up(self): - return - - @abc.abstractmethod - def complete_experiment_graph(self, nodes, links): - return - - @abc.abstractmethod - def execute_command(self, hostname, command, time_out = 3): - return - - @abc.abstractmethod - def copy_file_to_testbed(self, hostname, text, file_name): - return - # Represents an emulab testbed info # # @url [string] URL of the testbed # @image [string] specific image to use # class EmulabTestbed: - def __init__(self, username = "", password = "", - proj_name = "ARCFIRE", exp_name = "", - url = "wall1.ilabt.iminds.be", + def __init__(self, exp_name, username, password = "", + proj_name = "ARCFIRE", url = "wall1.ilabt.iminds.be", image = "UBUNTU14-64-STD"): - Testbed.__init__(self, username, password, - proj_name, exp_name) + Testbed.__init__(self, exp_name, username, password, proj_name) self.url = url self.image = image def create_experiment(self, nodes, links): es.create_experiment(self, nodes, links) - - def swap_exp_in(self): es.swap_exp_in(self) - - def wait_until_nodes_up(self): es.wait_until_nodes_up(self) - - def complete_experiment_graph(self, nodes, links): es.complete_experiment_graph(self, nodes, links) - def execute_command(self, hostname, command, time_out = 3): - es.execute_command(self, hostname, command, time_out = 3) +class jFedTestbed: + def __init__(self, exp_name, username, cert_file, jfed_jar, exp_hours = "2", + proj_name = "ARCFIRE", authority = "wall2.ilabt.iminds.be"): + passwd = getpass.getpass(prompt = "Password for certificate file: ") + Testbed.__init__(self, exp_name, username, passwd, proj_name) + self.authority = "urn:publicid:IDN+" + authority + "+authority+cm" + self.cert_file = cert_file + self.jfed_jar = jfed_jar + self.exp_hours = exp_hours - def copy_file_to_testbed(self, hostname, text, file_name): - es.copy_file_to_testbed(self, hostname, text, file_name) + def create_experiment(self, nodes, links): + js.create_experiment(self, nodes, links) # Represents an interface on a node # @@ -295,9 +275,6 @@ class Experiment: def run(self): self.links = get_links(self.nodes) self.testbed.create_experiment(self.nodes, self.links) - self.testbed.swap_exp_in() - self.testbed.wait_until_nodes_up() - self.testbed.complete_experiment_graph(self.nodes, self.links) # An experiment over the IRATI implementation class IRATIExperiment(Experiment): |