aboutsummaryrefslogtreecommitdiff
path: root/rumba/model.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-05-09 11:50:17 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-05-09 11:50:17 +0200
commita34a5d7ec2e6aa59a0a0aa0daba62f7738a1749a (patch)
tree1b362bf2bb2bfda4eb32bdf46dcd3e4e546eab22 /rumba/model.py
parentbf9a98603c8fc8dd8f15a7d54ffb2111fc6428a9 (diff)
downloadrumba-a34a5d7ec2e6aa59a0a0aa0daba62f7738a1749a.tar.gz
rumba-a34a5d7ec2e6aa59a0a0aa0daba62f7738a1749a.zip
rumba: model: Add StoryBoard for automated testing
This adds an initial draft of the API to automate tests on a RINA network.
Diffstat (limited to 'rumba/model.py')
-rw-r--r--rumba/model.py67
1 files changed, 66 insertions, 1 deletions
diff --git a/rumba/model.py b/rumba/model.py
index 0b9fc7a..91f33a6 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -152,7 +152,7 @@ class SSHConfig:
#
class Node:
def __init__(self, name, difs=None, dif_registrations=None,
- registrations=None, bindings=None):
+ registrations=None, bindings=None, end_user=False):
self.name = name
if difs is None:
difs = list()
@@ -170,6 +170,7 @@ class Node:
self.bindings = bindings
self.ssh_config = SSHConfig(name)
self.ipcps = []
+ self.end_user = end_user
self._validate()
@@ -564,3 +565,67 @@ class Experiment:
def swap_out(self):
# Undo the testbed (testbed-specific)
self.testbed.swap_out(self)
+
+# Base class for client programs
+#
+# @ap: Application Process binary
+# @options: Options to pass to the binary
+#
+class Client:
+ def __init__(self, ap, options=None):
+ self.ap = ap
+ self.options = options
+
+# Base class for server programs
+#
+# @ap: Application Process binary
+# @options: Options to pass to the binary
+# @max_clients: Maximum number of clients to serve
+# @clients: Client binaries that will use this server
+# @nodes: Specific nodes to start this server on
+#
+class Server:
+ def __init__(self, ap, options=None, max_clients=None,
+ clients=None, nodes=None):
+ self.ap = ap
+ self.options = options
+ self.max_clients = max_clients
+ if clients is None:
+ clients = list()
+ self.clients = clients
+ self.nodes = nodes
+
+ def add_client(self, client):
+ self.clients.append(client)
+
+ def del_client(self, client):
+ self.clients.remove(client)
+
+ def add_node(self, node):
+ self.nodes.append(node)
+
+ def del_node(self, node):
+ self.nodes.remove(node)
+
+# Base class for ARCFIRE storyboards
+#
+# @experiment: Experiment to use as input
+# @duration: Duration of the whole storyboard
+# @servers: App servers available in the network
+#
+class StoryBoard:
+ def __init__(self, experiment, duration, servers=None):
+ self.experiment = experiment
+ self.duration = duration
+ if servers is None:
+ servers = list()
+ self.servers = servers
+
+ def add_server(self, server):
+ self.servers.append(server)
+
+ def del_server(self, server):
+ self.servers.remove(server)
+
+ def start(self):
+ pass