tahoe_base = abspath(curdir)
data_base = join(tahoe_base, 'smoke_magicfolder')
tahoe_bin = join(tahoe_base, 'bin', 'tahoe')
+python = sys.executable
if not exists(data_base):
print("Creating", data_base)
print("killing", d)
subprocess.call(
[
- tahoe_bin, 'stop', join(data_base, d),
+ python, tahoe_bin, 'stop', join(data_base, d),
]
)
sys.exit(0)
if not exists(join(data_base, 'introducer')):
subprocess.check_call(
[
- tahoe_bin, 'create-introducer', join(data_base, 'introducer'),
+ python, tahoe_bin, 'create-introducer', join(data_base, 'introducer'),
]
)
with open(join(data_base, 'introducer', 'tahoe.cfg'), 'w') as f:
subprocess.check_call(
[
- tahoe_bin, 'start', join(data_base, 'introducer'),
+ python, tahoe_bin, 'start', join(data_base, 'introducer'),
]
)
if not exists(data_dir):
subprocess.check_call(
[
- tahoe_bin, 'create-node',
+ python, tahoe_bin, 'create-node',
'--nickname', 'node%d' % (x,),
'--introducer', furl,
data_dir,
''' % {'node_id':x, 'furl':furl, 'tub_port':(9900 + x)})
subprocess.check_call(
[
- tahoe_bin, 'start', data_dir,
+ python, tahoe_bin, 'start', data_dir,
]
)
do_invites = True
subprocess.check_call(
[
- tahoe_bin, 'create-node',
+ python, tahoe_bin, 'create-node',
'--no-storage',
'--nickname', name,
'--introducer', furl,
''' % {'name':name, 'node_id':node_id, 'furl':furl})
subprocess.check_call(
[
- tahoe_bin, 'start', data_dir,
+ python, tahoe_bin, 'start', data_dir,
]
)
node_id += 1
print("Alice creates a magic-folder")
subprocess.check_call(
[
- tahoe_bin, 'magic-folder', 'create', '--basedir', data_dir, 'magik:', 'alice',
+ python, tahoe_bin, 'magic-folder', 'create', '--basedir', data_dir, 'magik:', 'alice',
join(data_base, 'alice-magic'),
]
)
print("Alice invites Bob")
invite = subprocess.check_output(
[
- tahoe_bin, 'magic-folder', 'invite', '--basedir', data_dir, 'magik:', 'bob',
+ python, tahoe_bin, 'magic-folder', 'invite', '--basedir', data_dir, 'magik:', 'bob',
]
)
print(" invite:", invite)
data_dir = join(data_base, 'bob')
subprocess.check_call(
[
- tahoe_bin, 'magic-folder', 'join', '--basedir', data_dir, invite,
+ python, tahoe_bin, 'magic-folder', 'join', '--basedir', data_dir, invite,
join(data_base, 'bob-magic'),
]
)
print("Restarting alice + bob clients")
subprocess.check_call(
[
- tahoe_bin, 'restart', '--basedir', join(data_base, 'alice'),
+ python, tahoe_bin, 'restart', '--basedir', join(data_base, 'alice'),
]
)
subprocess.check_call(
[
- tahoe_bin, 'restart', '--basedir', join(data_base, 'bob'),
+ python, tahoe_bin, 'restart', '--basedir', join(data_base, 'bob'),
]
)