The existing test_ssl.py which tests for Scylla's support of various TLS and SSL versions, used a deprecated and misleading Python API for choosing the protocol version. In particular, the protocol version ssl.PROTOCOL_SSLv23 is *not*, despite it's name, SSL versions 2 or 3, or SSL at all - it is in fact an alias for the latest TLS version :-( This misunderstanding led us to open the incorrect issue #8837. So in this patch, we avoid the old Python APIs for choosing protocols, which were gradually deprecated, and switch to the new API introduced in Python 3.7 and OpenSSL 1.1.0g - supplying the minimum and maximum desired protocol version. With this new API, we can correctly connect with various versions of the SSL and TLS protocol - between SSLv3 through TLSv1.3. With the fixed test, we confirm that Scylla does *not* allow SSLv3 - as desired - so issue #8837 is a non-issue. Moreover, after issue #8827 was already fixed, this test now passes, so the "xfail" mark is removed. Refs #8837. Refs #8827. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20210617134305.173034-1-nyh@scylladb.com>
Single-node funtional tests for Scylla's CQL features. Tests use the Python CQL library and the pytest frameworks. By using an actual CQL library for the tests, they can be run against any implementation of CQL - both Scylla and Cassandra. Most tests - except in rare cases - should pass on both, to ensure that Scylla is compatible with Cassandra in most features.
To run all tests against an already-running local installation of Scylla
or Cassandra on localhost, just run pytest. The "--host" and "--port"
can be used to give a different location for the running Scylla or Cassanra.
The "--ssl" option can be used to use an encrypted (TLSv1.2) connection.
More conveniently, we have two scripts - "run" and "run-cassandra" - which do all the work necessary to start Scylla or Cassandra (respectively), and run the tests on them. The Scylla or Cassandra process is run in a temporary directory which is automatically deleted when the test ends.
Additional options can be passed to "pytest" or to "run" / "run-cassandra" to control which tests to run:
- To run all tests in a single file, do
pytest test_table.py. - To run a single specific test, do
pytest test_table.py::test_create_table_unsupported_names.
Additional useful pytest options, especially useful for debugging tests:
- -v: show the names of each individual test running instead of just dots.
- -s: show the full output of running tests (by default, pytest captures the test's output and only displays it if a test fails)