aboutsummaryrefslogtreecommitdiff
path: root/rumba/ssh_support.py
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-03-26 12:11:32 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-27 15:24:50 +0200
commitd8747a7b810421d4a1c5aa88e85012558890e577 (patch)
treed99f6bcdfabeff005ceb7b1f28ca095f3dcae5ab /rumba/ssh_support.py
parent9e499fec0ca6e2940717bce45388c59960f9bdc3 (diff)
downloadrumba-d8747a7b810421d4a1c5aa88e85012558890e577.tar.gz
rumba-d8747a7b810421d4a1c5aa88e85012558890e577.zip
storyboard: Add capturing of traffic
This adds the functionality to capture traffic on certain interfaces so that it can be inspected with tools like wireshark. A user needs to pass a start and end time and a node and DIF. Rumba will then determine the correct interface to capture on. Implements #41
Diffstat (limited to 'rumba/ssh_support.py')
-rw-r--r--rumba/ssh_support.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py
index b1492e7..a9dff28 100644
--- a/rumba/ssh_support.py
+++ b/rumba/ssh_support.py
@@ -336,8 +336,10 @@ def copy_files_from_testbed(testbed, ssh_config, paths,
destination = destination + '/'
if sudo:
- execute_command(testbed, ssh_config,
- 'sudo chmod a+rw %s' % (" ".join(paths)))
+ cmd = 'chmod a+rw %s' % (" ".join(paths))
+ if ssh_config.username != 'root':
+ cmd = "sudo %s" % command
+ execute_command(testbed, ssh_config, cmd)
if ssh_config.client is None:
client, proxy_client = ssh_connect(ssh_config.hostname, ssh_config.port,
@@ -436,4 +438,4 @@ def aptitude_install(testbed, node, packages):
"while ! " + sudo("apt-get update") + "; do sleep 1; done",
"while ! " + sudo(package_install) + "; do sleep 1; done"]
- execute_proxy_commands(testbed, node.ssh_config, cmds, time_out=None) \ No newline at end of file
+ execute_proxy_commands(testbed, node.ssh_config, cmds, time_out=None)