From 7c562afabb33d76e4133787d9c59684c818e4330 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 20 Nov 2024 18:55:56 +0100 Subject: [PATCH] redirect --- tests/foreman/sys/test_fam.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/foreman/sys/test_fam.py b/tests/foreman/sys/test_fam.py index 0ce623f859..5c82fd2383 100644 --- a/tests/foreman/sys/test_fam.py +++ b/tests/foreman/sys/test_fam.py @@ -12,6 +12,8 @@ """ +from pathlib import Path + from broker import Broker import pytest import yaml @@ -190,6 +192,12 @@ def test_positive_run_modules_and_roles(module_target_sat, setup_fam, ansible_mo # Execute test_playbook result = module_target_sat.execute( - f'export NO_COLOR=True && export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 && cd {FAM_ROOT_DIR} && make livetest_{ansible_module} PYTHON_COMMAND="python3" PYTEST_COMMAND="pytest-3.11"' + f'export NO_COLOR=True && export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 && cd {FAM_ROOT_DIR} && make livetest_{ansible_module} PYTHON_COMMAND="python3" PYTEST_COMMAND="pytest-3.11" >/tmp/pytest.stdout 2>/tmp/pytest.stderr' ) - assert result.status == 0, f"{result.status=}\nstdout:\n{result.stdout} stderr:\n{result.stderr}" + module_target_sat.get('/tmp/pytest.stdout', 'pytest.stdout') + module_target_sat.get('/tmp/pytest.stderr', 'pytest.stderr') + + stdout = Path('pytest.stdout').read_text() + stderr = Path('pytest.stderr').read_text() + + assert result.status == 0, f"{result.status=}\nstdout:\n{stdout} stderr:\n{stderr}"