-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix failing registration test #17346
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,12 +221,13 @@ def test_positive_force_register_twice(module_ak_with_cv, module_org, rhel_conte | |
assert result.status == 0 | ||
assert rhel_contenthost.subscribed | ||
assert f'Unregistering from: {target_sat.hostname}' in str(result.stdout) | ||
assert f'The registered system name is: {rhel_contenthost.hostname}' in str(result.stdout) | ||
hostname = rhel_contenthost.execute('hostname').stdout.strip() | ||
assert f'The registered system name is: {hostname}' in str(result.stdout) | ||
reg_id_new = re.search(reg_id_pattern, result.stdout).group(1) | ||
assert f'The system has been registered with ID: {reg_id_new}' in str(result.stdout) | ||
assert reg_id_new != reg_id_old | ||
assert ( | ||
target_sat.cli.Host.info({'name': rhel_contenthost.hostname}, output_format='json')[ | ||
target_sat.cli.Host.info({'name': hostname.lower()}, output_format='json')[ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If hostname is in uppercase before registration, then after registration does it get changed to lowercase ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then we don't need |
||
'subscription-information' | ||
]['uuid'] | ||
== reg_id_new | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the unregistering of the host is not done properly and RHEL10 is only impacted here. I am guessing it an issue of RHEL10 rather than automation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was my initial guess but looking at the logs, it says unregistered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubhamsg199 @shweta83 Looking at the test failure in CI, when
hostnamectl set-hostname {name}
it never worked on < RHEL 10 since we use containers for this test and especially for RHEL10 we don't have any container images created yet it and it default checkout a VM whereset-hostname
works and this started to fail.IMO this is expected behaviour, so if we're considering to fix it this way then we should consider using
no_containers
for this test, but before that I'd like to understand the rational behind changing the hostname step if is that really required for this test?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation @Gauravtalreja1 , I think we should update the test and use
no_containers
The reason behind changing the hostname step is because of the BZ attached which is the test requirement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test scenario of the bug was testing case-sensitiveness of the hostname. But as @Gauravtalreja1 said, the scenario was never tested due to containers.
The problem here is we are asserting
rhel_contenthost.hostname
with hostname which will always fail. We need to fix it and run the test on VM.