Skip to content

Commit

Permalink
Tests: Skip test_0016_ad_parameters_ad_hostname_valid on other archit…
Browse files Browse the repository at this point in the history
…ectures.

The test is unstable on other architectures so it is skipped for now.
Reordered the asserts so we can seed if the connection to AD works
as looking for log message has a lower priority.

Reviewed-by: Madhuri Upadhye <[email protected]>
  • Loading branch information
jakub-vavra-cz committed Jun 15, 2023
1 parent d14be79 commit 3e3d098
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/tests/multihost/ad/test_adparameters_ported.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ def test_0015_ad_parameters_ad_hostname_machine(
arch = multihost.client[0].run_command(
'uname -m', raiseonerr=False).stdout_text
if 'x86_64' not in arch:
pytest.skip("Test is unstable on architectures other than x68_64.")
pytest.skip("Test is unstable on architectures other than x86_64.")

adjoin(membersw='adcli')
client = sssdTools(multihost.client[0], multihost.ad[0])
Expand Down Expand Up @@ -1256,10 +1256,11 @@ def test_0015_ad_parameters_ad_hostname_machine(
f'hostname {old_hostname}', raiseonerr=False)

# Evaluate test results
assert "Setting ad_hostname to [host1.kautest.com]" in log_str
assert f"Will look for host1.kautest.com@{ad_realm}" in log_str
assert usr_cmd.returncode == 0, f"User {aduser} was not found."
assert su_result, "The su command failed!"
assert "Setting ad_hostname to [host1.kautest.com]" in log_str
assert f"Will look for host1.kautest.com@{ad_realm}" in log_str


@staticmethod
@pytest.mark.tier1_2
Expand Down Expand Up @@ -1293,6 +1294,10 @@ def test_0016_ad_parameters_ad_hostname_valid(
1. Remove AD user.
:customerscenario: False
"""
arch = multihost.client[0].run_command(
'uname -m', raiseonerr=False).stdout_text
if 'x86_64' not in arch:
pytest.skip("Test is unstable on architectures other than x86_64.")
adjoin(membersw='adcli')
client = sssdTools(multihost.client[0], multihost.ad[0])

Expand Down Expand Up @@ -1341,13 +1346,13 @@ def test_0016_ad_parameters_ad_hostname_valid(
multihost.client[0].run_command(
f'hostname {old_hostname}', raiseonerr=False)
# Evaluate test results
assert usr_cmd.returncode == 0, f"User {aduser} was not found."
assert grp_cmd.returncode == 0, f"Group {adgroup} was not found!"
assert su_result, "The su command failed!"
assert f"Option ad_hostname has value {old_hostname}" in log_str
assert f"Setting ad_hostname to [{old_hostname}]" not in log_str
assert f"Will look for {old_hostname}@{ad_realm}" in log_str
assert f"Trying to find principal {old_hostname}@{ad_realm}" in log_str
assert usr_cmd.returncode == 0, f"User {aduser} was not found."
assert grp_cmd.returncode == 0, f"Group {adgroup} was not found!"
assert su_result, "The su command failed!"

@staticmethod
@pytest.mark.tier2
Expand Down

0 comments on commit 3e3d098

Please sign in to comment.