From d01e171a95ca6f6b254c4fc70065b845bff38020 Mon Sep 17 00:00:00 2001 From: Matteo Stifano Date: Fri, 26 Jan 2024 09:08:28 +0100 Subject: [PATCH] test_update: Avoid updating config after site update The site-update process includes config-update as well. There is no need to force a config-update again afterwards. Change-Id: I30dc88f2bcaf0286d1f7d28c9fd3bd79b1f1f509 --- tests/update/conftest.py | 19 ------------------- tests/update/test_update.py | 7 +------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/tests/update/conftest.py b/tests/update/conftest.py index 75c9df3eeeb..8d4e15c6c41 100644 --- a/tests/update/conftest.py +++ b/tests/update/conftest.py @@ -119,25 +119,6 @@ def get_site_status(site: Site) -> str | None: return None -def update_config(site: Site) -> int: - """Run cmk-update-config and check the result. - - If merging the config worked fine, return 0. - If merging the config was not possible, use installation defaults and return 1. - If any other error occurred, return 2. - """ - for rc, conflict_mode in enumerate(("abort", "install")): - cmd = [f"{site.root}/bin/cmk-update-config", "-v", f"--conflict={conflict_mode}"] - process = site.execute(cmd, stdout=subprocess.PIPE) - stdout, _ = process.communicate() - rc = process.returncode - if rc == 0: - logger.debug(stdout) - return rc - logger.error(stdout) - return 2 - - def _get_site(version: CMKVersion, interactive: bool, base_site: Site | None = None) -> Site: """Install or update the test site with the given version. diff --git a/tests/update/test_update.py b/tests/update/test_update.py index 206b40d5ac9..74166cf8b82 100644 --- a/tests/update/test_update.py +++ b/tests/update/test_update.py @@ -16,7 +16,7 @@ from cmk.utils.hostaddress import HostName from cmk.utils.version import Edition -from .conftest import get_site_status, update_config, update_site +from .conftest import get_site_status, update_site logger = logging.getLogger(__name__) @@ -93,11 +93,6 @@ def test_update( # pylint: disable=too-many-branches target_site = update_site(test_site, target_version, not disable_interactive_mode) - # Triggering cmk config update - update_config_result = update_config(target_site) - - assert update_config_result == 0, "Updating the configuration failed unexpectedly!" - # get the service status codes and check them assert get_site_status(target_site) == "running", "Invalid service status after updating!"