Skip to content
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

[6.15.z] Fix test_positive_mismatched_satellite_fqdn #16863

Conversation

Satellite-QE
Copy link
Collaborator

Cherrypick of PR: #16796

Test seemed to randomly fail on assertion at

assert facter_command_output != hostname_command_output

After some investigation I found out that the domain is being generated randomly and for some domains (e.g. test.com, test.biz) the output of hostname --fqdn returns FQDN, not just "shortname" as we expected.

Removing nameservers from /etc/resolv.conf solves the issue.

> hostnamectl set-hostname testname # set test hostname
> echo "search example.info" > /etc/resolv.conf # set search domain to example.info
> hostname --fqdn # hostname prints only hostname without domain name
testname
> sed -i "s/^search.*/search test.biz/" /etc/resolv.conf # set search domain to test.biz
> hostname --fqdn # for some reason the fqdn is printed
testname.test.biz
> sed -i "/nameserver.*/d" /etc/resolv.conf # remove nameservers
> hostname --fqdn # only hostname without domain name is printed
testname

don't use nameservers to simulate mismatched hostname

(cherry picked from commit 50806c8)
@Satellite-QE Satellite-QE requested a review from a team as a code owner November 5, 2024 09:05
@Satellite-QE Satellite-QE added 6.15.z Introduced in or relating directly to Satellite 6.15 Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Nov 5, 2024
@Satellite-QE
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_installer.py -k test_positive_mismatched_satellite_fqdn

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Nov 5, 2024
@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 9235
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/destructive/test_installer.py -k test_positive_mismatched_satellite_fqdn --external-logging
Test Result : ========== 1 passed, 4 deselected, 17 warnings in 1107.53s (0:18:27) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Nov 5, 2024
@Satellite-QE Satellite-QE merged commit cc6e6f2 into 6.15.z Nov 5, 2024
17 of 18 checks passed
@Satellite-QE Satellite-QE deleted the cherry-pick-6.15.z-50806c858180615cee44855abac3421633056cee branch November 5, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants