From 5ec3714f5338a6b152c0f9841d967512edadd4cb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 9 Jan 2024 11:05:07 +0100 Subject: [PATCH] ct: Fix test_server:find_release for ubuntu logic When we are running Ubuntu 20, we cannot use packages comiled for < Ubuntu 20 as tinfo crypto are not compatible. --- lib/common_test/src/test_server_node.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/common_test/src/test_server_node.erl b/lib/common_test/src/test_server_node.erl index 5b63a497d785..a753a6eecaf2 100644 --- a/lib/common_test/src/test_server_node.erl +++ b/lib/common_test/src/test_server_node.erl @@ -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