aboutsummaryrefslogtreecommitdiff
path: root/rumba/prototypes/ouroboros.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-06-05 15:54:18 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-06-05 17:32:03 +0200
commita1f2be15e901981efbaeaacc9a331342c1d3911e (patch)
tree0463c6a6b0c3f08413913241950fabb906c4eee5 /rumba/prototypes/ouroboros.py
parent02be7d064fcf121fc455fab5685b97ebec40d733 (diff)
downloadrumba-a1f2be15e901981efbaeaacc9a331342c1d3911e.tar.gz
rumba-a1f2be15e901981efbaeaacc9a331342c1d3911e.zip
storyboard: Bind and register server name for Ouroboros
In case the experiment is done with the Ouroboros prototype, the name needs to be bound and registered on the node.
Diffstat (limited to 'rumba/prototypes/ouroboros.py')
-rw-r--r--rumba/prototypes/ouroboros.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py
index 653f564..51f3629 100644
--- a/rumba/prototypes/ouroboros.py
+++ b/rumba/prototypes/ouroboros.py
@@ -248,6 +248,34 @@ class Experiment(mod.Experiment):
logger.info("Killing IRMd...")
subprocess.check_call('sudo killall -15 irmd'.split())
+ def bind_program(self, node, program, name):
+ """
+ Bind a program to a certain name on a certain node.
+
+ :param node: The node
+ :param program: The binary name
+ :param name: Name to bind to
+ """
+ node.execute_command('irm b prog %s name %s' % (program, name))
+
+ def register_name(self, node, name, layers):
+ """
+ Bind a program to a certain name on a certain node.
+
+ :param node: The node
+ :param name: Name to register
+ :param layers: Layers to register in. If it is None,
+ then it registers in all layers.
+ """
+ cmd = 'irm r n %s ' % name
+ if layers is None:
+ cmd += 'layer \'*\''
+ else:
+ for layer in layers:
+ cmd += 'layer %s ' % layer
+
+ node.execute_command(cmd)
+
def destroy_dif(self, dif):
for ipcp in dif.ipcps:
ipcp.node.execute_command('irm i d n ' + ipcp.name)