ipatests: ipa_epn: uninstall/reinstall ipa-client-epn

Due to https://github.com/freeipa/freeipa-pr-ci/issues/378
the installed version of freeipa-client-epn is not the built
one. Temporarily force uninstall/reinstall of this package
before running the test.

Fixes: https://pagure.io/freeipa/issue/8374
Signed-off-by: François Cami <fcami@redhat.com>
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
François Cami 2020-06-24 23:24:36 +02:00
parent 0d4f022b3b
commit 73c02f635d

View File

@ -209,11 +209,29 @@ class TestEPN(IntegrationTest):
cls.master.run_command(r'rm -f /etc/pki/tls/private/postfix.key')
cls.master.run_command(r'rm -f /etc/pki/tls/certs/postfix.pem')
@pytest.mark.xfail(reason='pr-ci issue 378', strict=True)
@pytest.mark.skip_if_platform(
"debian", reason="Cannot check installed packages using RPM"
)
def test_EPN_config_file(self):
"""Check that the EPN configuration file is installed.
https://pagure.io/freeipa/issue/8374
"""
# workaround for https://github.com/freeipa/freeipa-pr-ci/issues/378
rpm_q_cmds = [
["rpm", "-qi", "freeipa-client"],
["rpm", "-qi", "freeipa-client-epn"],
["rpm", "-qc", "freeipa-client-epn"],
["rpm", "-V", "freeipa-client-epn"],
["rpm", "-qvc", "freeipa-client-epn"],
["ls", "-l", "/etc/ipa", "/etc/ipa/epn"],
]
for cmd in rpm_q_cmds:
self.master.run_command(cmd, raiseonerr=False)
tasks.uninstall_packages(self.master, ["*ipa-client-epn"])
tasks.install_packages(self.master, ["*ipa-client-epn"])
for cmd in rpm_q_cmds:
self.master.run_command(cmd, raiseonerr=False)
# end workaround
epn_conf = "/etc/ipa/epn.conf"
epn_template = "/etc/ipa/epn/expire_msg.template"
cmd1 = self.master.run_command(["rpm", "-qc", "freeipa-client-epn"])