Skip to content

Commit

Permalink
Allow for containers
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Dec 21, 2024
1 parent 5b6a079 commit 5b945f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/pytests/unit/utils/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,23 +1469,23 @@ def test_ip_to_host(grains):

ret = network.ip_to_host("::1")
if grains["os"] == "Amazon":
assert ret == "localhost6"
assert ret in ("localhost6", "localhost")
elif grains["os_family"] == "Debian":
if grains["osmajorrelease"] == 12:
assert ret == hostname
else:
assert ret == "ip6-localhost"
assert ret in ("ip6-localhost", "localhost")
elif grains["os_family"] == "RedHat":
if grains["oscodename"] == "Photon":
assert ret == "ipv6-localhost"
assert ret == ("ipv6-localhost", "localhost")
else:
assert ret == hostname
elif grains["os_family"] == "Arch":
if grains.get("osmajorrelease", None) is None:
# running doesn't have osmajorrelease grains
assert ret == hostname
else:
assert ret == "ip6-localhost"
assert ret in ("ip6-localhost", "localhost")
else:
assert ret == hostname

Expand Down

0 comments on commit 5b945f2

Please sign in to comment.