From 9bc00c4f76766c67c931d70bafd95b82d848d3dc Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 18 Mar 2019 16:35:35 -0400 Subject: [PATCH] add a couple more helpers --- integration/util.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/integration/util.py b/integration/util.py index 002b562df..0b0ffeff8 100644 --- a/integration/util.py +++ b/integration/util.py @@ -329,3 +329,19 @@ def await_file_vanishes(path, timeout=10): return time.sleep(1) raise FileShouldVanishException(path, timeout) + + +def cli(reactor, node_dir, *argv): + proto = _CollectOutputProtocol() + reactor.spawnProcess( + proto, + sys.executable, + [ + sys.executable, '-m', 'allmydata.scripts.runner', + '--node-directory', node_dir, + ] + list(argv), + ) + return proto.done + +def magic_folder_cli(reactor, node_dir, *argv): + return cli(reactor, node_dir, "magic-folder", *argv)