From 5f11aa940d8a05f118a9330b4cb6bb6f8623a7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Fri, 19 Jan 2024 02:59:30 -0500 Subject: [PATCH] test/cql-pytest: test_keyspace.py: test_storage_options_local(): fix for tablets This test expects a keyspace with local storage option, to not have a row in system_schema.scylla_keyspace. With tablets enabled by default, this won't be the case. Adjust the test to check for the specific storage-related columns instead. --- test/cql-pytest/test_keyspace.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/cql-pytest/test_keyspace.py b/test/cql-pytest/test_keyspace.py index f60d7f7d28..e113d7ea81 100644 --- a/test/cql-pytest/test_keyspace.py +++ b/test/cql-pytest/test_keyspace.py @@ -207,9 +207,15 @@ def test_concurrent_create_and_drop_keyspace(cql, this_dc, fails_without_consist def test_storage_options_local(cql, scylla_only): ksdef = "WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'replication_factor' : '1' } " \ "AND STORAGE = { 'type' : 'LOCAL' }" + + def row_has_storage_options(row): + o = getattr(row, 'storage_options', None) + t = getattr(row, 'storage_type', None) + return t is not None or o is not None + with new_test_keyspace(cql, ksdef) as keyspace: - res = cql.execute(f"SELECT * FROM system_schema.scylla_keyspaces WHERE keyspace_name = '{keyspace}'") - assert not res.all() + res = list(cql.execute(f"SELECT * FROM system_schema.scylla_keyspaces WHERE keyspace_name = '{keyspace}'")) + assert not res or not row_has_storage_options(res[0]) # Test that passing an unsupported storage type is not legal def test_storage_options_unknown_type(cql, scylla_only):