Skip to content

Commit

Permalink
fix(docker-backend): do not start scylla-manager installation
Browse files Browse the repository at this point in the history
If scylla-manager is not disabled in a test config when running a test on docker
backend, the test will try to install the manager and eventually fail (this is
due to the fact that SCT installs scylla-manager server on monitor node and docker
backend doesn't support dedicated monitoring node docker instance).

The change adds a check for this situation, to be able to fail fast and
do not continue uch a test configuration on docker backend.

Closes: scylladb#9028
  • Loading branch information
dimakr committed Nov 22, 2024
1 parent 51856ad commit 09bde27
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdcm/sct_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,10 @@ def __init__(self): # noqa: PLR0912, PLR0914, PLR0915
assert len(zero_nodes_num) == len(
data_nodes_num), "Config of zero token nodes is not equal config of data nodes for multi dc"

# 21 Validate Manager is not enabled for docker backend
if cluster_backend == "docker" and self.get("use_mgmt"):
raise ValueError(f"Scylla Manager is not supported for docker backend")

def log_config(self):
self.log.info(self.dump_config())

Expand Down
4 changes: 4 additions & 0 deletions unit_tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def test_05_docker(self):

def test_06a_docker_latest_no_loader(self):
os.environ['SCT_CLUSTER_BACKEND'] = 'docker'
os.environ['SCT_USE_MGMT'] = 'false'
os.environ['SCT_SCYLLA_VERSION'] = 'latest'
os.environ['SCT_N_LOADERS'] = "0"
docker_tag_after_processing = "fake_specific_docker_tag"
Expand All @@ -118,6 +119,7 @@ def test_06a_docker_latest_no_loader(self):

def test_06b_docker_development(self):
os.environ['SCT_CLUSTER_BACKEND'] = 'docker'
os.environ['SCT_USE_MGMT'] = 'false'
os.environ['SCT_SCYLLA_VERSION'] = '666.development-blah'
os.environ['SCT_SCYLLA_REPO_LOADER'] = RPM_URL

Expand All @@ -143,12 +145,14 @@ def test_08_baremetal(self):

def test_09_unknown_configure(self):
os.environ['SCT_CLUSTER_BACKEND'] = 'docker'
os.environ['SCT_USE_MGMT'] = 'false'
os.environ['SCT_CONFIG_FILES'] = 'internal_test_data/unknown_param_in_config.yaml'
conf = sct_config.SCTConfiguration()
self.assertRaises(ValueError, conf.verify_configuration)

def test_09_unknown_env(self):
os.environ['SCT_CLUSTER_BACKEND'] = 'docker'
os.environ['SCT_USE_MGMT'] = 'false'
os.environ['SCT_CONFIG_FILES'] = 'internal_test_data/unknown_param_in_config.yaml'
os.environ['SCT_WHAT_IS_THAT'] = 'just_made_this_up'
os.environ['SCT_WHAT_IS_THAT_2'] = 'what is this ?'
Expand Down
3 changes: 3 additions & 0 deletions unit_tests/test_scan_operation_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def test_scan_negative_operation_timed_out(mode, severity, timeout, execute_mock
connection = ExecuteAsyncOperationTimedOutMockCqlConnectionPatient()
else:
connection = ExecuteOperationTimedOutMockCqlConnectionPatient()
os.environ['SCT_USE_MGMT'] = 'false'
db_cluster = DBCluster(connection, [node], {})
node.parent_cluster = db_cluster
default_params = ThreadParams(
Expand Down Expand Up @@ -219,6 +220,7 @@ def test_scan_negative_read_timedout(execute_mock, expected_message, events, nod
# pylint: disable=too-many-arguments

connection = execute_mock()
os.environ['SCT_USE_MGMT'] = 'false'
db_cluster = DBCluster(connection, [node], {})
node.parent_cluster = db_cluster
default_params = ThreadParams(
Expand Down Expand Up @@ -267,6 +269,7 @@ def test_scan_negative_exception(mode, severity, running_nemesis, execute_mock,
connection = ExecuteAsyncExceptionMockCqlConnectionPatient()
else:
connection = ExecuteExceptionMockCqlConnectionPatient()
os.environ['SCT_USE_MGMT'] = 'false'
db_cluster = DBCluster(connection, [node], {})
node.parent_cluster = db_cluster
default_params = ThreadParams(
Expand Down
1 change: 1 addition & 0 deletions unit_tests/test_seed_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def tearDownClass(cls):
shutil.rmtree(cls.temp_dir)

def setup_cluster(self, nodes_number):
os.environ['SCT_USE_MGMT'] = 'false'
self.cluster = DummyCluster()
# Add 3 nodes
for i in range(1, nodes_number+1):
Expand Down
2 changes: 2 additions & 0 deletions unit_tests/test_sla_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
import time
import unittest
from typing import NamedTuple
Expand Down Expand Up @@ -99,6 +100,7 @@ def test_less_runtime_than_expected_error(self):
parent_cluster=None,
ssh_login_info=dict(key_file='~/.ssh/scylla-test'))

os.environ['SCT_USE_MGMT'] = 'false'
db_cluster = DummyDbCluster(nodes=[node])
prometheus_stats = FakePrometheus()
session = FakeSession()
Expand Down

0 comments on commit 09bde27

Please sign in to comment.