aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml11
-rw-r--r--README.md192
-rw-r--r--doc/conf.py41
-rw-r--r--doc/docker.rst13
-rw-r--r--doc/emulab.rst16
-rw-r--r--doc/index.rst57
-rw-r--r--doc/installation.rst21
-rw-r--r--doc/irati.rst9
-rw-r--r--doc/jfed.rst30
-rw-r--r--doc/local.rst5
-rw-r--r--doc/log.rst5
-rw-r--r--doc/model.rst5
-rw-r--r--doc/ouroboros.rst9
-rw-r--r--doc/qemu.rst13
-rw-r--r--doc/rlite.rst9
-rw-r--r--doc/storyboard.rst5
-rw-r--r--doc/utils.rst13
-rw-r--r--doc/workflow.rst44
-rw-r--r--rumba/_version.py2
-rw-r--r--rumba/log.py19
-rw-r--r--rumba/testbeds/emulab.py74
-rw-r--r--rumba/testbeds/local.py27
-rwxr-xr-xsetup.py6
23 files changed, 389 insertions, 237 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1f8d116..746475a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,3 +7,14 @@ before_script:
irati-test:
script:
- python examples/vpn.py
+
+pages:
+ stage: deploy
+ script:
+ - pip install sphinx
+ - sphinx-build doc/ public/
+ artifacts:
+ paths:
+ - public
+ only:
+ - doc
diff --git a/README.md b/README.md
index 6feafbc..f29c3dc 100644
--- a/README.md
+++ b/README.md
@@ -1,191 +1,5 @@
-# Rumba: A framework to bootstrap a RINA network on a testbed
-
Rumba is a Python framework that allows users to write Python scripts
-to define RINA networks and run scripted experiments. First, Rumba,
-creates a physical network on one of the selected testbed. If needed,
-Rumba can do an installation of the RINA prototype on the testbed
-machines. The RINA network is then bootstrapped on the available
-nodes. Finally, the experiment can be swapped out of the testbed.
-
-Example scripts can be found in the examples/ folder.
-
-## Workflow, both external and internal:
-
- 1. Define the network graph, creating instances of model.Node and
- model.DIF classes.
-
- 2. Create an instance of a Testbed class. See below for testbed
- specific configuration.
-
- 3. Create an instance of the prototype.Experiment class, passing the
- testbed instance and a list of Node instances.
-
- 1. At the end of the base Experiment constructor, the
- generate function is called to generate information about
- per-node IPCPs, registrations and enrollment, ready to be
- used by the plugins.
-
- 4. Call methods on the prototype.Experiment instance:
-
- 1. swap_in() swaps the experiment in on the testbed, and fills in
- the missing information in the model.
-
- 2. install_prototype() installs the chosen prototype on the
- testbed. Currently an Ubuntu image is assumed.
-
- 3. bootstrap_prototype() calls a prototype-specific setup function,
- to create the required IPCPs, perform registrations,
- enrollments, etc.
-
- 4. swap_out() swaps the experiment out of the testbed.
-
-## Installation
-
- For Debian and Ubuntu, the following command will ensure that the
- required dependencies are installed (replace python-dev with python3-dev
- if using Python 3):
-
- # apt-get install build-essential libssl-dev libffi-dev python-dev
-
- Rumba can be found on the
- [PyPi](https://pypi.python.org/pypi/Rumba) and can thus be
- installed through pip, by using `pip install rumba`. To install
- the latest version, cloning the repository and install it from the
- command line:
-
- # python setup.py install
-
-## Supported prototypes
-
- * [IRATI](https://github.com/IRATI/stack) is an open source
- implementation of the RINA architecture targeted at the OS/Linux
- system, initially developed by the FP7-IRATI project.
-
- * [rlite](https://github.com/vmaffione/rlite) is a lightweight Free
- and Open Source implementation of the Recursive InterNetwork
- Architecture (RINA) for GNU/Linux operating systems.
-
- * Ouroboros is a user-space implementation with a focus on
- portability. It is written in C89 and works on any POSIX.1-2001
- enabled system.
-
-## Supported testbeds
-
- * [QEMU](http://wiki.qemu-project.org/Main_Page) is a generic and
- open source machine emulator and virtualizer.
-
- In order to use the qemu testbed, the user should install the
- qemu and bredge-utils packages ion which the testbed depends:
-
- # sudo apt-get install bridge-utils qemu
-
- A minimal QEMU testbed is defined as follows:
-
- tb = qemu.Testbed(exp_name = "twolayers",
- username = "root",
- password = "root")
-
- A user can optionally also specify the path to a bzImage and to an
- initramfs. If they are not specified, the latest buildroot image
- for the specific prototype will be downloaded. (Around 40 MB in
- size) The login to those images is root/root.
-
- * [Emulab](https://www.emulab.net/) is a network testbed, giving
- researchers a wide range of environments in which to develop,
- debug, and evaluate their systems.
-
- An emulab testbed instance is defined as follows:
-
- tb = emulab.Testbed(exp_name = "rochefort10",
- username = "ricksanchez")
-
- A password can also be provided but is not necessary when an SSH
- key has been added. Optionally, a project name, a different testbed
- URL and a custom image can be specified.
-
- Issues have been reported that Rumba asks for the password even
- though a public key was added to the emulab interface. In this case
- a workaround is to start an ssh-agent and add the public key there.
-
- $ eval `ssh-agent`
- $ ssh-add /home/morty/.ssh/id_rsa.pub
-
- * [jFed](http://jfed.iminds.be/) is a Java-based framework for
- testbed federation.
-
- In order to use the jFed testbed, a user first needs to download
- his/her key from
- [https://authority.ilabt.iminds.be/](https://authority.ilabt.iminds.be/)
- After logging in, click on *Download your certificate*. Save the
- contents in a file (for example cert.pem). A jFed testbed instance
- is defined as follows:
-
- tb = jfed.Testbed(exp_name = "rochefort10",
- username = "ricksanchez",
- cert_file = "/home/morty/cert.pem")
-
- Here the experiment name is rochefort10, the user's name is
- ricksanchez, and the certificate can be found in
- /home/morty/cert.pem. An absolute path must be used for
- cert_file.
-
- To select a specific jFed testbed, set the authority parameter. The
- emulab and exogeni testbeds are stable and can be selected, for
- instance:
-
- authority = "wall2.ilabt.iminds.be",
-
- or
-
- authority = "exogeni.net",
-
- On the emulab testbeds, a specific machine image can be selected
- (set image_custom to True if you created a custom image):
-
- image = "irati171031",
- image_custom = True,
-
- Before running the rumba you must run an SSH agent in same terminal.
- This will also avoid you having to enter the passphrase for every
- login to a node by the framework if you are not on an IPv6 enabled network.
- (Apart from asking for the passphrase to login to the nodes, the framework
- will always ask for the passphrase since it is needed by the jFed
- CLI as well.) In order to start an SSH agent and to add the
- certificate, type the following commands:
-
- $ eval `ssh-agent`
- $ ssh-add /home/morty/cert.pem
-
- Pay attention to run your rumba script in the same terminal used
- for the previous commands, without changing the user (e.g. using su
- or sudo).
-
- * [Docker](https://www.docker.com/) is a container runtime environment.
-
- To use the Docker testbed the Docker software needs to be installed, see
- [Install Docker](https://docs.docker.com/install/) and complete
- [Post-installation steps for Linux](https://docs.docker
- .com/install/linux/linux-postinstall/)
-
- To use a Docker testbed you can for example use:
-
- tb = docker.Testbed(exp_name = "ouroboros",
- base_image = "ouroborosrumba/prototype")
-
- This will pull the latest ouroboros image from Docker Hub.
-
-## Accessing nodes after swap-in
-
- To access a node once the experiment swapped in, use the following
- command (in the same terminal where ssh-agent was run in case of jFed):
-
- $ rumba-access $NODE_NAME
-
- Where $NODE_NAME is the name of the node to access. In case of the
- QEMU testbed, the password of the downloaded buildroot images is
- 'root'.
-
-## Acknowledgements
+to define recursive internet networks and run scripted experiments.
- Rumba is developed as part of the ARCFIRE project, funded by the
- European commission under the H2020 framework. \ No newline at end of file
+The official documentation can be found
+[here](https://arcfire.gitlab.io/rumba/).
diff --git a/doc/conf.py b/doc/conf.py
new file mode 100644
index 0000000..0424dc7
--- /dev/null
+++ b/doc/conf.py
@@ -0,0 +1,41 @@
+from datetime import datetime
+
+import alabaster
+
+
+html_theme_path = [alabaster.get_path()]
+extensions = ['alabaster']
+html_theme = 'alabaster'
+
+html_theme_options = {
+ 'description': "Rumba: A framework to bootstrap a " +
+ "recursive internet network on a testbed."
+}
+
+html_sidebars = {
+ '**': [
+ 'about.html',
+ 'navigation.html',
+ 'searchbox.html'
+ ]
+}
+
+project = 'Rumba'
+year = datetime.now().year
+copyright = '{} imec, Nextworks S.r.l.'.format(year)
+author = 'Sander Vrijders, Marco Capitani, Dimitri Staessens, Vincenzo Maffione'
+master_doc = 'index'
+source_suffix = '.rst'
+default_role = 'obj'
+language = None
+
+extensions.extend(['sphinx.ext.autodoc'])
+autodoc_default_flags = ['members', 'special-members']
+
+_locals = {}
+with open('../rumba/_version.py') as fp:
+ exec(fp.read(), None, _locals)
+version = _locals['__version__']
+
+version = version
+release = version
diff --git a/doc/docker.rst b/doc/docker.rst
new file mode 100644
index 0000000..004240d
--- /dev/null
+++ b/doc/docker.rst
@@ -0,0 +1,13 @@
+Docker
+=============
+
+`Docker <https://www.docker.com/>`_ is a container runtime
+environment.
+
+To use the Docker testbed the Docker software needs to be installed,
+see `Install Docker <https://docs.docker.com/install/>`_ and complete
+`Post-installation steps for Linux
+<https://docs.docker.com/install/linux/linux-postinstall/>`_.
+
+.. automodule:: rumba.testbeds.dockertb
+ :member-order: bysource
diff --git a/doc/emulab.rst b/doc/emulab.rst
new file mode 100644
index 0000000..376f07d
--- /dev/null
+++ b/doc/emulab.rst
@@ -0,0 +1,16 @@
+Emulab
+=============
+
+`Emulab <https://www.emulab.net/>`_ is a network testbed, giving
+researchers a wide range of environments in which to develop, debug,
+and evaluate their systems.
+
+Issues have been reported that Rumba asks for the password even
+though a public key was added to the emulab interface. In this case
+a workaround is to start an ssh-agent and add the public key there. ::
+
+ $ eval `ssh-agent`
+ $ ssh-add /home/user/.ssh/id_rsa.pub
+
+.. automodule:: rumba.testbeds.emulab
+ :member-order: bysource
diff --git a/doc/index.rst b/doc/index.rst
new file mode 100644
index 0000000..7bbea39
--- /dev/null
+++ b/doc/index.rst
@@ -0,0 +1,57 @@
+====================================
+Welcome to the Rumba documentation!
+====================================
+
+Rumba is a Python framework that allows users to write Python scripts
+to define recursive internet networks and run scripted
+experiments. First, Rumba creates a physical network on one of the
+selected testbed plugins. If needed, Rumba can do an installation of
+the selected prototype plugin on the testbed machines. The network is
+then bootstrapped on the available nodes. Users can then run a
+Storyboard which emulates real network traffic. Finally, the
+experiment can be swapped out of the testbed.
+
+This site covers Rumba's usage and API documentation. The repository
+holding the code can be found `here
+<https://gitlab.com/arcfire/rumba>`_. Example scripts can be found in
+the examples/ folder.
+
+Please report any bugs or issues `here
+<https://gitlab.com/arcfire/rumba/issues>`_.
+
+Rumba is developed as part of the ARCFIRE project, funded by the
+European commission under the H2020 framework.
+
+General usage
+-------------------------
+
+.. toctree::
+ workflow
+ installation
+
+Rumba core
+-------------------------
+
+.. toctree::
+ model
+ log
+ storyboard
+ utils
+
+Testbed plugins
+-------------------------
+
+.. toctree::
+ docker
+ emulab
+ jfed
+ local
+ qemu
+
+Prototype plugins
+-------------------------
+
+.. toctree::
+ irati
+ rlite
+ ouroboros
diff --git a/doc/installation.rst b/doc/installation.rst
new file mode 100644
index 0000000..c2038d0
--- /dev/null
+++ b/doc/installation.rst
@@ -0,0 +1,21 @@
+Installation
+************************
+
+The easiest way to install Rumba is through pip. Rumba can be found on
+the `PyPi <https://pypi.python.org/pypi/Rumba>`_ and can thus be
+installed through pip. ::
+
+ $ pip install rumba
+
+Rumba supports both Python 2 and 3.
+
+For Debian and Ubuntu, the following command will ensure that the
+required dependencies are installed (replace python-dev with
+python3-dev if using Python 3): ::
+
+ $ apt-get install build-essential libssl-dev libffi-dev python-dev
+
+To install the latest version from source, clone the repository and
+install it from the command line: ::
+
+ $ python setup.py install
diff --git a/doc/irati.rst b/doc/irati.rst
new file mode 100644
index 0000000..c07feb1
--- /dev/null
+++ b/doc/irati.rst
@@ -0,0 +1,9 @@
+IRATI
+=============
+
+`IRATI <https://github.com/IRATI/stack>`_ is an open source
+implementation of the RINA architecture targeted at the OS/Linux
+system, initially developed by the FP7-IRATI project.
+
+.. automodule:: rumba.prototypes.irati
+ :member-order: bysource
diff --git a/doc/jfed.rst b/doc/jfed.rst
new file mode 100644
index 0000000..7ed9e88
--- /dev/null
+++ b/doc/jfed.rst
@@ -0,0 +1,30 @@
+jFed
+=============
+
+
+`jFed <http://jfed.iminds.be/>`_ is a Java-based framework for
+testbed federation.
+
+In order to use the jFed testbed, a user first needs to download
+his/her key from the `jFed authority
+<https://authority.ilabt.iminds.be/](https://authority.ilabt.iminds.be/>`_.
+After logging in, click on *Download your certificate*. Save the
+contents in a file (for example cert.pem).
+
+Before running Rumba you must run an SSH agent in same terminal. This
+will also avoid you having to enter the passphrase for every login to
+a node by the framework if you are not on an IPv6 enabled network.
+(Apart from asking for the passphrase to login to the nodes, the
+framework will always ask for the passphrase since it is needed by the
+jFed CLI as well.) In order to start an SSH agent and to add the
+certificate, type the following commands: ::
+
+ $ eval `ssh-agent`
+ $ ssh-add /home/morty/cert.pem
+
+Pay attention to run your rumba script in the same terminal used
+for the previous commands, without changing the user (e.g. using su
+or sudo).
+
+.. automodule:: rumba.testbeds.jfed
+ :member-order: bysource
diff --git a/doc/local.rst b/doc/local.rst
new file mode 100644
index 0000000..c55a275
--- /dev/null
+++ b/doc/local.rst
@@ -0,0 +1,5 @@
+Local
+=============
+
+.. automodule:: rumba.testbeds.local
+ :member-order: bysource
diff --git a/doc/log.rst b/doc/log.rst
new file mode 100644
index 0000000..6084cf2
--- /dev/null
+++ b/doc/log.rst
@@ -0,0 +1,5 @@
+Logging
+=============
+
+.. automodule:: rumba.log
+ :member-order: bysource
diff --git a/doc/model.rst b/doc/model.rst
new file mode 100644
index 0000000..b487263
--- /dev/null
+++ b/doc/model.rst
@@ -0,0 +1,5 @@
+Model
+=============
+
+.. automodule:: rumba.model
+ :member-order: bysource
diff --git a/doc/ouroboros.rst b/doc/ouroboros.rst
new file mode 100644
index 0000000..785bf92
--- /dev/null
+++ b/doc/ouroboros.rst
@@ -0,0 +1,9 @@
+Ouroboros
+=============
+
+`Ouroboros <https://ouroboros.ilabt.imec.be/>`_ is a user-space
+implementation with a focus on portability. It is written in C89 and
+works on any POSIX.1-2001 enabled system.
+
+.. automodule:: rumba.prototypes.ouroboros
+ :member-order: bysource
diff --git a/doc/qemu.rst b/doc/qemu.rst
new file mode 100644
index 0000000..ff1ede3
--- /dev/null
+++ b/doc/qemu.rst
@@ -0,0 +1,13 @@
+QEMU
+=============
+
+`QEMU <http://wiki.qemu-project.org/Main_Page>`_ is a generic and open
+source machine emulator and virtualizer.
+
+In order to use the qemu testbed, the user should install the qemu and
+bridge-utils packages on which the testbed depends: ::
+
+ $ sudo apt-get install bridge-utils qemu
+
+.. automodule:: rumba.testbeds.qemu
+ :member-order: bysource
diff --git a/doc/rlite.rst b/doc/rlite.rst
new file mode 100644
index 0000000..f58a16a
--- /dev/null
+++ b/doc/rlite.rst
@@ -0,0 +1,9 @@
+rlite
+=============
+
+`rlite <https://github.com/vmaffione/rlite>`_ is a lightweight Free
+and Open Source implementation of the Recursive InterNetwork
+Architecture (RINA) for GNU/Linux operating systems.
+
+.. automodule:: rumba.prototypes.rlite
+ :member-order: bysource
diff --git a/doc/storyboard.rst b/doc/storyboard.rst
new file mode 100644
index 0000000..085ea30
--- /dev/null
+++ b/doc/storyboard.rst
@@ -0,0 +1,5 @@
+Storyboard
+=============
+
+.. automodule:: rumba.storyboard
+ :member-order: bysource
diff --git a/doc/utils.rst b/doc/utils.rst
new file mode 100644
index 0000000..6df8a0c
--- /dev/null
+++ b/doc/utils.rst
@@ -0,0 +1,13 @@
+Utils
+=============
+
+.. autoclass:: rumba.utils.ExperimentManager
+ :member-order: bysource
+
+Example usage of the class:
+
+.. code-block:: python
+
+ with ExperimentManager(exp, swap_out_strategy=PROMPT_SWAPOUT):
+ exp.swap_in()
+ exp.bootstrap_prototype()
diff --git a/doc/workflow.rst b/doc/workflow.rst
new file mode 100644
index 0000000..04f23b1
--- /dev/null
+++ b/doc/workflow.rst
@@ -0,0 +1,44 @@
+Workflow
+************************
+
+1. Define the network graph, creating instances of model.Node and
+ model.DIF classes.
+
+2. Create an instance of a Testbed class.
+
+3. Create an instance of the selected prototype.Experiment class,
+ passing the testbed instance and a list of Node instances.
+
+ 1. At the end of the base Experiment constructor, the
+ generate function is called to generate information about
+ per-node IPCPs, registrations and enrollment, ready to be
+ used by the plugins.
+
+4. Call methods on the prototype.Experiment instance:
+
+ 1. swap_in() swaps the experiment in on the testbed, and fills in
+ the missing information in the model.
+
+ 2. install_prototype() installs the chosen prototype on the
+ testbed. Currently an Ubuntu image is assumed.
+
+ 3. bootstrap_prototype() calls a prototype-specific setup function,
+ to create the required IPCPs, perform registrations,
+ enrollments, etc.
+
+ 4. swap_out() swaps the experiment out of the testbed.
+
+5. Run a Storyboard to emulate real network traffic.
+
+
+Accessing nodes after swap-in
+-----------------------------
+
+To access a node once the experiment swapped in, use the following
+command (in the same terminal where ssh-agent was run in case of jFed): ::
+
+ $ rumba-access $NODE_NAME
+
+Where $NODE_NAME is the name of the node to access. In case of the
+QEMU testbed, the password of the downloaded buildroot images is
+'root'.
diff --git a/rumba/_version.py b/rumba/_version.py
new file mode 100644
index 0000000..c4222e3
--- /dev/null
+++ b/rumba/_version.py
@@ -0,0 +1,2 @@
+__version_info__ = (0, 7)
+__version__ = '.'.join(map(str, __version_info__))
diff --git a/rumba/log.py b/rumba/log.py
index 9abddce..3a21ee1 100644
--- a/rumba/log.py
+++ b/rumba/log.py
@@ -242,16 +242,19 @@ def set_logging_level(level, name=None):
"""
Set the current logging level to <level> for logger named <name>.
If name is not specified, sets the logging level for all rumba loggers.
- Accepted levels are:
- DEBUG == 10,
- INFO == 20,
- WARNING == 30,
- ERROR == 40,
- CRITICAL == 50,
- NOTSET == 0
- (resets the logger: its level is set to the default or its parents' level)
+
:param level: the desired logging level.
:param name: The name of the logger to configure
+
+ .. note:: Accepted levels are:
+
+ - DEBUG == 10,
+ - INFO == 20,
+ - WARNING == 30,
+ - ERROR == 40,
+ - CRITICAL == 50,
+ - NOTSET == 0 (resets the logger: its level is set to
+ the default or its parents' level)
"""
if name is None:
if level == 'NOTSET' or level == 0:
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")
diff --git a/setup.py b/setup.py
index 79b5633..2ac0b2f 100755
--- a/setup.py
+++ b/setup.py
@@ -2,10 +2,14 @@
import setuptools
+_locals = {}
+with open('rumba/_version.py') as fp:
+ exec(fp.read(), None, _locals)
+version = _locals['__version__']
setuptools.setup(
name='Rumba',
- version='0.7',
+ version=version,
url='https://gitlab.com/arcfire/rumba',
keywords='rina measurement testbed',
author='Sander Vrijders',