test_integration/test_commands.py::TestIPACommand::test_login_wrong_password periodically fails on Azure Pipelines with:
test_integration/test_commands.py::TestIPACommand::test_login_wrong_password
[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:
ipa-4-9:
ipa-4-8:
Metadata Update from @abbra: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)