ipatests: ipactl status now exits with 3 when a service is stopped

Some tests are individually stopping a service and call
ipactl status to ensure it is stopped. They need to use
run_command with raiseonerr=False as ipactl status now
exits with 3 when one of the IPA services is down
(since commit 928ab51).

Related: https://pagure.io/freeipa/issue/8588
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Francois Cami <fcami@redhat.com>
This commit is contained in:
Florence Blanc-Renaud 2021-02-05 09:23:29 +01:00
parent 27ae8a93f5
commit 610d542c0e
3 changed files with 4 additions and 3 deletions

View File

@ -1481,7 +1481,7 @@ class TestInstallReplicaAgainstSpecificServer(IntegrationTest):
self.replicas[0].run_command('systemctl stop ipa-custodia.service')
# check if custodia service is stopped
cmd = self.replicas[0].run_command('ipactl status')
cmd = self.replicas[0].run_command('ipactl status', raiseonerr=False)
assert 'ipa-custodia Service: STOPPED' in cmd.stdout_text
try:

View File

@ -486,7 +486,8 @@ class TestIpaHealthCheck(IntegrationTest):
restart_service(self.master, "dirsrv")
dirsrv_ipactl_status = 'Directory Service: STOPPED'
result = self.master.run_command(
["ipactl", "status"])
["ipactl", "status"],
raiseonerr=False)
returncode, data = run_healthcheck(
self.master,
"ipahealthcheck.ipa.host",

View File

@ -702,7 +702,7 @@ class TestReplicaInstallCustodia(IntegrationTest):
tasks.install_replica(master, replica1, setup_ca=False)
replica1.run_command(['ipactl', 'status'])
replica1.run_command(['systemctl', 'stop', 'ipa-custodia'])
replica1.run_command(['ipactl', 'status'])
replica1.run_command(['ipactl', 'status'], raiseonerr=False)
# Install Replica2 with CA with source as Replica1.
tasks.install_replica(replica1, replica2, setup_ca=True)