aboutsummaryrefslogtreecommitdiff
path: root/rumba/testbeds
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-03-26 16:25:14 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-28 16:41:40 +0200
commita1bddf0ab2cd7bee30b1f0dc1575c0b8c532e157 (patch)
tree65172a461889ca93053187494a565423a54f112e /rumba/testbeds
parenta95c3b376053ed00f0e7184dbd228598a9aaf50f (diff)
downloadrumba-a1bddf0ab2cd7bee30b1f0dc1575c0b8c532e157.tar.gz
rumba-a1bddf0ab2cd7bee30b1f0dc1575c0b8c532e157.zip
rumba: Add Rumba documentation website
This adds a documentation website for Rumba which is triggered automatically after changes to master.
Diffstat (limited to 'rumba/testbeds')
-rw-r--r--rumba/testbeds/emulab.py74
-rw-r--r--rumba/testbeds/local.py27
2 files changed, 62 insertions, 39 deletions
diff --git a/rumba/testbeds/emulab.py b/rumba/testbeds/emulab.py
index 0d18892..605e326 100644
--- a/rumba/testbeds/emulab.py
+++ b/rumba/testbeds/emulab.py
@@ -42,16 +42,23 @@ logger = log.get_logger(__name__)
warnings.filterwarnings("ignore")
-
-# Represents an emulab testbed info
-#
-# @url [string] URL of the testbed
-# @image [string] specific image to use
-#
class Testbed(mod.Testbed):
+ """
+ Represents an emulab testbed.
+ """
def __init__(self, exp_name, username, password="",
proj_name="ARCFIRE", url="wall2.ilabt.iminds.be",
image="UBUNTU14-64-STD"):
+ """
+ Initializes the testbed class.
+
+ :param exp_name: The experiment name.
+ :param username: User of the experiment.
+ :param password: Password of the user.
+ :param proj_name: Project name of the experiment.
+ :param url: URL of the testbed.
+ :param image: Specific image to use.
+ """
mod.Testbed.__init__(self, exp_name, username, password, proj_name)
self.url = url
self.image = image
@@ -65,34 +72,28 @@ class Testbed(mod.Testbed):
def ops_server(self):
"""
- Return server name of the ops-server (is testbed specific)
+ Return server name of the ops-server (is testbed specific).
- @param self: testbed info
-
- @return: server name of the ops-server
+ :return: Server name of the ops-server.
"""
return 'ops.' + self.url
def full_name(self, node_name):
"""
- Return server name of a node
-
- @param node_name: name of the node
- @param self: testbed info
+ Return server name of a node.
- @return: server name of the node
+ :param node_name: Name of the node.
+ :return: Server name of the node.
"""
return node_name + '.' + self.exp_name + '.' + \
self.proj_name + '.' + self.url
def get_experiment_list(self, project_name=None):
"""
- Get list of made emulab experiments accessible with your credentials
+ Get list of made emulab experiments accessible with your credentials.
- @param self: testbed info
- @param project_name: optional filter on project
-
- @return: list of created experiments (strings)
+ :param project_name: Optional filter on project.
+ :return: List of created experiments.
"""
cmd = '/usr/testbed/bin/sslxmlrpc_client.py -m experiment getlist'
out = ssh.execute_command(self, self.ops_ssh_config, cmd)
@@ -107,11 +108,9 @@ class Testbed(mod.Testbed):
def swap_exp_in(self):
"""
- Swaps experiment in
+ Swaps experiment in.
- @param self: testbed info
-
- @return: Is the experiment newly swapped in
+ :return: Is the experiment newly swapped in?
"""
cmd = '/usr/testbed/bin/sslxmlrpc_client.py swapexp proj=' + \
self.proj_name + \
@@ -135,8 +134,7 @@ class Testbed(mod.Testbed):
"""
Creates an emulab experiment
- @param self: testbed info
- @param experiment: the experiment
+ :param experiment: The experiment.
"""
proj_name = self.proj_name
exp_name = self.exp_name
@@ -174,10 +172,8 @@ class Testbed(mod.Testbed):
Generate ns script based on network graph.
Enables to customize default node image.
- @param experiment: the experiment
- @param self: testbed info
-
- @return: ns2 script for Emulab experiment
+ :param experiment: The experiment.
+ :return: ns2 script for Emulab experiment.
"""
ns2_script = "# ns script generated by Rumba\n"
@@ -204,9 +200,7 @@ class Testbed(mod.Testbed):
def wait_until_nodes_up(self):
"""
- Checks if nodes are up
-
- @param self: testbed info
+ Checks if nodes are up.
"""
logger.info("Waiting until all nodes are up")
@@ -229,10 +223,9 @@ class Testbed(mod.Testbed):
def complete_experiment_graph(self, experiment):
"""
- Gets the interface (ethx) to link mapping
+ Gets the interface (ethx) to link mapping.
- @param self: testbed info
- @param experiment: the experiment
+ :param experiment: The experiment.
"""
for node in experiment.nodes:
@@ -272,6 +265,13 @@ class Testbed(mod.Testbed):
ipcp.ifname = item[0]
def _swap_in(self, experiment):
+ """
+ Swaps experiment in
+
+ :param experiment: The experiment.
+ """
+ mod.Testbed.swap_in(self, experiment)
+
self._create_experiment(experiment)
wait = self.swap_exp_in()
if wait:
@@ -282,7 +282,7 @@ class Testbed(mod.Testbed):
"""
Swaps experiment out
- @param self: testbed info
+ :param experiment: The experiment.
"""
cmd = '/usr/testbed/bin/sslxmlrpc_client.py swapexp proj=' + \
self.proj_name + \
diff --git a/rumba/testbeds/local.py b/rumba/testbeds/local.py
index 7c1aab1..068ee03 100644
--- a/rumba/testbeds/local.py
+++ b/rumba/testbeds/local.py
@@ -31,17 +31,40 @@ from rumba.executors.local import LocalExecutor
logger = log.get_logger(__name__)
-
-# Local testbed, useful for testing
class Testbed(mod.Testbed):
+ """
+ Local testbed, does not do anything. In the case of the Ouroboros
+ plugin this is useful since the Ouroboros plugin will simply create
+ processes locally. Also useful for debugging in the other plugins.
+ """
def __init__(self, exp_name, username, proj_name="ARCFIRE", password=""):
+ """
+ Initializes the parent class.
+
+ :param exp_name: The experiment name.
+ :param username: User of the experiment.
+ :param proj_name: Project name of the experiment.
+ :param password: Password of the user.
+ """
mod.Testbed.__init__(self, exp_name, username, password, proj_name)
self.executor = LocalExecutor(self)
def _swap_in(self, experiment):
+ """
+ Does not actually swap the experiment in.
+
+ :param experiment: The experiment object.
+ """
+ mod.Testbed.swap_in(self, experiment)
+
logger.info("Experiment swapped in")
def swap_out(self, experiment):
+ """
+ Does not actually swap the experiment out.
+
+ :param experiment: The experiment object.
+ """
logger.info("Experiment swapped out")