Skip to content

Commit

Permalink
Check one thing on OSX only
Browse files Browse the repository at this point in the history
  • Loading branch information
whatyouhide committed Aug 7, 2023
1 parent 89b98c1 commit b2c6704
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/xandra/cluster/ccm_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ defmodule Xandra.Cluster.CCMTest do
end

defp validate_ifaddresses do
{:ok, addresses} = :inet.getifaddrs()
assert {~c"lo0", info} = List.keyfind!(addresses, ~c"lo0", 0)
if :os.type() == {:unix, :darwin} do
{:ok, addresses} = :inet.getifaddrs()
assert {~c"lo0", info} = List.keyfind!(addresses, ~c"lo0", 0)

localhosts = for {:addr, {127, 0, 0, _} = addr} <- info, do: addr
localhosts = for {:addr, {127, 0, 0, _} = addr} <- info, do: addr

assert Enum.sort(localhosts) == [
{127, 0, 0, 1},
{127, 0, 0, 2},
{127, 0, 0, 3}
]
assert Enum.sort(localhosts) == [
{127, 0, 0, 1},
{127, 0, 0, 2},
{127, 0, 0, 3}
]
end
end
end

0 comments on commit b2c6704

Please sign in to comment.