make check_magicfolder_smoke easier to run, cross-platform

This commit is contained in:
meejah 2016-05-23 13:02:33 -06:00 committed by Brian Warner
parent 1b72683741
commit db40417886

View File

@ -44,18 +44,15 @@ is_windows = (sys.platform == 'win32')
tahoe_base = abspath(curdir) tahoe_base = abspath(curdir)
data_base = join(tahoe_base, 'smoke_magicfolder') data_base = join(tahoe_base, 'smoke_magicfolder')
if is_windows: if is_windows:
tahoe_bin = join(tahoe_base, 'venv', 'Scripts', 'tahoe.exe') tahoe_bin = 'tahoe.exe'
else: else:
tahoe_bin = join(tahoe_base, 'bin', 'tahoe') tahoe_bin = 'tahoe'
python = sys.executable python = sys.executable
if not exists(data_base): if not exists(data_base):
print("Creating", data_base) print("Creating", data_base)
mkdir(data_base) mkdir(data_base)
if not exists(tahoe_bin):
raise RuntimeError("Can't find 'tahoe' binary at %r" % (tahoe_bin,))
if 'kill' in sys.argv: if 'kill' in sys.argv:
print("Killing the grid") print("Killing the grid")
for d in listdir(data_base): for d in listdir(data_base):
@ -260,8 +257,11 @@ if do_invites:
if True: if True:
for name in ['alice', 'bob']: for name in ['alice', 'bob']:
try:
with open(join(data_base, name, 'private', 'magic_folder_dircap'), 'r') as f: with open(join(data_base, name, 'private', 'magic_folder_dircap'), 'r') as f:
print("dircap %s: %s" % (name, f.read().strip())) print("dircap %s: %s" % (name, f.read().strip()))
except Exception:
print("can't find/open %s" % (name,))
# give storage nodes a chance to connect properly? I'm not entirely # give storage nodes a chance to connect properly? I'm not entirely
# sure what's up here, but I get "UnrecoverableFileError" on the # sure what's up here, but I get "UnrecoverableFileError" on the