Skip to content

Commit

Permalink
Fix failing registration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed Jul 26, 2024
1 parent fa91263 commit 3b1d414
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/foreman/api/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed(
location=module_location,
)
assert result.status == 0, f'Failed to register host: {result.stderr}'

target_sat.execute(f'echo \'{{"dmi.system.uuid": "{uuid_2}"}}\' > /etc/rhsm/facts/uuid.facts')
result = rhel_contenthost.execute('subscription-manager unregister')
assert result.status == 0
result = rhel_contenthost.execute('subscription-manager clean')
assert result.status == 0
target_sat.execute(f'echo \'{{"dmi.system.uuid": "{uuid_2}"}}\' > /etc/rhsm/facts/uuid.facts')
result = rhel_contenthost.api_register(
target_sat,
organization=org,
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/ui/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_positive_global_registration_end_to_end(
# Assert that a yum update was made this day ("Update" or "I, U" in history)
timezone_offset = rhel_contenthost.execute('date +"%:z"').stdout.strip()
tzinfo = datetime.strptime(timezone_offset, '%z').tzinfo
result = rhel_contenthost.execute('yum history | grep U')
result = rhel_contenthost.execute('yum history | grep -E "I|U"')
assert result.status == 0
assert datetime.now(tzinfo).strftime('%Y-%m-%d') in result.stdout
# Set "Connect to host using IP address"
Expand Down

0 comments on commit 3b1d414

Please sign in to comment.