Make openssl binary configurable, for OSX

This commit is contained in:
Daniel Oaks 2017-11-02 00:07:06 +00:00
parent bceb5883cc
commit e39f7be14c
2 changed files with 7 additions and 4 deletions

View File

@ -56,15 +56,15 @@ class DirectoryBasedController(_BaseController):
self.key_path = os.path.join(self.directory, 'ssl.key')
self.pem_path = os.path.join(self.directory, 'ssl.pem')
self.dh_path = os.path.join(self.directory, 'dh.pem')
subprocess.check_output(['openssl', 'req', '-new', '-newkey', 'rsa',
subprocess.check_output([self.openssl_bin, 'req', '-new', '-newkey', 'rsa',
'-nodes', '-out', self.csr_path, '-keyout', self.key_path,
'-batch'],
stderr=subprocess.DEVNULL)
subprocess.check_output(['openssl', 'x509', '-req',
subprocess.check_output([self.openssl_bin, 'x509', '-req',
'-in', self.csr_path, '-signkey', self.key_path,
'-out', self.pem_path],
stderr=subprocess.DEVNULL)
subprocess.check_output(['openssl', 'dhparam',
subprocess.check_output([self.openssl_bin, 'dhparam',
'-out', self.dh_path, '128'],
stderr=subprocess.DEVNULL)
@ -80,7 +80,7 @@ class BaseServerController(_BaseController):
valid_metadata_keys, invalid_metadata_keys):
raise NotImplementedError()
def registerUser(self, case, username, password=None):
raise NotImplementedByController('registration')
raise NotImplementedByController('account registration')
def wait_for_port(self):
while not self.port_open:
time.sleep(0.1)

View File

@ -29,6 +29,7 @@ def main(args):
file=sys.stderr)
exit(1)
_IrcTestCase.controllerClass = controller_class
_IrcTestCase.controllerClass.openssl_bin = args.openssl_bin
_IrcTestCase.show_io = args.show_io
_IrcTestCase.strictTests = not args.loose
if args.specification:
@ -68,6 +69,8 @@ parser = argparse.ArgumentParser(
description='A script to test interoperability of IRC software.')
parser.add_argument('module', type=str,
help='The module used to run the tested program.')
parser.add_argument('--openssl-bin', type=str, default='openssl',
help='The openssl binary to use')
parser.add_argument('--show-io', action='store_true',
help='Show input/outputs with the tested program.')
parser.add_argument('-v', '--verbose', action='count', default=1,