Files
scylladb/test/rest_api/run
Andrei Chekun 93b9b85c12 [test.py] Refactor alternator, nodetool, rest_api
Make alternator, nodetool and rest_api test directories as python packages.
Move scylla-gdb to scylla_gdb and make it python package.
2024-06-13 13:56:10 +02:00

49 lines
1.4 KiB
Python
Executable File

#!/usr/bin/env python3
import sys
# Use the run.py library from ../cql-pytest:
sys.path.insert(1, sys.path[0] + '/test/cql-pytest')
import run
print('Scylla is: ' + run.find_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
# If the "--vnodes" option is given, drop the "tablets" experimental
# feature (turned on in run.py) so that all tests will be run with the
# old vnode-based replication instead of tablets. This option only has
# temporary usefulness, and should eventually be removed.
if '--vnodes' in sys.argv:
sys.argv.remove('--vnodes')
def run_without_tablets(pid, dir):
(c, e) = run_without_tablets.orig_cmd(pid, dir)
c.remove('--enable-tablets=true')
return (c, e)
run_without_tablets.orig_cmd = cmd
cmd = run_without_tablets
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).