aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emulab_support.py1
-rw-r--r--jfed_support.py6
-rwxr-xr-xmain.py23
-rwxr-xr-xrhumba.py39
4 files changed, 39 insertions, 30 deletions
diff --git a/emulab_support.py b/emulab_support.py
index 6fe0055..db779a9 100644
--- a/emulab_support.py
+++ b/emulab_support.py
@@ -297,6 +297,7 @@ def complete_experiment_graph(testbed, nodes, p2plinks):
elif link.node_b.name == node.name and \
link.int_b.ip == item[1]:
link.int_b.name = item[0]
+ node.full_name = full_name(testbed, node.name)
def setup_vlan(testbed, node_name, vlan_id, int_name):
'''
diff --git a/jfed_support.py b/jfed_support.py
index aa933d8..c98277d 100644
--- a/jfed_support.py
+++ b/jfed_support.py
@@ -100,6 +100,12 @@ def create_experiment(testbed, nodes, links):
create_rspec(testbed, nodes, links)
testbed.manifest = testbed.exp_name + ".rrspec"
+ for node in nodes:
+ auth_name_r = testbed.auth_name.replace(".", "-")
+ node.full_name = node.name + "." + testbed.exp_name + "." + \
+ testbed.proj_name + "." + auth_name_r + \
+ "." + testbed.auth_name
+
subprocess.call(["java", "-jar", testbed.jfed_jar, "create", "-S", \
testbed.proj_name, "--rspec", \
testbed.rspec, "-s", \
diff --git a/main.py b/main.py
index 49508e9..3200f77 100755
--- a/main.py
+++ b/main.py
@@ -4,28 +4,21 @@
from rhumba import *
-n1 = NormalDIF("n1", policies = {"rmt.pff": "lfa",
- "security-manager": "passwd"})
-
e1 = ShimEthDIF("e1")
a = Node("a",
- difs = [n1, e1],
- dif_registrations = {n1 : [e1]},
- registrations = {"a.crap" : [n1]},
- bindings = {"a.crap" : "/usr/bin/crap"})
+ difs = [e1],
+ registrations = {"cbr.a" : [e1]},
+ bindings = {"cbr.a" : "/usr/bin/cbr"})
b = Node("b",
- difs = [e1, n1],
- dif_registrations = {n1 : [e1]})
+ difs = [e1])
-tb = jFedTestbed(exp_name = "letest",
- username = "sander",
- cert_file = "cert.pem",
- jfed_jar = "jfed_cli/experimenter-cli.jar")
+tb = EmulabTestbed(exp_name = "test001",
+ username = "sander",
+ url = "wall2.ilabt.iminds.be")
-exp = IRATIExperiment("paperino", tb,
- nodes = [a, b])
+exp = OuroborosExperiment(tb, nodes = [a, b])
print(exp)
diff --git a/rhumba.py b/rhumba.py
index d8cb17c..843b319 100755
--- a/rhumba.py
+++ b/rhumba.py
@@ -67,6 +67,7 @@ class jFedTestbed:
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.auth_name = authority
self.cert_file = cert_file
self.jfed_jar = jfed_jar
self.exp_hours = exp_hours
@@ -144,6 +145,12 @@ class DIF:
def del_member(self, node):
self.members.remove(node)
+# Shim over UDP
+#
+class ShimUDPDIF(DIF):
+ def __init__(self, name, members = list()):
+ DIF.__init__(self, name, members)
+
# Shim over Ethernet
#
# @link_speed [int] Speed of the Ethernet network, in Mbps
@@ -195,6 +202,7 @@ class Node:
self.dif_registrations = dif_registrations
self.registrations = registrations
self.bindings = bindings
+ self.full_name = name
def __repr__(self):
s = "Node " + self.name + ":\n"
@@ -254,13 +262,12 @@ class Node:
# @nodes: Nodes in the experiment
#
class Experiment:
- def __init__(self, name, testbed, nodes = list()):
- self.name = name
+ def __init__(self, testbed, nodes = list()):
self.nodes = nodes
self.testbed = testbed
def __repr__(self):
- s = "%s:" % self.name
+ s = ""
for n in self.nodes:
s += "\n" + str(n)
@@ -278,32 +285,34 @@ class Experiment:
# An experiment over the IRATI implementation
class IRATIExperiment(Experiment):
- def __init__(self, name, testbed, nodes = list()):
- Experiment.__init__(self, name, testbed, nodes)
+ def __init__(self, testbed, nodes = list()):
+ Experiment.__init__(self, testbed, nodes)
def run(self):
- print("[IRATI experiment %s] start" % self.name)
+ print("[IRATI experiment] start")
Experiment.run(self)
- print("[IRATI experiment %s] end" % self.name)
+ print("[IRATI experiment] end")
# An experiment over the RLITE implementation
class RLITEExperiment(Experiment):
- def __init__(self, name, testbed, nodes = list()):
- Experiment.__init__(self, name, testbed, nodes)
+ def __init__(self, testbed, nodes = list()):
+ Experiment.__init__(self, testbed, nodes)
def run(self):
- print("[RLITE experiment %s] start" % self.name)
+ print("[RLITE experiment] start")
Experiment.run(self)
- print("[RLITE experiment %s] end" % self.name)
+ print("[RLITE experiment] end")
# An experiment over the Ouroboros implementation
class OuroborosExperiment(Experiment):
- def __init__(self, name, testbed, nodes = list()):
- Experiment.__init__(self, name, testbed, nodes)
+ def __init__(self, testbed, nodes = list()):
+ Experiment.__init__(self, testbed, nodes)
def run(self):
- print("[Ouroboros experiment %s] start" % self.name)
+ print("[Ouroboros experiment] start")
Experiment.run(self)
- print("[Ouroboros experiment %s] end" % self.name)
+ for node in self.nodes:
+ print(node.full_name)
+ print("[Ouroboros experiment] end")