Skip to content

Commit

Permalink
Skip dhfile tests on broken OTP-26 releases
Browse files Browse the repository at this point in the history
Guessing that the fix will be released in the next OTP-26 point release,
OTP 26.2.2.
  • Loading branch information
avtobiff committed Jan 10, 2024
1 parent d4f3f7d commit 994c563
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions testsuite/dhfile_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,50 @@ groups() ->
[
].

%% Skip dhfile tests on broken OTP-26 releases.
%% Guessing that OTP-26.2.2+ will be fixed.
-define(OTP26_FIXED_DHFILE, <<"26.2.2">>).

-ifdef(OTP_RELEASE).
-if(?OTP_RELEASE == 26).
otp26_broken_dhfile() ->
case otp_release_version("26") of
{ok, OtpVsn}
when OtpVsn =< ?OTP26_FIXED_DHFILE ->
true;
_ ->
false
end.
-else.
otp26_broken_dhfile() ->
false.
-endif.
-endif.

otp_release_version(Rel) ->
try
{ok, _OtpVsn} =
file:read_file(filename:join([code:root_dir(), "releases", Rel,
"OTP_VERSION"]))
catch
error:{badmatch, _} ->
file:read_file(filename:join([code:root_dir(), "OTP_VERSION"]))
end.

%%====================================================================
init_per_suite(Config) ->
Id = "testsuite-server",
YConf = filename:join(?tempdir(?MODULE), "yaws.conf"),
application:load(yaws),
application:set_env(yaws, id, Id),
application:set_env(yaws, conf, YConf),
ok = yaws:start(),
[{yaws_id, Id}, {yaws_config, YConf} | Config].
case otp26_broken_dhfile() of
true ->
{skip, otp26_broken_dhfile};
false ->
Id = "testsuite-server",
YConf = filename:join(?tempdir(?MODULE), "yaws.conf"),
application:load(yaws),
application:set_env(yaws, id, Id),
application:set_env(yaws, conf, YConf),
ok = yaws:start(),
[{yaws_id, Id}, {yaws_config, YConf} | Config]
end.

end_per_suite(_Config) ->
ok = application:stop(yaws),
Expand Down

0 comments on commit 994c563

Please sign in to comment.