aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-03-27 16:40:59 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-28 16:41:40 +0200
commite694075c7fdcc9c4579d55b792da7a1391401b35 (patch)
treecc75c83e5ef17133c2f9e754be3eb0ebee4d6984 /rumba/prototypes
parenta1bddf0ab2cd7bee30b1f0dc1575c0b8c532e157 (diff)
downloadrumba-e694075c7fdcc9c4579d55b792da7a1391401b35.tar.gz
rumba-e694075c7fdcc9c4579d55b792da7a1391401b35.zip
testbeds, prototypes, model: Add docstrings
This adds docstrings for methods of in the testbeds, prototypes and certain things in the model.
Diffstat (limited to 'rumba/prototypes')
-rw-r--r--rumba/prototypes/irati.py24
-rw-r--r--rumba/prototypes/ouroboros.py12
-rw-r--r--rumba/prototypes/rlite.py12
3 files changed, 35 insertions, 13 deletions
diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py
index b951d58..4619785 100644
--- a/rumba/prototypes/irati.py
+++ b/rumba/prototypes/irati.py
@@ -38,8 +38,10 @@ import rumba.log as log
logger = log.get_logger(__name__)
-# An experiment over the IRATI implementation
class Experiment(mod.Experiment):
+ """
+ Represents an IRATI experiment.
+ """
@staticmethod
def make_executor(node, packages, testbed):
@@ -62,6 +64,16 @@ class Experiment(mod.Experiment):
def __init__(self, testbed, nodes=None,
git_repo='https://github.com/IRATI/stack',
git_branch='arcfire', installpath=None, varpath=None):
+ """
+ Initializes the experiment class.
+
+ :param testbed: The testbed to run the experiment on.
+ :param nodes: The list of nodes.
+ :param git_repo: The git repository to use for installation.
+ :param git_branch: The branch of the git repository to use.
+ :param installpath: The installation path of IRATI.
+ :param varpath: The /var path of IRATI.
+ """
mod.Experiment.__init__(self,
testbed,
nodes,
@@ -94,7 +106,6 @@ class Experiment(mod.Experiment):
return os.path.join(self._conf_dir, path)
def install(self):
- """Installs IRATI on the nodes."""
packages = ["g++", "gcc", "libtool", "linux-headers-$(uname -r)",
"autoconf", "automake", "protobuf-compiler",
@@ -117,7 +128,6 @@ class Experiment(mod.Experiment):
m_processing.call_in_parallel(names, args, executors)
def bootstrap_network(self):
- """Creates the network by enrolling and configuring the nodes"""
for node in self.nodes:
self.process_node(node)
self.enroll_nodes()
@@ -135,12 +145,6 @@ class Experiment(mod.Experiment):
logger.info("IPCPs created and enrolled on all nodes")
def process_node(self, node):
- """
- Installs the configuration and boots up rina on a node
- :type node: mod.Node
- :param node:
- :return:
- """
name = node.name
vlans = []
@@ -200,7 +204,6 @@ class Experiment(mod.Experiment):
ssh.execute_commands(self.testbed, node.ssh_config, cmds)
def enroll_nodes(self):
- """Runs the enrollments one by one, respecting dependencies"""
logger.info("Starting enrollment phase.")
time.sleep(5)
for enrollment_list in self.enrollments:
@@ -237,7 +240,6 @@ class Experiment(mod.Experiment):
return dif.name
def write_conf(self):
- """Write the configuration files"""
# Constants and initializations
ipcmconfs = dict()
difconfs = dict()
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py
index 97f6e1a..dfbde9b 100644
--- a/rumba/prototypes/ouroboros.py
+++ b/rumba/prototypes/ouroboros.py
@@ -38,11 +38,21 @@ import rumba.testbeds.dockertb as docker
logger = log.get_logger(__name__)
-# An experiment over the Ouroboros implementation
class Experiment(mod.Experiment):
+ """
+ Represents an Ouroboros experiment.
+ """
def __init__(self, testbed, nodes=None,
git_repo='git://ouroboros.ilabt.imec.be/ouroboros',
git_branch='master'):
+ """
+ Initializes the experiment class.
+
+ :param testbed: The testbed to run the experiment on.
+ :param nodes: The list of nodes.
+ :param git_repo: The git repository to use for installation.
+ :param git_branch: The branch of the git repository to use.
+ """
mod.Experiment.__init__(self, testbed, nodes, git_repo, git_branch)
self.r_ipcps = dict()
diff --git a/rumba/prototypes/rlite.py b/rumba/prototypes/rlite.py
index e1b3745..c056b2f 100644
--- a/rumba/prototypes/rlite.py
+++ b/rumba/prototypes/rlite.py
@@ -35,12 +35,22 @@ import time
logger = log.get_logger(__name__)
-# An experiment over the rlite implementation
class Experiment(mod.Experiment):
+ """
+ Represents an rlite experiment.
+ """
def __init__(self, testbed, nodes=None,
git_repo='https://github.com/vmaffione/rlite',
git_branch='master'):
+ """
+ Initializes the experiment class.
+
+ :param testbed: The testbed to run the experiment on.
+ :param nodes: The list of nodes.
+ :param git_repo: The git repository to use for installation.
+ :param git_branch: The branch of the git repository to use.
+ """
mod.Experiment.__init__(self, testbed, nodes, git_repo, git_branch,
prototype_logs=['/tmp/uipcp.log'])