#8682 [ipatests] TestIPACommand.test_login_wrong_password time to time fails
Closed: fixed by abbra. Opened by slev.

test_integration/test_commands.py::TestIPACommand::test_login_wrong_password periodically fails on Azure Pipelines with:

[2021-01-26 09:23:55]         result = self.master.run_command(['journalctl',
[2021-01-26 09:23:55]                                           '-u', 'sshd',
[2021-01-26 09:23:55]                                           '--since={}'.format(since)])
[2021-01-26 09:23:55] >       assert exp_msg in result.stdout_text
[2021-01-26 09:23:55] E       AssertionError: assert 'pam_sss(sshd:auth): received for user testuser: 7 (Authentication failure)' in '-- Journal begins at Tue 2021-01-26 09:02:22 UTC, ends at Tue 2021-01-26 09:20:49 UTC. --\nJan 26 09:20:49 master1.ip...master1.ipa.test sshd[12681]: Connection closed by authenticating user testuser 2001:db8:1:1::2 port 58468 [preauth]\n'
[2021-01-26 09:23:55] E        +  where '-- Journal begins at Tue 2021-01-26 09:02:22 UTC, ends at Tue 2021-01-26 09:20:49 UTC. --\nJan 26 09:20:49 master1.ip...master1.ipa.test sshd[12681]: Connection closed by authenticating user testuser 2001:db8:1:1::2 port 58468 [preauth]\n' = <pytest_multihost.transport.SSHCommand object at 0x7effd3fa9190>.stdout_text

Actual system logs:

Jan 26 09:20:49 master1.ipa.test sshd[12683]: pam_sss(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=2001:db8:1:1::2 user=testuser
Jan 26 09:20:49 master1.ipa.test sshd[12683]: pam_sss(sshd:auth): received for user testuser: 7 (Authentication failure)
Jan 26 09:20:49 master1.ipa.test sshd[12681]: error: PAM: Authentication failure for testuser from 2001:db8:1:1::2
Jan 26 09:20:49 master1.ipa.test sshd[12681]: Connection closed by authenticating user testuser 2001:db8:1:1::2 port 58468 [preauth]

sshd don't flush its logs immediately and as far as I know, there is no way to do this.


In container I can reproduce this with random occurrence:

cur_date="$(date +'%Y-%m-%d %H:%M:%S')";sshpass -p WrongPassword ssh -v -o PubkeyAuthentication=no -o GSSAPIAuthentication=no -o ConnectTimeout=2 -o StrictHostKeyChecking=no -l testuser master1.ipa.test true >/dev/null 2>&1 || journalctl --since="$cur_date" -u sshd | tail -4 | grep 'received for user '

master:

  • fdd5ba3f48096cf50f90e9f3045766e89cd75508 ipatests: Don't assume sshd flush its logs immediately

ipa-4-9:

  • cbe7d2258d6c900b2e02b2373e720275d9917316 ipatests: Don't assume sshd flush its logs immediately

ipa-4-8:

  • 7c667f64eef581ed54a3a7075d0fe63db62b0a1a ipatests: Don't assume sshd flush its logs immediately

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

Metadata