diff options
author | Hans Nilsson <hans@erlang.org> | 2020-06-12 14:24:44 +0200 |
---|---|---|
committer | Hans Nilsson <hans@erlang.org> | 2020-06-16 11:42:34 +0200 |
commit | ca05d05684a93884c80c1b67da1908009fc801fc (patch) | |
tree | 4dd4732529d967a5f47cd4af01aa003ec40533ca | |
parent | 68f3619915de723d7f0f48b625f7a9a83221fbed (diff) | |
download | erlang-ca05d05684a93884c80c1b67da1908009fc801fc.tar.gz |
ssh: Minor shell option coverage fix
-rw-r--r-- | lib/ssh/src/ssh_options.erl | 3 | ||||
-rw-r--r-- | 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"}]}, |