Skip to content

Commit

Permalink
ct: Fix test_server:find_release for ubuntu logic
Browse files Browse the repository at this point in the history
When we are running Ubuntu 20, we cannot use packages
comiled for < Ubuntu 20 as tinfo crypto are not compatible.
  • Loading branch information
garazdawi committed Jan 9, 2024
1 parent 0863bd3 commit 5ec3714
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/common_test/src/test_server_node.erl
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,20 @@ suse_release(Fd) ->

find_rel_ubuntu(_Rel, UbuntuRel) when is_integer(UbuntuRel), UbuntuRel < 16 ->
[];
find_rel_ubuntu(Rel, UbuntuRel) when is_integer(UbuntuRel) ->
find_rel_ubuntu(_Rel, UbuntuRel) when is_integer(UbuntuRel), UbuntuRel < 20 ->
find_rel_ubuntu(_Rel, 16, UbuntuRel);
find_rel_ubuntu(_Rel, UbuntuRel) when is_integer(UbuntuRel) ->
find_rel_ubuntu(_Rel, 20, UbuntuRel).

find_rel_ubuntu(Rel, MinUbuntuRel, MaxUbuntuRel) when
is_integer(MinUbuntuRel), is_integer(MaxUbuntuRel) ->
Root = "/usr/local/otp/releases/ubuntu",
lists:foldl(fun (ChkUbuntuRel, Acc) ->
find_rel_ubuntu_aux1(Rel, Root++integer_to_list(ChkUbuntuRel))
++ Acc
end,
[],
lists:seq(16, UbuntuRel)).
lists:seq(MinUbuntuRel, MaxUbuntuRel)).

find_rel_ubuntu_aux1(Rel, RootWc) ->
case erlang:system_info(wordsize) of
Expand Down

0 comments on commit 5ec3714

Please sign in to comment.