diff options
-rw-r--r-- | scripts/testbed.py | 14 |
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. |