Updated localhost IPv6 tests to allow for different Linux OSs

This commit is contained in:
David Murphy 2023-10-11 12:15:11 -06:00 committed by Pedro Algarvio
parent eac9121a87
commit fbd2fb282a

View file

@ -1378,12 +1378,19 @@ def test_ip_to_host(grains):
assert ret is None
ret = network.ip_to_host("::1")
log.warning(f"DGM test_ip_to_host ret '{ret}'")
if grains["os"] == "Amazon":
assert ret == "localhost6"
elif grains["os_family"] == "Debian":
assert ret == "ip6-localhost"
if grains["osmajorrelease"] == "12":
assert ret == "localhost"
else:
assert ret == "ip6-localhost"
elif grains["os_family"] == "RedHat":
if grains["oscodename"] == "Photon":
assert ret == "ipv6-localhost"
else:
assert ret == "localhost"
else:
assert ret == "localhost"