aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-02-29 10:59:39 +0100
committerSiri Hansen <[email protected]>2016-02-29 10:59:39 +0100
commitcd5b6648c8f488f2b547c7f8bf56de641cf685e8 (patch)
treeb0c94ce9f203c5f4ce5627c4ccab77506edf52e8 /lib/common_test
parent87c77e75cc641b16b3704f8947fe15911fe40fc3 (diff)
parentbf309240cb531df880989702ae901316e8b5e97d (diff)
downloadotp-cd5b6648c8f488f2b547c7f8bf56de641cf685e8.tar.gz
otp-cd5b6648c8f488f2b547c7f8bf56de641cf685e8.tar.bz2
otp-cd5b6648c8f488f2b547c7f8bf56de641cf685e8.zip
Merge branch 'siri/ct_netconfc/allow-ssh-options/OTP-13338' into maint
* siri/ct_netconfc/allow-ssh-options/OTP-13338: Allow any ssh option when starting a netconf client
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/src/ct_netconfc.erl13
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl3
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/common_test/src/ct_netconfc.erl b/lib/common_test/src/ct_netconfc.erl
index 3da1115c76..8812514ad9 100644
--- a/lib/common_test/src/ct_netconfc.erl
+++ b/lib/common_test/src/ct_netconfc.erl
@@ -234,7 +234,6 @@
%% Internal defines
%%----------------------------------------------------------------------
-define(APPLICATION,?MODULE).
--define(VALID_SSH_OPTS,[user, password, user_dir]).
-define(DEFAULT_STREAM,"NETCONF").
-define(error(ConnName,Report),
@@ -1257,13 +1256,11 @@ check_options([{port,Port}|T], Host, _, #options{} = Options) ->
check_options([{timeout, Timeout}|T], Host, Port, Options)
when is_integer(Timeout); Timeout==infinity ->
check_options(T, Host, Port, Options#options{timeout = Timeout});
-check_options([{X,_}=Opt|T], Host, Port, #options{ssh=SshOpts}=Options) ->
- case lists:member(X,?VALID_SSH_OPTS) of
- true ->
- check_options(T, Host, Port, Options#options{ssh=[Opt|SshOpts]});
- false ->
- {error, {invalid_option, Opt}}
- end.
+check_options([{timeout, _} = Opt|_T], _Host, _Port, _Options) ->
+ {error, {invalid_option, Opt}};
+check_options([Opt|T], Host, Port, #options{ssh=SshOpts}=Options) ->
+ %% Option verified by ssh
+ check_options(T, Host, Port, Options#options{ssh=[Opt|SshOpts]}).
%%%-----------------------------------------------------------------
set_request_timer(infinity) ->
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
index 49b02d2bba..9d4c798795 100644
--- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
@@ -332,7 +332,8 @@ invalid_opt(Config) ->
Opts1 = ?DEFAULT_SSH_OPTS(DataDir) ++ [{timeout,invalidvalue}],
{error,{invalid_option,{timeout,invalidvalue}}} = ct_netconfc:open(Opts1),
Opts2 = ?DEFAULT_SSH_OPTS(DataDir) ++ [{some_other_opt,true}],
- {error,{invalid_option,{some_other_opt,true}}} = ct_netconfc:open(Opts2),
+ {error,{ssh,could_not_connect_to_server,{options,_}}} =
+ ct_netconfc:open(Opts2),
ok.
timeout_close_session(Config) ->