2020-02-08 09:07:07 +00:00
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
from subprocess import Popen, PIPE
|
|
|
|
import uuid
|
|
|
|
|
2022-09-27 19:08:58 +00:00
|
|
|
TEST_DIR = '../testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
|
2020-02-08 09:07:07 +00:00
|
|
|
os.environ["ONIONR_HOME"] = TEST_DIR
|
|
|
|
|
|
|
|
print(f'running integration test for {__file__}')
|
2020-03-04 06:59:29 +00:00
|
|
|
try:
|
|
|
|
with Popen(['./onionr.sh'], stdout=PIPE) as onionr_proc:
|
|
|
|
output = onionr_proc.stdout.read().decode()
|
|
|
|
except SystemExit:
|
|
|
|
pass
|
|
|
|
if onionr_proc.returncode != 10:
|
|
|
|
raise ValueError('Raised non 10 exit ' + str(onionr_proc.returncode))
|
2020-02-08 09:07:07 +00:00
|
|
|
|
2020-03-04 06:59:29 +00:00
|
|
|
if 'Run with --help to see available commands' not in output:
|
2020-02-08 09:07:07 +00:00
|
|
|
raise ValueError('No command run returned non-blank output')
|