mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-24 14:17:41 -05:00
ipatests: Setup and collect BIND logs
For Base/XMLRPC tests BIND's logs are already collected. Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
1 parent
07c423afd5
commit
65700bf743
4 files changed
+41
No files matched your search
@@ -48,6 +48,11 @@ if [ "$install_result" -eq 0 ] ; then
|
||||
|
||||
sed -ri "s/mode = production/mode = developer/" /etc/ipa/default.conf
|
||||
systemctl restart "$HTTPD_SYSTEMD_NAME"
|
||||
# debugging for BIND
|
||||
sed -i "s/severity info;/severity debug;/" "$BIND_LOGGING_OPTIONS_CONF"
|
||||
cat "$BIND_LOGGING_OPTIONS_CONF"
|
||||
systemctl restart "$BIND_SYSTEMD_NAME"
|
||||
|
||||
firewalld_cmd --add-service={freeipa-ldap,freeipa-ldaps,dns}
|
||||
|
||||
echo ${server_password} | kinit admin && ipa ping
|
||||
|
||||
@@ -7,6 +7,8 @@ HTTPD_BASEDIR='/etc/httpd'
|
||||
HTTPD_ALIASDIR="${HTTPD_BASEDIR}/alias"
|
||||
BIND_BASEDIR='/var/named'
|
||||
BIND_DATADIR="${BIND_BASEDIR}/data"
|
||||
BIND_SYSTEMD_NAME='named.service'
|
||||
BIND_LOGGING_OPTIONS_CONF='/etc/named/ipa-logging-ext.conf'
|
||||
|
||||
function firewalld_cmd() { :; }
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ from pytest_multihost import make_multihost_fixture
|
||||
|
||||
from ipapython import ipautil
|
||||
from ipaplatform.paths import paths
|
||||
from ipaplatform.constants import constants
|
||||
from . import fips
|
||||
from .config import Config
|
||||
from .env_config import get_global_config
|
||||
@@ -43,6 +44,8 @@ from . import tasks
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
CLASS_LOGFILES = [
|
||||
# BIND logs
|
||||
os.path.join(paths.NAMED_VAR_DIR, constants.NAMED_DATA_DIR),
|
||||
# dirsrv logs
|
||||
paths.VAR_LOG_DIRSRV,
|
||||
# IPA install logs
|
||||
|
||||
@@ -377,6 +377,7 @@ def install_master(host, setup_dns=True, setup_kra=False, setup_adtrust=False,
|
||||
setup_sssd_debugging(host)
|
||||
kinit_admin(host)
|
||||
if setup_dns:
|
||||
setup_named_debugging(host)
|
||||
# fixup DNS zone default TTL for IPA DNS zone
|
||||
# For tests we should not wait too long
|
||||
set_default_ttl_for_ipa_dns_zone(host, raiseonerr=raiseonerr)
|
||||
@@ -515,6 +516,8 @@ def install_replica(master, replica, setup_ca=True, setup_dns=False,
|
||||
enable_ds_audit_log(replica, 'on')
|
||||
setup_sssd_debugging(replica)
|
||||
kinit_admin(replica)
|
||||
if setup_dns:
|
||||
setup_named_debugging(replica)
|
||||
else:
|
||||
fw.disable_services(fw_services)
|
||||
return result
|
||||
@@ -810,6 +813,34 @@ def setup_sssd_debugging(host):
|
||||
clear_sssd_cache(host)
|
||||
|
||||
|
||||
def setup_named_debugging(host):
|
||||
"""
|
||||
Sets debug level to debug in each section of custom logging config
|
||||
"""
|
||||
|
||||
host.run_command(
|
||||
[
|
||||
"sed",
|
||||
"-i",
|
||||
"s/severity info;/severity debug;/",
|
||||
paths.NAMED_LOGGING_OPTIONS_CONF,
|
||||
],
|
||||
)
|
||||
host.run_command(["cat", paths.NAMED_LOGGING_OPTIONS_CONF])
|
||||
result = host.run_command(
|
||||
[
|
||||
"python3",
|
||||
"-c",
|
||||
(
|
||||
"from ipaplatform.services import knownservices; "
|
||||
"print(knownservices.named.systemd_name)"
|
||||
),
|
||||
]
|
||||
)
|
||||
service_name = result.stdout_text.strip()
|
||||
host.run_command(["systemctl", "restart", service_name])
|
||||
|
||||
|
||||
@contextmanager
|
||||
def remote_sssd_config(host):
|
||||
"""Context manager for editing sssd config file on a remote host.
|
||||
|
||||
Reference in new issue
Block a user