aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2017-02-06 18:14:12 +0100
committerVincenzo Maffione <v.maffione@gmail.com>2017-02-06 18:14:12 +0100
commit38268b9218270ef57402e3c306d8b3bfdcd5103a (patch)
treeec124012fde1c4b64a5dfd3fa2f03bc93ef9ae2a
parentcc5ad5953f29e3e9374827b0e63f12a67b3a7d7d (diff)
downloadrumba-38268b9218270ef57402e3c306d8b3bfdcd5103a.tar.gz
rumba-38268b9218270ef57402e3c306d8b3bfdcd5103a.zip
rhumba: add FakeTestbed to ease development
-rwxr-xr-xrhumba.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/rhumba.py b/rhumba.py
index 535b650..5940da0 100755
--- a/rhumba.py
+++ b/rhumba.py
@@ -41,7 +41,8 @@ class Testbed:
@abc.abstractmethod
def create_experiment(self, nodes, links):
- return
+ raise Exception('create_experiment() not implemented')
+
# Represents an emulab testbed info
#
@@ -62,6 +63,7 @@ class EmulabTestbed:
es.wait_until_nodes_up(self)
es.complete_experiment_graph(self, nodes, links)
+
class jFedTestbed:
def __init__(self, exp_name, username, cert_file, jfed_jar, exp_hours = "2",
proj_name = "ARCFIRE", authority = "wall2.ilabt.iminds.be"):
@@ -76,6 +78,17 @@ class jFedTestbed:
def create_experiment(self, nodes, links):
js.create_experiment(self, nodes, links)
+
+# Fake testbed, useful for testing
+class FakeTestbed:
+ def __init__(self, exp_name, username, proj_name = "ARCFIRE",
+ password = ""):
+ Testbed.__init__(self, exp_name, username, password, proj_name)
+
+ def create_experiment(self, nodes, links):
+ print("[Fake testbed] experiment swapped in")
+
+
# Represents an interface on a node
#
# @name [string] interface name