ipatests: healthcheck: Handle missing fips-mode-setup

freeipa-healthcheck prechecks existance of `fips-mode-setup` and
reports if it's missing:
> "fips": "missing /bin/fips-mode-setup"

Fixes: https://pagure.io/freeipa/issue/9315
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Stanislav Levin 2023-01-27 17:25:59 +03:00 committed by Florence Blanc-Renaud
parent 51b1c22d02
commit 1be3188e31

View File

@ -353,15 +353,19 @@ class TestIpaHealthCheck(IntegrationTest):
failures_only=False)
assert returncode == 0
cmd = self.master.run_command(['fips-mode-setup', '--is-enabled'],
raiseonerr=False)
cmd = self.master.run_command(
[paths.FIPS_MODE_SETUP, "--is-enabled"], raiseonerr=False
)
returncode = cmd.returncode
# If this produces IndexError, the check does not exist
assert "fips" in check[0]["kw"]
if check[0]["kw"]["fips"] == "disabled":
assert returncode == 2
elif check[0]["kw"]["fips"] == "enabled":
assert returncode == 0
elif check[0]["kw"]["fips"] == f"missing {paths.FIPS_MODE_SETUP}":
assert returncode == 127
else:
assert returncode == 1