Skip to content

Commit 24b87a0

Browse files
committed
ipa: truncate logs before each test
So we can collect fresh logs from each test run. We use truncate insted of rm to avoid additional and time consuming IPA service restart.
1 parent 720cf09 commit 24b87a0

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • sssd_test_framework/hosts

sssd_test_framework/hosts/ipa.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,20 @@ def features(self) -> dict[str, bool]:
9999

100100
return self._features
101101

102+
def setup(self) -> None:
103+
"""
104+
Truncate existing IPA logs before each test to avoid need for restart.
105+
"""
106+
self.conn.run(
107+
"""
108+
set -ex
109+
truncate --size 0 /var/log/dirsrv/*/*
110+
truncate --size 0 /var/log/httpd/*
111+
truncate --size 0 /var/log/ipa/*
112+
truncate --size 0 /var/log/krb5kdc.log
113+
"""
114+
)
115+
102116
def kinit(self) -> None:
103117
"""
104118
Obtain ``admin`` user Kerberos TGT.

0 commit comments

Comments
 (0)