mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: test_epn: add test_EPN_connection_refused
Add a test for EPN behavior when the configured SMTP does not accept connections. Fixes: https://pagure.io/freeipa/issue/8445 Signed-off-by: François Cami <fcami@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
f271132167
commit
6edf648d7b
@ -182,14 +182,20 @@ class TestEPN(IntegrationTest):
|
||||
self,
|
||||
host,
|
||||
dry_run=False,
|
||||
mailtest=False,
|
||||
from_nbdays=None,
|
||||
to_nbdays=None,
|
||||
raiseonerr=True,
|
||||
validatejson=True
|
||||
):
|
||||
result = tasks.ipa_epn(host, raiseonerr=raiseonerr, dry_run=dry_run,
|
||||
from_nbdays=from_nbdays,
|
||||
to_nbdays=to_nbdays)
|
||||
result = tasks.ipa_epn(
|
||||
host,
|
||||
from_nbdays=from_nbdays,
|
||||
to_nbdays=to_nbdays,
|
||||
mailtest=mailtest,
|
||||
dry_run=dry_run,
|
||||
raiseonerr=raiseonerr
|
||||
)
|
||||
if validatejson:
|
||||
json.dumps(json.loads(result.stdout_text), ensure_ascii=False)
|
||||
return (result.stdout_text, result.stderr_text, result.returncode)
|
||||
@ -243,6 +249,21 @@ class TestEPN(IntegrationTest):
|
||||
ck = "192481b52fb591112afd7b55b12a44c6618fdbc7e05a3b1866fd67ec579c51df"
|
||||
assert cmd2.stdout_text.find(ck) == 0
|
||||
|
||||
@pytest.mark.xfail(reason='freeipa ticket 8445', strict=True)
|
||||
def test_EPN_connection_refused(self):
|
||||
"""Test EPN behavior when the configured SMTP is down
|
||||
"""
|
||||
|
||||
self.master.run_command(["systemctl", "stop", "postfix"])
|
||||
(unused, stderr_text, rc) = self._check_epn_output(
|
||||
self.master, mailtest=True,
|
||||
raiseonerr=False, validatejson=False
|
||||
)
|
||||
self.master.run_command(["systemctl", "start", "postfix"])
|
||||
assert "IPA-EPN: Could not connect to the configured SMTP server" in \
|
||||
stderr_text
|
||||
assert rc > 0
|
||||
|
||||
def test_EPN_smoketest_1(self):
|
||||
"""No users except admin. Check --dry-run output.
|
||||
With the default configuration, the result should be an empty list.
|
||||
|
Loading…
Reference in New Issue
Block a user