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

Fix test_positive_mismatched_satellite_fqdn #16796

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

rmynar
Copy link
Contributor

@rmynar rmynar commented Oct 25, 2024

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

@rmynar rmynar added TestFailure Issues and PRs related to a test failing in automation CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 labels Oct 25, 2024
@rmynar rmynar self-assigned this Oct 25, 2024
@rmynar rmynar requested a review from a team as a code owner October 25, 2024 20:43
@rmynar
Copy link
Contributor Author

rmynar commented Oct 29, 2024

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

@Satellite-QE
Copy link
Collaborator

PRT Result

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

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Oct 29, 2024
@jameerpathan111 jameerpathan111 merged commit 50806c8 into SatelliteQE:master Nov 5, 2024
15 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 5, 2024
don't use nameservers to simulate mismatched hostname

(cherry picked from commit 50806c8)
github-actions bot pushed a commit that referenced this pull request Nov 5, 2024
don't use nameservers to simulate mismatched hostname

(cherry picked from commit 50806c8)
github-actions bot pushed a commit that referenced this pull request Nov 5, 2024
don't use nameservers to simulate mismatched hostname

(cherry picked from commit 50806c8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR TestFailure Issues and PRs related to a test failing in automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants