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)
data_base = join(tahoe_base, 'smoke_magicfolder')
if is_windows:
tahoe_bin = join(tahoe_base, 'venv', 'Scripts', 'tahoe.exe')
tahoe_bin = 'tahoe.exe'
else:
tahoe_bin = join(tahoe_base, 'bin', 'tahoe')
tahoe_bin = 'tahoe'
python = sys.executable
if not exists(data_base):
print("Creating", 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:
print("Killing the grid")
for d in listdir(data_base):
@ -260,8 +257,11 @@ if do_invites:
if True:
for name in ['alice', 'bob']:
with open(join(data_base, name, 'private', 'magic_folder_dircap'), 'r') as f:
print("dircap %s: %s" % (name, f.read().strip()))
try:
with open(join(data_base, name, 'private', 'magic_folder_dircap'), 'r') as f:
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
# sure what's up here, but I get "UnrecoverableFileError" on the