#8662 Nightly test failure (rawhide) in test_ipahealthcheck.py::TestIpaHealthCheckFileCheck::test_ipa_filecheck_bad_owner
Closed: fixed by rcritten. Opened by frenaud.

The nightly test test_integration/test_ipahealthcheck.py::TestIpaHealthCheckFileCheck::test_ipa_filecheck_bad_owner is failing in rawhide while calling the check IPAFileCheck from ipahealthcheck.ipa.files.
See PR #649, with the following logs and report:

RUN ['ipa-healthcheck', '--source', 'ipahealthcheck.ipa.files', '--check', 'IPAFileCheck', '--output-type', 'json', '--failures-only']
[
  {
    "source": "ipahealthcheck.ipa.files",
    "check": "IPAFileCheck",
    "result": "WARNING",
    "uuid": "524dcab8-47ce-4b30-b188-a8b5ce6f33e2",
    "when": "20210116172325Z",
    "duration": "0.024026",
    "kw": {
      "key": "_etc_resolv.conf_owner",
      "path": "/etc/resolv.conf",
      "type": "owner",
      "expected": "root,systemd-resolve",
      "got": "admin",
      "msg": "Ownership of /etc/resolv.conf is admin and should be one of root,systemd-resolve"
    }
  }
]
Exit code: 1

Same issue with test_integration/test_ipahealthcheck.py::TestIpaHealthCheckFileCheck::test_ipa_filecheck_bad_group.

The test scenario is the following:
- modify /etc/resolv.conf owner or group to admin/admins and make sure that healthcheck detects the issue.
- ensure the correct err msg is returned.

On rawhide, ipa-healthcheck 0.8 is shipped and the expected err msg mentions that the expected owner/group should be [root, systemd-resolved]. Please see commit https://github.com/freeipa/freeipa-healthcheck/commit/930ec5ff075ec83ee3219ebc87c6eeb1aad80354

The test needs to be adapted.


The test also fails when the repo updates-testing is enabled in
- test_integration/test_ipahealthcheck.py::TestIpaHealthCheckFileCheck::test_nssdb_filecheck_bad_group:

self = <ipatests.test_integration.test_ipahealthcheck.TestIpaHealthCheckFileCheck object at 0x7f33b53c2e80>
modify_permissions = <function modify_permissions.<locals>._modify_permission at 0x7f33b53ca670>
    def test_nssdb_filecheck_bad_group(self, modify_permissions):
        for testfile in self.nssdb_testfiles:
            modify_permissions(self.master, testfile, group='root')
        returncode, data = run_healthcheck(
            self.master,
            "ipahealthcheck.ipa.files",
            "IPAFileNSSDBCheck",
            failures_only=True,
        )
        assert returncode == 1
        for check in data:
            assert check["result"] == "WARNING"
            assert check["kw"]["path"] in self.nssdb_testfiles
            assert check["kw"]["type"] == 'group'
>           assert check["kw"]["expected"] == 'pkiuser'
E           AssertionError: assert ['pkiuser'] == 'pkiuser'
E             +['pkiuser']
E             -'pkiuser'
  • test_integration/test_ipahealthcheck.py::TestIpaHealthCheckFileCheck::test_tomcat_filecheck_bad_group:
self = <ipatests.test_integration.test_ipahealthcheck.TestIpaHealthCheckFileCheck object at 0x7f33b4d6df70>
modify_permissions = <function modify_permissions.<locals>._modify_permission at 0x7f33b549ddc0>
    def test_tomcat_filecheck_bad_group(self, modify_permissions):
        modify_permissions(self.master, path=paths.CA_CS_CFG_PATH,
                           group='root')
        returncode, data = run_healthcheck(
            self.master,
            "ipahealthcheck.ipa.files",
            "TomcatFileCheck",
            failures_only=True,
        )
        assert returncode == 1
        for check in data:
            assert check["result"] == "WARNING"
            assert check["kw"]["key"] == \
                '_var_lib_pki_pki-tomcat_conf_ca_CS.cfg_group'
            assert check["kw"]["type"] == 'group'
>           assert check["kw"]["expected"] == 'pkiuser'
E           AssertionError: assert ['pkiuser'] == 'pkiuser'
E             +['pkiuser']
E             -'pkiuser'

This was addressed upstream in freeipa-healthcheck 0.8. I'm not sure why the group is being treated as a list. I'll take a look via https://github.com/freeipa/freeipa-healthcheck/issues/183

Note that the first failure is due to the introduced of systemd-resolvd which owns /etc/resolv.conf in F33+ (unless the user has overridden it).

Metadata Update from @frenaud:
- Issue assigned to frenaud

Metadata Update from @frenaud:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/5440

Updated builds submitted to bodhi.

https://bodhi.fedoraproject.org/updates/FEDORA-2021-8f96bcecb5
https://bodhi.fedoraproject.org/updates/FEDORA-2021-7399dee084

master:

  • 0801d4c0581e55aea6cfc2befbd419522be7b642 ipatests: fix expected output for ipahealthcheck.ipa.files

ipa-4-9:

  • dc2a52abe256d2de09eafe8a07898b0cbea3404b ipatests: fix expected output for ipahealthcheck.ipa.files

ipa-4-8:

  • 1c96a1c4dac51431e4f8cdd5fd04ba2fe69af357 ipatests: fix expected output for ipahealthcheck.ipa.files

Metadata Update from @rcritten:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata