Bug 1780062

Summary: [RFE] When IPA system is healthy, ipa-healthcheck --failures-only should display proper message instead of empty list
Product: Red Hat Enterprise Linux 8 Reporter: Sudhir Menon <sumenon>
Component: ipa-healthcheckAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: low    
Version: 8.1CC: antorres, fcami, frenaud, mpolovka, ndehadra, pcech, rcritten, ssidhaye, tscherf, twoerner
Target Milestone: rcKeywords: FutureFeature, TestCaseProvided, Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-healthcheck-0.7-5.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 18:21:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sudhir Menon 2019-12-05 10:34:59 UTC
Description of problem: When IPA system is healthy, ipa-healthcheck --failures-only should display proper message instead of empty list
 
Version-Release number of selected component (if applicable):
ipa-server-4.8.0-11.module+el8.1.0+4247+9f3fd721.x86_64


How reproducible: Always


Steps to Reproduce:
1. Lets assume ipa system is healthy.
2. Now run ipa-healthcheck-tool --failures-only
3. Check the output

Actual results:
The output displays an empty list i.e []

Expected results:
Instead of displaying an empty list i.e [], which doesn't make sense when a report is revisited, instead it should display user-friendly message e.g 'IPA system is/was in healthy state : <timestamp>'.
This makes sense for the customer viewing the report.

Additional info:

Comment 1 aman dwivedi 2019-12-05 12:44:19 UTC
I run the command, when there are no failures 'ipa-healthcheck --failures-only  --output-type=human --output-file abc' it creates an empty file only. I observe it also with different values severity(like WARNING, ERROR, CRITICAL) when all the checks are sucessful. It's better to have a proper message with a timestamp instead of an empty file.

Comment 2 Rob Crittenden 2019-12-05 12:59:02 UTC
For the JSON (default) case this is expected behavior and will not change.

For human I suppose we could spit out a message like "No issues found". I don't see the need for a date.

Comment 8 Rob Crittenden 2021-05-14 17:55:38 UTC
The IPA test TestIpaHealthCLI::test_severity is going to need to be adjusted to deal with the text response instead of an empty list. Checking that it returns non-zero should be sufficient IMHO.

Comment 12 Michal Polovka 2021-07-02 10:26:43 UTC
Verified manually (automation in review) using ipa-healthcheck-0.7-6.module+el8.5.0+11410+91a33fe4.noarch on RHEL8.5 system


# ipa-healthcheck --failures-only --output-type human
No issues found.

Comment 13 Florence Blanc-Renaud 2021-07-13 07:32:38 UTC
Test case added upstream in ipatests/test_integration/test_ipahealthcheck.py::TestIpaHealthCheck::test_human_output
master:
    b43ac4f ipatests: test_ipahealthcheck: print a message if a system is healthy
ipa-4-9:
    7f910eb ipatests: test_ipahealthcheck: print a message if a system is healthy

Comment 15 errata-xmlrpc 2021-11-09 18:21:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (ipa bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4230