From 3244e27962659c79e40ab7e82b985dd3ef61c96b Mon Sep 17 00:00:00 2001 From: sumenon Date: Apr 23 2020 18:07:31 +0000 Subject: ipatests: Test for ipahealthcheck.ds.ruv check This test ensures that RUVCheck for ipahealthcheck.ds.ruv source displays correct result Signed-off-by: sumenon Reviewed-By: Rob Crittenden Reviewed-By: Mohammad Rizwan Yusuf --- diff --git a/ipatests/test_integration/test_ipahealthcheck.py b/ipatests/test_integration/test_ipahealthcheck.py index f9ce536..958728f 100644 --- a/ipatests/test_integration/test_ipahealthcheck.py +++ b/ipatests/test_integration/test_ipahealthcheck.py @@ -532,6 +532,39 @@ class TestIpaHealthCheck(IntegrationTest): assert check["result"] == "SUCCESS" assert check["kw"]["key"] in SRV_RECORDS + def test_ipa_healthcheck_ds_ruv_check(self): + """ + This testcase checks that ipa-healthcheck tool with RUVCheck + discovers the same RUV entries as the ipa-replica-manage list-ruv + command + """ + result = self.master.run_command( + [ + "ipa-replica-manage", + "list-ruv", + "-p", + self.master.config.dirman_password, + ] + ) + output = re.findall( + r"\w+.+.\w+.\w:\d+", result.stdout_text.replace("389: ", "") + ) + ruvs = [] + for r in output: + (host, r) = r.split(":") + if host == self.master.hostname: + ruvs.append(r) + returncode, data = run_healthcheck( + self.master, "ipahealthcheck.ds.ruv", "RUVCheck" + ) + assert returncode == 0 + for check in data: + assert check["result"] == "SUCCESS" + assert check["kw"]["key"] in (self.master.domain.basedn, "o=ipaca") + assert check["kw"]["ruv"] in ruvs + ruvs.remove(check["kw"]["ruv"]) + assert not ruvs + def test_ipa_healthcheck_output_indent(self): """ This test case checks whether default (2) indentation is applied