From ca05d05684a93884c80c1b67da1908009fc801fc Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Fri, 12 Jun 2020 14:24:44 +0200 Subject: ssh: Minor shell option coverage fix --- lib/ssh/src/ssh_options.erl | 3 ++- lib/ssh/test/ssh_basic_SUITE.erl | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ssh/src/ssh_options.erl b/lib/ssh/src/ssh_options.erl index d6004bce46..06ce9a5f79 100644 --- a/lib/ssh/src/ssh_options.erl +++ b/lib/ssh/src/ssh_options.erl @@ -377,7 +377,8 @@ default(server) -> #{default => ?DEFAULT_SHELL, chk => fun({M,F,A}) -> is_atom(M) andalso is_atom(F) andalso is_list(A); (disabled) -> true; - (V) -> check_function1(V) orelse check_function2(V) + (V) -> check_function1(V) orelse + check_function2(V) end, class => user_option }, diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl index 1269ab393e..d1713ae608 100644 --- a/lib/ssh/test/ssh_basic_SUITE.erl +++ b/lib/ssh/test/ssh_basic_SUITE.erl @@ -1218,11 +1218,10 @@ shell_exit_status(Config) when is_list(Config) -> SystemDir = proplists:get_value(data_dir, Config), UserDir = proplists:get_value(priv_dir, Config), - ShellFun = fun (_User) -> spawn(fun() -> ok end) end, {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir}, {user_dir, UserDir}, {user_passwords, [{"vego", "morot"}]}, - {shell, ShellFun}, + {shell, {?MODULE,always_ok,[]}}, {failfun, fun ssh_test_lib:failfun/2}]), ConnectionRef = ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true}, @@ -1236,14 +1235,15 @@ shell_exit_status(Config) when is_list(Config) -> ssh_test_lib:receive_exec_end(ConnectionRef, ChannelId), ssh:stop_daemon(Pid). - +always_ok(_) -> ok. + %%---------------------------------------------------------------------------- setopts_getopts(Config) -> process_flag(trap_exit, true), SystemDir = proplists:get_value(data_dir, Config), UserDir = proplists:get_value(priv_dir, Config), - ShellFun = fun (_User) -> spawn(fun() -> ok end) end, + ShellFun = fun (_User, _Peer) -> spawn(fun() -> ok end) end, {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir}, {user_dir, UserDir}, {user_passwords, [{"vego", "morot"}]}, -- cgit v1.2.1