summaryrefslogtreecommitdiff
path: root/lib/common_test/src/test_server_ctrl.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common_test/src/test_server_ctrl.erl')
-rw-r--r--lib/common_test/src/test_server_ctrl.erl25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/common_test/src/test_server_ctrl.erl b/lib/common_test/src/test_server_ctrl.erl
index 538ea0de44..23a6deb6df 100644
--- a/lib/common_test/src/test_server_ctrl.erl
+++ b/lib/common_test/src/test_server_ctrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2021. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -116,7 +116,8 @@
create_priv_dir=auto_per_run, finish=false,
target_info, cover=false, wait_for_node=[],
testcase_callback=undefined, idle_notify=[],
- get_totals=false, random_seed=undefined}).
+ get_totals=false, random_seed=undefined,
+ old_releases=#{}}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% OPERATOR INTERFACE
@@ -917,13 +918,19 @@ handle_call({is_release_available, Release}, _From, State) ->
%%
%% Find the path of the release's erl file if available
-handle_call({find_release, Release}, _From, State) ->
- R =
- case test_server_node:is_release_available(Release) of
- true -> test_server_node:find_release(Release);
- _ -> not_available
- end,
- {reply, R, State}.
+handle_call({find_release, Release}, From, State = #state{ old_releases = OldReleases }) ->
+ case maps:find(Release, OldReleases) of
+ error ->
+ R =
+ case test_server_node:find_release(Release) of
+ none -> not_available;
+ PathToRelease -> PathToRelease
+ end,
+ handle_call({find_release, Release}, From,
+ State#state{ old_releases = OldReleases#{ Release => R }});
+ {ok, R} ->
+ {reply, R, State}
+ end.
%%--------------------------------------------------------------------
set_hosts(Hosts) ->