test/rest_api has a "--ssl" option to use encrypted CQL. It's not clear to me why this is useful (it doesn't actually test encryption of the REST API!), but as long as we have such an option, it should work. And it didn't work because of a typo - we set a "check_cql" variable to the right function, but then forgot to use it and used run.check_cql instead (which is just for unencrypted cql). Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20220102123202.1052930-1-nyh@scylladb.com>
36 lines
902 B
Python
Executable File
36 lines
902 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
|
|
# Use the run.py library from ../cql-pytest:
|
|
sys.path.insert(1, sys.path[0] + '/../cql-pytest')
|
|
import run
|
|
|
|
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: run.check_rest_api(ip),
|
|
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).
|