aboutsummaryrefslogtreecommitdiff
path: root/rumba/testbeds/emulab.py
diff options
context:
space:
mode:
authorNick Aerts <nick.aerts@ugent.be>2018-02-24 12:27:36 +0100
committerNick Aerts <nick.aerts@ugent.be>2018-03-20 11:30:07 +0100
commita7cd88d752b72ea85ccefa5e1f3dceba13fb1fc2 (patch)
tree9c29f08693d577c81959c3194aec04e9bc1ba195 /rumba/testbeds/emulab.py
parent24bed306b5a67fc682b04cae017b0d0f3ac55a00 (diff)
downloadrumba-a7cd88d752b72ea85ccefa5e1f3dceba13fb1fc2.tar.gz
rumba-a7cd88d752b72ea85ccefa5e1f3dceba13fb1fc2.zip
testbeds: Add docker testbed
This adds support for a testbed based on Docker containers running on the local host. Bridging the containers can be done using built-in Linux bridging or using OpenVSwitch bridges. A new resource 'executor' has been added to abstract away command execution on nodes on the testbed. Executors have been created for local command execution, docker exec based command execution and SSH-based command execution. This has also been changed in the prototypes to execute using the correct executor.
Diffstat (limited to 'rumba/testbeds/emulab.py')
-rw-r--r--rumba/testbeds/emulab.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/rumba/testbeds/emulab.py b/rumba/testbeds/emulab.py
index 4f8b023..06e0e5c 100644
--- a/rumba/testbeds/emulab.py
+++ b/rumba/testbeds/emulab.py
@@ -34,6 +34,8 @@ import rumba.ssh_support as ssh
import rumba.model as mod
import rumba.log as log
+from rumba.executors.ssh import SSHExecutor
+
logger = log.get_logger(__name__)
@@ -56,6 +58,8 @@ class Testbed(mod.Testbed):
self.ip = dict()
self.ops_ssh_config = mod.SSHConfig(self.ops_server())
+ self.executor = SSHExecutor
+
if "wall" in url:
self.http_proxy="https://proxy.atlantis.ugent.be:8080"
@@ -237,7 +241,7 @@ class Testbed(mod.Testbed):
node.ssh_config.set_password(self.password)
cmd = 'cat /var/emulab/boot/topomap'
- topomap = ssh.execute_command(self, experiment.nodes[0].ssh_config, cmd)
+ topomap = node.execute_command(cmd)
# Almost as ugly as yo momma
index = topomap.rfind("# lans")
topo_array = topomap[:index].split('\n')[1:-1]
@@ -258,7 +262,7 @@ class Testbed(mod.Testbed):
for node in experiment.nodes:
cmd = 'cat /var/emulab/boot/ifmap'
- output = ssh.execute_command(self, node.ssh_config, cmd)
+ output = node.execute_command(cmd)
output = re.split('\n', output)
for item in output:
item = item.split()
@@ -268,6 +272,8 @@ class Testbed(mod.Testbed):
ipcp.ifname = item[0]
def swap_in(self, experiment):
+ mod.Testbed.swap_in(self, experiment)
+
self._create_experiment(experiment)
wait = self.swap_exp_in()
if wait: