Files
scylladb/test/cql-pytest/run
Nadav Har'El 355dbf2140 test/cql-pytest: option for running the tests over SSL
This patch adds a "--ssl" option to test/cql-pytest's pytest, as well as
to the run script test/cql-pytest/run. When "test/cql-pytest/run --ssl"
is used, Scylla is started listening for encrypted connections on its
standard port (9042) - using a temporary unsigned certificate. Then, the
individual tests connect to this encrypted port using TLSv1.2 (Scylla
doesn't support earlier version of SSL) instead of TCP.

This "--ssl" feature allows writing test which stress various aspects of
the connection (e.g., oversized requests - see PR #8800), and then be
able to run those tests in both TCP and SSL modes.

Fixes #8811

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Message-Id: <20210607200329.1536234-1-nyh@scylladb.com>
2021-06-08 11:43:20 +02:00

30 lines
792 B
Python
Executable File

#!/usr/bin/env python3
import sys
import run # run.py in this directory
print('Scylla is: ' + run.scylla + '.')
ssl = '--ssl' in sys.argv
if ssl:
cmd = run.run_scylla_ssl_cql_cmd
check_cql = run.check_ssl_cql
else:
cmd = run.run_scylla_cmd
check_cql = run.check_cql
pid = run.run_with_temporary_dir(cmd)
ip = run.pid_to_ip(pid)
run.wait_for_services(pid, [lambda: check_cql(ip)])
success = run.run_pytest(sys.path[0], ['--host', ip] + sys.argv[1:])
run.summary = 'Scylla tests pass' if success else 'Scylla tests failure'
exit(0 if success else 1)
# Note that the run.cleanup_all() function runs now, just like on any exit
# for any reason in this script. It will delete the temporary files and
# announce the failure or success of the test (printing run.summary).