Skip to content

Commit

Permalink
engine: Use drop-in for logging configuration
Browse files Browse the repository at this point in the history
Requires: oVirt/ovirt-engine#553

Signed-off-by: Marcin Sobczyk <msobczyk@redhat.com>
  • Loading branch information
tinez committed Jul 25, 2022
1 parent 2b55f67 commit af5d848
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
25 changes: 0 additions & 25 deletions basic-suite-master/test-scenarios/test_001_initialize_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,16 @@
#
from __future__ import absolute_import

import os
import os.path

import pytest

from ost_utils.ansible.collection import engine_setup


@pytest.fixture(scope="function")
def xml_with_debug_enabled(ansible_engine):
xml_path = '/usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.xml.in'
xml_tmp_path = f'/tmp/{os.path.basename(xml_path)}'
if os.environ.get('ENABLE_DEBUG_LOGGING'):
ansible_engine.shell(f'mv {xml_path} {xml_tmp_path} && cp {xml_tmp_path} {xml_path}')
ansible_engine.shell(
'sed -i '
'-e "/.*logger category=\\"org.ovirt\\"/{ n; s/INFO/DEBUG/ }" '
'-e "/.*logger category=\\"org.ovirt.engine.core.bll\\"/{ n; s/INFO/DEBUG/ }" ' # noqa: E501
'-e "/.*logger category=\\"org.keycloak\\"/{ n; s/INFO/DEBUG/ }" '
'-e "/.*<root-logger>/{ n; s/INFO/DEBUG/ }" '
f'{xml_path}'
)
yield
if os.environ.get('ENABLE_DEBUG_LOGGING'):
ansible_engine.shell(f'mv {xml_tmp_path} {xml_path}')


def test_initialize_engine(
ansible_engine,
ansible_inventory,
engine_ip,
engine_hostname,
ssh_key_file,
engine_answer_file_path,
xml_with_debug_enabled,
):
engine_setup(
ansible_engine,
Expand Down
6 changes: 6 additions & 0 deletions ost_utils/ansible/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def engine_setup(
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)

ansible_engine.copy(
content='ORG_OVIRT_LOG_LEVEL="DEBUG"\nKEYCLOAK_LOG_LEVEL="DEBUG"\nCORE_BLL_LOG_LEVEL="DEBUG"\nROOT_LOG_LEVEL="DEBUG"', # noqa: E501
dest='/etc/ovirt-engine/engine.conf.d/98-logging.conf',
mode='0644',
)

ansible_engine.copy(
content=f'SSO_ALTERNATE_ENGINE_FQDNS="${{SSO_ALTERNATE_ENGINE_FQDNS}} {host_ip} {host_name} {engine_ip}"\n', # noqa: E501
dest='/etc/ovirt-engine/engine.conf.d/99-custom-fqdn.conf',
Expand Down

0 comments on commit af5d848

Please sign in to comment.