ipatests: properly handle journalctl return code

The test test_installation.py::TestInstallMaster::test_selinux_avcs
is failing when no AVCs are detected because it is calling
journalctl --full --grep=AVC--since=yesterday
and the command exits with return code 1.

Call the command with raiseonerr=False to support this case.

Fixes: https://pagure.io/freeipa/issue/8541
Reviewed-By: Mohammad Rizwan Yusuf <myusuf@redhat.com>
Reviewed-By: Francois Cami <fcami@redhat.com>
This commit is contained in:
Florence Blanc-Renaud 2020-10-13 12:19:13 +02:00
parent 5de67028d0
commit cb7d096422

View File

@ -902,7 +902,7 @@ class TestInstallMaster(IntegrationTest):
# installed by default and journalctl gives us all AVCs.
result = self.master.run_command([
"journalctl", "--full", "--grep=AVC", "--since=yesterday"
])
], raiseonerr=False)
avcs = list(
line.strip() for line in result.stdout_text.split('\n')
if "AVC avc:" in line