From 2322b598a705ed3da89b9097a9232c6a305e2fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Slowenski?= Date: Thu, 12 Dec 2024 14:46:50 +0100 Subject: [PATCH] integration tests: Fix file access in test_http_methods Instead of calling check_output(), we should use Site.read_file() when accessing files in a site. Change-Id: Ic58926e0139138b687f897b9e3af79bcc3b307dd --- tests/integration/omd/test_apache.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/integration/omd/test_apache.py b/tests/integration/omd/test_apache.py index 6da709a6cf6..7403d9ed3b3 100644 --- a/tests/integration/omd/test_apache.py +++ b/tests/integration/omd/test_apache.py @@ -10,7 +10,6 @@ import requests from tests.testlib.site import Site -from tests.testlib.utils import check_output def test_http_methods(site: Site) -> None: @@ -23,9 +22,8 @@ def test_http_methods(site: Site) -> None: "PROPFIND", site.internal_url, timeout=5, headers={"User-Agent": user_agent} ) assert response.status_code == 405 - apache_log_file = check_output( - ["cat", site.path("var/log/apache/access_log").as_posix()], sudo=True - ) + + apache_log_file = site.read_file("var/log/apache/access_log") for line in apache_log_file.splitlines(): if re.match(r'^.*"PROPFIND /\w+/check_mk/ HTTP/1.1" 405 \d+ "-" "' + user_agent, line): return