Skip to content

Commit

Permalink
Merge pull request #7953 from jchristgit/fix-httpd-serve-suite-on-ope…
Browse files Browse the repository at this point in the history
…nbsd

inets: Fix httpd_serve_SUITE failing on OpenBSD
  • Loading branch information
IngelaAndin authored Dec 15, 2023
2 parents 17dcec0 + adb26ae commit 5d73ac6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/inets/test/httpd_serve_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,17 @@ run_server_assertions({ok, {Ip0, Port, Path}}, Assertions) when is_integer(Port)
ok = verify_assertions(Assertions, ServerInfo),
ct:comment("Ran ~w assertion(s).", [length(Assertions)]).

maybe_convert_to_localhost(Ip = {0, 0, 0, 0}) ->
case os:type() of
{win32, _} -> {127, 0, 0, 1};
_ -> Ip
end;
maybe_convert_to_localhost(Ip) ->
case os:type() of
{unix, linux} -> Ip;
_Other -> convert_to_localhost(Ip)
end.

convert_to_localhost({0, 0, 0, 0}) ->
{127, 0, 0, 1};
convert_to_localhost({0, 0, 0, 0, 0, 0, 0, 0}) ->
{0, 0, 0, 0, 0, 0, 0, 1};
convert_to_localhost(Ip) ->
Ip.

%%
Expand Down

0 comments on commit 5d73ac6

Please sign in to comment.