aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2008-01-27 20:16:06 +0000
committerRob Austein <sra@hactrn.net>2008-01-27 20:16:06 +0000
commit987efb24b6437f629db26d1a26faac6066bf3500 (patch)
treeea87a96cf6424a674ce70e1324efea4309948d9f /scripts
parent5c66a25dbb8ad1c283c3503e566782876179a1c3 (diff)
shell and echo commands
svn path=/scripts/testbed.py; revision=1511
Diffstat (limited to 'scripts')
-rw-r--r--scripts/testbed.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/testbed.py b/scripts/testbed.py
index a482c9b3..0aa1813a 100644
--- a/scripts/testbed.py
+++ b/scripts/testbed.py
@@ -315,10 +315,22 @@ def cmd_sleep(interval = None):
signal.alarm(seconds)
signal.pause()
+def cmd_shell(*cmd):
+ """Run a shell command."""
+ cmd = " ".join(cmd)
+ status = subprocess.call(cmd, shell = True)
+ rpki.log.info("Shell command returned status %d" % status)
+
+def cmd_echo(*words):
+ """Echo some text to the log."""
+ rpki.log.note(" ".join(words))
+
## @var cmds
# Dispatch table for commands embedded in delta sections
-cmds = { "sleep" : cmd_sleep }
+cmds = { "sleep" : cmd_sleep,
+ "shell" : cmd_shell,
+ "echo" : cmd_echo }
class allocation_db(list):
"""Representation of all the entities and allocations in the test system.