From a03755d6d702a80cac18bebf516eb68d223e93d2 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Fri, 15 Dec 2023 14:05:40 +0300 Subject: [PATCH] test: Add a test that switching between vnodes and tablets is banned Signed-off-by: Pavel Emelyanov --- test/topology_custom/test_tablets.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/topology_custom/test_tablets.py diff --git a/test/topology_custom/test_tablets.py b/test/topology_custom/test_tablets.py new file mode 100644 index 0000000000..4156622020 --- /dev/null +++ b/test/topology_custom/test_tablets.py @@ -0,0 +1,25 @@ +# +# Copyright (C) 2023-present ScyllaDB +# +# SPDX-License-Identifier: AGPL-3.0-or-later +# +from cassandra.protocol import InvalidRequest +from test.pylib.manager_client import ManagerClient +import pytest +import logging +import asyncio + +logger = logging.getLogger(__name__) + + +@pytest.mark.asyncio +async def test_tablet_change_replication_vnode_to_tablets(manager: ManagerClient): + cfg = {'enable_user_defined_functions': False, + 'experimental_features': ['tablets', 'consistent-topology-changes']} + server = await manager.server_add(config=cfg) + + cql = manager.get_cql() + await cql.run_async("CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1};") + with pytest.raises(InvalidRequest): + await cql.run_async("ALTER KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1, 'initial_tablets': 1};") +