Skip to content

Commit

Permalink
[6.14.z] Fix failing registration tests (SatelliteQE#15788)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Aug 21, 2024
1 parent 9e58b5a commit 741f938
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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
6 changes: 4 additions & 2 deletions tests/foreman/ui/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ def test_positive_global_registration_end_to_end(
# rex interface
iface = 'eth0'
# fill in the global registration form
with session:
with target_sat.ui_session() as session:
session.organization.select(org_name=module_org.name)
session.location.select(loc_name=smart_proxy_location.name)
cmd = session.host.get_register_command(
{
'general.operating_system': default_os.title,
Expand Down Expand Up @@ -219,7 +221,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 741f938

Please sign in to comment.