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 authored and Rob Crittenden committed 2023-01-30 15:26:24 -05:00
1 parent 5d9f59038d
commit 203b7d1cb5
1 file changed
+7 -3
@@ -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