Skip to content

Commit

Permalink
Test: housekeeping: added assertion error messages
Browse files Browse the repository at this point in the history
Added assertion error messages on failures.

Signed-off-by: Madhuri Upadhye <[email protected]>
  • Loading branch information
madhuriupadhye committed Jul 4, 2024
1 parent 4e95d6f commit 7aa9b3d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/tests/system/tests/test_sss_ssh_knownhosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def test_sss_ssh_knownhosts__by_name(client: Client, ipa: IPA, public_keys: list
client.sssd.start()

result = client.sss_ssh_knownhosts(hostname)
assert result.rc == 0
assert len(public_keys) == len(result.stdout_lines)
assert result.rc == 0, "Did not get OpenSSH known hosts public keys"
assert len(public_keys) == len(result.stdout_lines), "Did not get expected number of public keys"
for key in public_keys:
assert f"{hostname} {key}" in result.stdout_lines
assert f"{hostname} {key}" in result.stdout_lines, "Did not get expected public keys"


@pytest.mark.ticket(gh=5518)
Expand Down Expand Up @@ -86,10 +86,10 @@ def test_sss_ssh_knownhosts__by_shortname(client: Client, ipa: IPA, public_keys:
client.sssd.start()

result = client.sss_ssh_knownhosts("ssh")
assert result.rc == 0
assert len(public_keys) == len(result.stdout_lines)
assert result.rc == 0, "Did not get OpenSSH known hosts public keys"
assert len(public_keys) == len(result.stdout_lines), "Did not get expected number of public keys"
for key in public_keys:
assert f"ssh {key}" in result.stdout_lines
assert f"ssh {key}" in result.stdout_lines, "Did not get expected public keys"


@pytest.mark.ticket(gh=5518)
Expand All @@ -116,7 +116,7 @@ def test_sss_ssh_knownhosts__by_ip(client: Client, ipa: IPA, public_keys: list[s
client.sssd.start()

result = client.sss_ssh_knownhosts(ip)
assert result.rc == 0
assert len(public_keys) == len(result.stdout_lines)
assert result.rc == 0, "Did not get OpenSSH known hosts public keys"
assert len(public_keys) == len(result.stdout_lines), "Did not get expected number of public keys"
for key in public_keys:
assert f"{ip} {key}" in result.stdout_lines
assert f"{ip} {key}" in result.stdout_lines, "Did not get expected public keys"

0 comments on commit 7aa9b3d

Please sign in to comment.