From: Israel Fruchter <
fr...@scylladb.com>
Committer: Israel Fruchter <
israel....@gmail.com>
Branch: master
fix(integration-tests): enable auth by default
for covering related auth in alternator tests
we want to enable the integration tests to work
by default with auth enforced.
it flushed out, that we need to fix latte support for user/password
and that cql-stress version we have doesn't support auth
---
diff --git a/docker/scylla-sct/entry.sh b/docker/scylla-sct/entry.sh
--- a/docker/scylla-sct/entry.sh
+++ b/docker/scylla-sct/entry.sh
@@ -1,4 +1,16 @@
#!/bin/bash
if [[ ! $(grep 'skip_wait_for_gossip_to_settle' /etc/scylla/scylla.yaml) ]]; then echo "skip_wait_for_gossip_to_settle: 0" >> /etc/scylla/scylla.yaml ; fi
+
+cat <<EOM >> /etc/scylla/scylla.yaml
+
+alternator_enforce_authorization: true
+authenticator: 'PasswordAuthenticator'
+authenticator_user: cassandra
+authenticator_password: cassandra
+authorizer: 'CassandraAuthorizer'
+
+enable_tablets: false
+EOM
+
/docker-entrypoint.py $*
diff --git a/docker/scylla-sct/entry_ssl.sh b/docker/scylla-sct/entry_ssl.sh
--- a/docker/scylla-sct/entry_ssl.sh
+++ b/docker/scylla-sct/entry_ssl.sh
@@ -4,11 +4,19 @@ if [[ ! $(grep 'skip_wait_for_gossip_to_settle' /etc/scylla/scylla.yaml) ]]; the
cat <<EOM >> /etc/scylla/scylla.yaml
+alternator_enforce_authorization: true
+authenticator: 'PasswordAuthenticator'
+authenticator_user: cassandra
+authenticator_password: cassandra
+authorizer: 'CassandraAuthorizer'
+
client_encryption_options:
certificate: /etc/scylla/ssl_conf/client-facing.crt
enabled: true
keyfile: /etc/scylla/ssl_conf/client-facing.key
truststore: /etc/scylla/ssl_conf/ca.pem
+
+enable_tablets: false
EOM
/docker-entrypoint.py $*
diff --git a/internal_test_data/complex_test_case_with_version.yaml b/internal_test_data/complex_test_case_with_version.yaml
--- a/internal_test_data/complex_test_case_with_version.yaml
+++ b/internal_test_data/complex_test_case_with_version.yaml
@@ -41,7 +41,7 @@ gce_n_local_ssd_disk_monitor: 0
db_type: scylla
instance_type_db: 'i4i.4xlarge'
-scylla_version: '5.1.3'
+scylla_version: '5.4.1'
ami_id_loader: 'ami-07bcb57f57a485721'
ami_id_monitor: 'ami-07bcb57f57a485721'
diff --git a/sdcm/ndbench_thread.py b/sdcm/ndbench_thread.py
--- a/sdcm/ndbench_thread.py
+++ b/sdcm/ndbench_thread.py
@@ -118,6 +118,9 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# remove the ndbench command, and parse the rest of the ; separated values
stress_cmd = re.sub(r'^ndbench', '', self.stress_cmd)
+ if credentials := self.loader_set.get_db_auth():
+ stress_cmd += f'; cass.username={credentials[0]} ; cass.password={credentials[1]}'
+
self.stress_cmd = ' '.join([f'-Dndbench.config.{param.strip()}' for param in stress_cmd.split(';')])
timeout = '' if 'cli.timeoutMillis' in self.stress_cmd else f'-Dndbench.config.cli.timeoutMillis={self.timeout * 1000}'
self.stress_cmd = f'./gradlew {timeout}' \
diff --git a/sdcm/scylla_bench_thread.py b/sdcm/scylla_bench_thread.py
--- a/sdcm/scylla_bench_thread.py
+++ b/sdcm/scylla_bench_thread.py
@@ -110,8 +110,9 @@ def __init__(self, stress_cmd, loader_set, timeout, node_list=None, round_robin=
super().__init__(loader_set=loader_set, stress_cmd=stress_cmd, timeout=timeout, stress_num=stress_num,
node_list=node_list, round_robin=round_robin, params=params,
stop_test_on_failure=stop_test_on_failure)
- if credentials and 'username=' not in self.stress_cmd:
- self.stress_cmd += " -username {} -password {}".format(*credentials)
+ if credentials := self.loader_set.get_db_auth():
+ if 'username=' not in self.stress_cmd:
+ self.stress_cmd += " -username {} -password {}".format(*credentials)
if not any(opt in self.stress_cmd for opt in ('-error-at-row-limit', '-error-limit')):
result = re.search(r"-retry-number[= ]+(\d+) ", self.stress_cmd)
diff --git a/sdcm/stress/latte_thread.py b/sdcm/stress/latte_thread.py
--- a/sdcm/stress/latte_thread.py
+++ b/sdcm/stress/latte_thread.py
@@ -98,7 +98,7 @@ class LatteStressThread(DockerBasedStressThread): # pylint: disable=too-many-in
DOCKER_IMAGE_PARAM_NAME = "stress_image.latte"
- def build_stress_cmd(self, cmd_runner, loader):
+ def build_stress_cmd(self, cmd_runner, loader): # pylint: disable=too-many-locals
hosts = " ".join([i.cql_address for i in self.node_list])
# extract the script so we know which files to mount into the docker image
@@ -119,6 +119,11 @@ def build_stress_cmd(self, cmd_runner, loader):
ssl_config += (f' --ssl --ssl-ca {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CA_CERT} '
f'--ssl-cert {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CLIENT_CERT} '
f'--ssl-key {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CLIENT_KEY}')
+
+ auth_config = ''
+ if credentials := self.loader_set.get_db_auth():
+ auth_config = f' --user {credentials[0]} --password {credentials[1]}'
+
datacenter = ""
if self.loader_set.test_config.MULTI_REGION:
# The datacenter name can be received from "nodetool status" output. It's possible for DB nodes only,
@@ -132,11 +137,11 @@ def build_stress_cmd(self, cmd_runner, loader):
loader.region, datacenter_name_per_region)
cmd_runner.run(
- cmd=f'latte schema {script_name} {ssl_config} -- {hosts}',
+ cmd=f'latte schema {script_name} {ssl_config} {auth_config} -- {hosts}',
timeout=self.timeout,
retry=0,
)
- stress_cmd = f'{self.stress_cmd} {ssl_config} {datacenter} -q -- {hosts} '
+ stress_cmd = f'{self.stress_cmd} {ssl_config} {auth_config} {datacenter} -q -- {hosts} '
return stress_cmd
@@ -219,4 +224,3 @@ def _run_stress(self, loader, loader_idx, cpu_idx):
return {}
# TODOs:
# 1) take back the report workload..3.0.8.p128.t1.c1.20231025.220812.json
- # 2) support user/password
diff --git a/sdcm/tester.py b/sdcm/tester.py
--- a/sdcm/tester.py
+++ b/sdcm/tester.py
@@ -2032,7 +2032,6 @@ def run_stress_thread_bench(self, stress_cmd, duration=None, round_robin=False,
node_list=self.db_cluster.nodes,
round_robin=round_robin,
stop_test_on_failure=stop_test_on_failure,
- credentials=self.db_cluster.get_db_auth(),
params=self.params,
)
bench_thread.run()
diff --git a/sdcm/ycsb_thread.py b/sdcm/ycsb_thread.py
--- a/sdcm/ycsb_thread.py
+++ b/sdcm/ycsb_thread.py
@@ -158,12 +158,12 @@ def copy_template(self, cmd_runner, loader_name, memo={}): # pylint: disable=da
dynamodb.primaryKeyType = {alternator.enums.YCSBSchemaTypes.HASH_SCHEMA.value}
''')
if self.params.get('alternator_enforce_authorization'):
- aws_credentials_content = dedent(f""""
+ aws_credentials_content = dedent(f"""
accessKey = {self.params.get('alternator_access_key_id')}
secretKey = {alternator.api.Alternator.get_salted_hash(node=self.node_list[0], username=self.params.get('alternator_access_key_id'))}
""")
else:
- aws_credentials_content = dedent(f""""
+ aws_credentials_content = dedent(f"""
accessKey = {self.params.get('alternator_access_key_id')}
secretKey = {self.params.get('alternator_secret_access_key')}
""")
diff --git a/unit_tests/conftest.py b/unit_tests/conftest.py
--- a/unit_tests/conftest.py
+++ b/unit_tests/conftest.py
@@ -56,7 +56,7 @@ def prom_address():
@pytest.fixture(name='docker_scylla', scope='function')
-def fixture_docker_scylla(request: pytest.FixtureRequest): # pylint: disable=too-many-locals
+def fixture_docker_scylla(request: pytest.FixtureRequest, params): # pylint: disable=too-many-locals
docker_scylla_args = {}
if test_marker := request.node.get_closest_marker("docker_scylla_args"):
docker_scylla_args = test_marker.kwargs
@@ -69,8 +69,8 @@ def fixture_docker_scylla(request: pytest.FixtureRequest): # pylint: disable=to
entryfile_path = entryfile_path / 'docker' / 'scylla-sct' / ('entry_ssl.sh' if ssl else 'entry.sh')
alternator_flags = "--alternator-port 8000 --alternator-write-isolation=always"
- docker_version = docker_scylla_args.get('image', "scylladb/scylla-nightly:5.5.0-dev-0.20240213.314fd9a11f23")
- cluster = LocalScyllaClusterDummy()
+ docker_version = docker_scylla_args.get('image', "scylladb/scylla-nightly:6.1.0-dev-0.20240605.2c3f7c996f98")
+ cluster = LocalScyllaClusterDummy(params=params)
if ssl:
curr_dir = os.getcwd()
@@ -145,7 +145,12 @@ def fixture_params(request: pytest.FixtureRequest):
os.environ['SCT_CLUSTER_BACKEND'] = 'docker'
params = sct_config.SCTConfiguration() # pylint: disable=attribute-defined-outside-init
-
+ params.update(dict(
+ authenticator='PasswordAuthenticator',
+ authenticator_user='cassandra',
+ authenticator_password='cassandra',
+ authorizer='CassandraAuthorizer',
+ ))
yield params
for k in os.environ:
diff --git a/unit_tests/dummy_remote.py b/unit_tests/dummy_remote.py
--- a/unit_tests/dummy_remote.py
+++ b/unit_tests/dummy_remote.py
@@ -90,14 +90,14 @@ def ssl_conf_dir(self):
class LocalLoaderSetDummy(BaseCluster):
# pylint: disable=super-init-not-called,abstract-method
- def __init__(self, nodes=None):
+ def __init__(self, nodes=None, params=None):
self.name = "LocalLoaderSetDummy"
- self.params = {}
+ self.params = params or {}
+ self.added_password_suffix = False
self.nodes = nodes if nodes is not None else [LocalNode("loader_node", parent_cluster=self)]
- @staticmethod
- def get_db_auth():
- return None
+ def add_nodes(self, *args, **kwargs):
+ raise NotImplementedError
@staticmethod
def is_kubernetes():
@@ -107,15 +107,17 @@ def get_loader(self):
return self.nodes[0]
-class LocalScyllaClusterDummy(BaseScyllaCluster):
+class LocalScyllaClusterDummy(BaseScyllaCluster, BaseCluster):
# pylint: disable=super-init-not-called
- def __init__(self):
+ def __init__(self, params=None):
self.name = "LocalScyllaClusterDummy"
- self.params = {}
+ self.params = params or {}
+ self.added_password_suffix = False
+ self.log = logging.getLogger(
self.name)
+ self._node_cycle = None
- @staticmethod
- def get_db_auth():
- return None
+ def add_nodes(self, *args, **kwargs):
+ raise NotImplementedError
def get_ip_to_node_map(self):
"""returns {ip: node} map for all nodes in cluster to get node by ip"""
diff --git a/unit_tests/lib/alternator_utils.py b/unit_tests/lib/alternator_utils.py
--- a/unit_tests/lib/alternator_utils.py
+++ b/unit_tests/lib/alternator_utils.py
@@ -17,12 +17,15 @@
dynamodb_primarykey_type="HASH_AND_RANGE",
alternator_use_dns_routing=True,
alternator_port=ALTERNATOR_PORT,
+ alternator_enforce_authorization=True,
+ alternator_access_key_id='alternator',
+ alternator_secret_access_key='password',
+ authenticator='PasswordAuthenticator',
+ authenticator_user='cassandra',
+ authenticator_password='cassandra',
+ authorizer='CassandraAuthorizer',
docker_network='ycsb_net',
)
ALTERNATOR = alternator.api.Alternator(
- sct_params={
- "alternator_access_key_id": None,
- "alternator_secret_access_key": None,
- "alternator_port": ALTERNATOR_PORT,
- }
+ sct_params=TEST_PARAMS
)
diff --git a/unit_tests/test_cassandra_stress_thread.py b/unit_tests/test_cassandra_stress_thread.py
--- a/unit_tests/test_cassandra_stress_thread.py
+++ b/unit_tests/test_cassandra_stress_thread.py
@@ -24,7 +24,7 @@
def test_01_cassandra_stress(request, docker_scylla, params):
params['cs_debug'] = True
- loader_set = LocalLoaderSetDummy()
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
"""cassandra-stress write cl=ONE duration=1m -schema 'replication(strategy=NetworkTopologyStrategy,replication_factor=1) """
@@ -52,7 +52,7 @@ def cleanup_thread():
def test_02_cassandra_stress_user_profile(request, docker_scylla, params):
- loader_set = LocalLoaderSetDummy()
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
"cassandra-stress user profile=/tmp/cassandra-stress-custom.yaml ops'(insert=1,simple1=1)' "
@@ -81,7 +81,7 @@ def cleanup_thread():
@pytest.mark.docker_scylla_args(ssl=True)
def test_03_cassandra_stress_client_encrypt(request, docker_scylla, params):
- loader_set = LocalLoaderSetDummy()
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
"cassandra-stress write cl=ONE duration=1m -schema 'compaction(strategy=SizeTieredCompactionStrategy) "
@@ -113,8 +113,8 @@ def cleanup_thread():
assert float(output[0]["latency 99th percentile"]) > 0
-def test_03_cassandra_stress_multi_region(request, docker_scylla, params):
- loader_set = LocalLoaderSetDummy()
+def test_04_cassandra_stress_multi_region(request, docker_scylla, params):
+ loader_set = LocalLoaderSetDummy(params=params)
loader_set.test_config.set_multi_region(True)
request.addfinalizer(lambda: loader_set.test_config.set_multi_region(False))
cmd = (
diff --git a/unit_tests/test_cluster.py b/unit_tests/test_cluster.py
--- a/unit_tests/test_cluster.py
+++ b/unit_tests/test_cluster.py
@@ -746,21 +746,26 @@ def test_get_any_ks_cf_list(docker_scylla, params, events): # pylint: disable=u
'system.cdc_local', 'system.versions', 'system_distributed_everywhere.cdc_generation_descriptions_v2',
'system.scylla_local', 'system.cluster_status', 'system.protocol_servers',
'system_distributed.cdc_streams_descriptions_v2', 'system_schema.keyspaces',
- 'system.size_estimates', 'system_schema.scylla_tables', 'system_auth.roles',
+ 'system.size_estimates', 'system_schema.scylla_tables',
'system.scylla_table_schema_history', 'system_schema.views',
'system_distributed.view_build_status', 'system.built_views',
'mview.users_by_first_name', 'mview.users_by_last_name', 'mview.users',
'system."IndexInfo"', 'system.batchlog', 'system.compactions_in_progress',
'system.hints', 'system.large_cells', 'system.large_partitions', 'system.large_rows',
'system.paxos', 'system.peer_events', 'system.peers', 'system.range_xfers', 'system.repair_history',
'system.scylla_views_builds_in_progress', 'system.snapshots', 'system.sstable_activity',
- 'system.truncated', 'system.views_builds_in_progress', 'system_auth.role_attributes',
- 'system_auth.role_members', 'system_distributed.service_levels', 'system_schema.aggregates',
+ 'system.truncated', 'system.views_builds_in_progress',
+ 'system_distributed.service_levels', 'system_schema.aggregates',
'system_schema.computed_columns', 'system_schema.dropped_columns', 'system_schema.functions',
'system_schema.indexes', 'system_schema.scylla_aggregates', 'system_schema.scylla_keyspaces',
'system_schema.triggers', 'system_schema.types', 'system_schema.view_virtual_columns',
'system_traces.events', 'system_traces.node_slow_log', 'system_traces.node_slow_log_time_idx',
'system_traces.sessions', 'system_traces.sessions_time_idx',
+ 'system.role_attributes', 'system.role_members', 'system.role_permissions',
+ 'system.roles', 'system.service_levels_v2',
+ 'system.tablets',
+ 'system.topology', 'system.topology_requests',
+ 'system.cdc_generations_v3',
'"123_keyspace"."120users"', '"123_keyspace".users'}
table_names = cluster.get_non_system_ks_cf_list(docker_scylla, filter_empty_tables=False, filter_out_mv=True)
@@ -790,18 +795,10 @@ def test_filter_out_ks_with_rf_one(docker_scylla, params, events): # pylint: di
session.execute(
"INSERT INTO mview.users (username, first_name, last_name, password) VALUES "
"('fruch', 'Israel', 'Fruchter', '1111')")
- session.execute(
- "CREATE KEYSPACE mview2 WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 2}")
- session.execute(
- "CREATE TABLE mview2.users (username text, first_name text, last_name text, password text, email text, "
- "last_access timeuuid, PRIMARY KEY(username))")
- session.execute(
- "INSERT INTO mview2.users (username, first_name, last_name, password) VALUES "
- "('fruch', 'Israel', 'Fruchter', '1111')")
docker_scylla.run_nodetool('flush')
table_names = cluster.get_non_system_ks_cf_list(docker_scylla, filter_func=cluster.is_ks_rf_one)
- assert table_names == ['mview2.users']
+ assert table_names == []
class TestNodetool(unittest.TestCase):
diff --git a/unit_tests/test_latte_thread.py b/unit_tests/test_latte_thread.py
--- a/unit_tests/test_latte_thread.py
+++ b/unit_tests/test_latte_thread.py
@@ -27,8 +27,7 @@
def test_01_latte_schema(request, docker_scylla, params):
- loader_set = LocalLoaderSetDummy()
- loader_set.params = params
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = ("latte schema docker/latte/workloads/workload.rn")
@@ -67,8 +66,7 @@ def cleanup_thread():
def test_03_latte_run(request, docker_scylla, prom_address, params):
- loader_set = LocalLoaderSetDummy()
- loader_set.params = params
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = ("latte run --function run -d 10s docker/latte/workloads/workload.rn --generate-report")
@@ -106,8 +104,7 @@ def check_metrics():
def test_04_latte_run_client_encrypt(request, docker_scylla, params):
params['client_encrypt'] = True
- loader_set = LocalLoaderSetDummy()
- loader_set.params = params
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = ("latte run -d 10s docker/latte/workloads/workload.rn --generate-report")
diff --git a/unit_tests/test_ndbench_thread.py b/unit_tests/test_ndbench_thread.py
--- a/unit_tests/test_ndbench_thread.py
+++ b/unit_tests/test_ndbench_thread.py
@@ -12,7 +12,7 @@
def test_01_cql_api(request, docker_scylla, params):
- loader_set = LocalLoaderSetDummy()
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
"ndbench cli.clientName=CassJavaDriverGeneric ; numKeys=20000000 ; "
"numReaders=8; numWriters=8 ; cass.writeConsistencyLevel=QUORUM ; "
@@ -34,7 +34,7 @@ def test_02_cql_kill(request, docker_scylla, params):
"""
verifies that kill command on the NdBenchStressThread is working
"""
- loader_set = LocalLoaderSetDummy()
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
"ndbench cli.clientName=CassJavaDriverGeneric ; numKeys=20000000 ; "
"numReaders=8; numWriters=8 ; cass.writeConsistencyLevel=QUORUM ; "
@@ -60,7 +60,7 @@ def test_03_dynamodb_api(request, docker_scylla, events, params):
"""
# start a command that would yield errors
- loader_set = LocalLoaderSetDummy()
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
f"ndbench cli.clientName=DynamoDBKeyValue ; numKeys=20000000 ; "
f"numReaders=8; numWriters=8 ; readRateLimit=7200 ; writeRateLimit=1800; "
@@ -91,7 +91,7 @@ def cleanup_thread():
def test_04_verify_data(request, docker_scylla, events, params):
- loader_set = LocalLoaderSetDummy()
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
"ndbench cli.clientName=CassJavaDriverGeneric ; numKeys=30 ; "
"readEnabled=false; numReaders=0; numWriters=1 ; cass.writeConsistencyLevel=QUORUM ; "
diff --git a/unit_tests/test_scylla_bench_thread.py b/unit_tests/test_scylla_bench_thread.py
--- a/unit_tests/test_scylla_bench_thread.py
+++ b/unit_tests/test_scylla_bench_thread.py
@@ -31,7 +31,7 @@
],
)
def test_01_scylla_bench(request, docker_scylla, params, extra_cmd):
- loader_set = LocalLoaderSetDummy()
+ loader_set = LocalLoaderSetDummy(params=params)
if extra_cmd == "cloud-config":
params["k8s_connection_bundle_file"] = "/home/fruch/Downloads/k8s_config.yaml"
docker_scylla.parent_cluster.params = params
diff --git a/unit_tests/test_ycsb_thread.py b/unit_tests/test_ycsb_thread.py
--- a/unit_tests/test_ycsb_thread.py
+++ b/unit_tests/test_ycsb_thread.py
@@ -16,6 +16,7 @@
import pytest
import requests
from cassandra.cluster import Cluster # pylint: disable=no-name-in-module
+from cassandra.auth import PlainTextAuthProvider
from sdcm.utils import alternator
from sdcm.utils.decorators import timeout
@@ -25,13 +26,31 @@
from unit_tests.lib.alternator_utils import ALTERNATOR_PORT, ALTERNATOR, TEST_PARAMS
pytestmark = [
- pytest.mark.usefixtures("events", "create_table", "create_cql_ks_and_table"),
+ pytest.mark.usefixtures("events"),
pytest.mark.integration,
]
+...@pytest.fixture(scope="function", name="cql_driver")
+def fixture_cql_driver(docker_scylla):
+ if running_in_docker():
+ address = f"{docker_scylla.internal_ip_address}:9042"
+ else:
+ address = docker_scylla.get_port("9042")
+ node_ip, port = address.split(":")
+ port = int(port)
+ return Cluster([node_ip], port=port,
+ auth_provider=PlainTextAuthProvider(username='cassandra', password='cassandra'))
+
+
@pytest.fixture(scope="function")
-def create_table(docker_scylla):
+def create_table(docker_scylla, cql_driver):
+
+ with cql_driver.connect() as session:
+ session.execute("CREATE ROLE %s WITH PASSWORD = %s",
+ (TEST_PARAMS.get('alternator_access_key_id'),
+ TEST_PARAMS.get('alternator_secret_access_key')))
+
def create_endpoint_url(node):
if running_in_docker():
endpoint_url = f"http://{node.internal_ip_address}:{ALTERNATOR_PORT}"
@@ -47,16 +66,9 @@ def create_endpoint_url(node):
@pytest.fixture(scope="function")
-def create_cql_ks_and_table(docker_scylla):
- if running_in_docker():
- address = f"{docker_scylla.internal_ip_address}:9042"
- else:
- address = docker_scylla.get_port("9042")
- node_ip, port = address.split(":")
- port = int(port)
+def create_cql_ks_and_table(cql_driver):
- cluster_driver = Cluster([node_ip], port=port)
- session = cluster_driver.connect()
+ session = cql_driver.connect()
session.execute(
"""create keyspace ycsb WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor': 1 };"""
)
@@ -76,10 +88,11 @@ def create_cql_ks_and_table(docker_scylla):
)
+...@pytest.mark.usefixtures("create_table")
@pytest.mark.docker_scylla_args(docker_network='ycsb_net')
def test_01_dynamodb_api(request, docker_scylla, prom_address, params):
- loader_set = LocalLoaderSetDummy()
params.update(TEST_PARAMS)
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
"bin/ycsb run dynamodb -P workloads/workloada -threads 5 -p recordcount=1000000 "
@@ -116,11 +129,13 @@ def check_metrics():
assert float(output[0]["latency 99th percentile"]) > 0
+...@pytest.mark.usefixtures("create_table")
+...@pytest.mark.docker_scylla_args(docker_network='ycsb_net')
def test_02_dynamodb_api_dataintegrity(
request, docker_scylla, prom_address, events, params
):
- loader_set = LocalLoaderSetDummy()
params.update(TEST_PARAMS)
+ loader_set = LocalLoaderSetDummy(params=params)
# 2. do write without dataintegrity=true
cmd = (
@@ -179,9 +194,11 @@ def check_metrics():
assert "=ERROR" in cat["ERROR"][1]
+...@pytest.mark.usefixtures("create_cql_ks_and_table")
+...@pytest.mark.docker_scylla_args(docker_network='ycsb_net')
def test_03_cql(request, docker_scylla, prom_address, params):
- loader_set = LocalLoaderSetDummy()
params.update(TEST_PARAMS)
+ loader_set = LocalLoaderSetDummy(params=params)
cmd = (
"bin/ycsb load scylla -P workloads/workloada -threads 5 -p recordcount=1000000 "
@@ -212,6 +229,7 @@ def check_metrics():
ycsb_thread.get_results()
+...@pytest.mark.usefixtures("create_table")
def test_04_insert_new_data(docker_scylla):
schema = alternator.schemas.HASH_AND_STR_RANGE_SCHEMA
schema_keys = [key_details["AttributeName"] for key_details in schema["KeySchema"]]