#!/usr/bin/env python3
import sys,os,time
open(os.environ['FIXTURE_PID_FILE'],'w').write(str(os.getpid()))
mode=sys.argv[-1]
print('PROGRESS: downloading archive',flush=True)
print('{"credential":"SYNTHETIC-NOT-A-CREDENTIAL"}',flush=True)
if mode != 'fail-stdout': print('REMOTE: waiting for archive extraction',file=sys.stderr,flush=True)
if mode == 'hang':
    while True: time.sleep(60)
sys.exit(0 if mode == 'success' else 1)
