Skip to content

Commit

Permalink
tftp: Remove dead legacy code
Browse files Browse the repository at this point in the history
  • Loading branch information
IngelaAndin committed May 31, 2024
1 parent 7ddef51 commit 9a6d8e8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 67 deletions.
35 changes: 0 additions & 35 deletions lib/tftp/src/tftp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@ in parallel with the ongoing one, the server consumes less resources.
stop/0
]).

%% Application local functions
-export([
start_standalone/1,
start_service/1,
stop_service/1,
services/0,
service_info/1
]).

-export_type([option/0]).

-include("tftp.hrl").
Expand Down Expand Up @@ -529,29 +520,3 @@ start() ->
stop() ->
application:stop(tftp).

%%-------------------------------------------------------------------
%% Inets service behavior
%%-------------------------------------------------------------------

-doc false.
start_standalone(Options) ->
start(Options).

-doc false.
start_service(Options) ->
tftp_sup:start_child(Options).

-doc false.
stop_service(Pid) ->
tftp_sup:stop_child(Pid).

-doc false.
services() ->
tftp_sup:which_children().

-doc false.
service_info(Pid) ->
info(Pid).



33 changes: 1 addition & 32 deletions lib/tftp/test/tftp_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ all() ->
resend_server,
large_file,
app,
appup,
start_tftpd
appup
].

groups() ->
Expand Down Expand Up @@ -115,36 +114,6 @@ appup() ->
appup(Config) when is_list(Config) ->
ok = test_server:appup_test(tftp).

start_tftpd() ->
[{doc, "Start/stop of tfpd service"}].
start_tftpd(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ok = tftp:start(),
{ok, Pid0} = tftp:start_service([{host, "localhost"}, {port, 0}]),
Pids0 = [ServicePid || {_, ServicePid} <- tftp:services()],
true = lists:member(Pid0, Pids0),
{ok, [_|_]} = tftp:service_info(Pid0),
tftp:stop_service(Pid0),
ct:sleep(100),
Pids1 = [ServicePid || {_, ServicePid} <- tftp:services()],
false = lists:member(Pid0, Pids1),

{ok, Pid1} =
tftp:start_standalone([{host, "localhost"}, {port, 0}]),
Pids2 = [ServicePid || {_, ServicePid} <- tftp:services()],
false = lists:member(Pid1, Pids2),
%% Standalone service is not supervised
{error,not_found} = tftp:stop_service(Pid1),
ok = tftp:stop(),

application:load(tftp),
application:set_env(tftp, services, [{tftpd, [{host, "localhost"},
{port, 0}]}]),
ok = tftp:start(),
1 = length(tftp:services()),
application:unset_env(tftp, services),
ok = tftp:stop().


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Simple
Expand Down

0 comments on commit 9a6d8e8

Please sign in to comment.