aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-06-01 14:14:33 +0200
committerSiri Hansen <[email protected]>2016-06-09 11:30:25 +0200
commitce5f7b7e1842b1866c55e6f024c143c598709280 (patch)
tree285934fa34e5048f472d20450b95f08f92e3ef89 /lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl
parentad1a23350326f2c9a2c41d81b5dea776e1383999 (diff)
downloadotp-ce5f7b7e1842b1866c55e6f024c143c598709280.tar.gz
otp-ce5f7b7e1842b1866c55e6f024c143c598709280.tar.bz2
otp-ce5f7b7e1842b1866c55e6f024c143c598709280.zip
[ct test] Check that crypto is loaded, or skip netconf tests
Tests for ct_netconfc are failed instead of skipped if crypto can not be loaded. This is now corrected.
Diffstat (limited to 'lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl')
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl
index 0a49cdabbb..a65275da43 100644
--- a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc_remote_SUITE.erl
@@ -62,14 +62,15 @@ stop_node(Case) ->
init_per_suite(Config) ->
- case ssh:start() of
- Ok when Ok==ok; Ok=={error,{already_started,ssh}} ->
+ (catch code:load_file(crypto)),
+ case {ssh:start(),code:is_loaded(crypto)} of
+ {Ok,{file,_}} when Ok==ok; Ok=={error,{already_started,ssh}} ->
ct:log("SSH started locally",[]),
SshDir = filename:join(filename:dirname(code:which(?MODULE)),
"ssh_dir"),
[{ssh_dir,SshDir}|Config];
Other ->
- ct:log("could not start ssh locally: ~p",[Other]),
+ ct:log("could not start ssh or load crypto locally: ~p",[Other]),
{skip, "SSH could not be started locally!"}
end.
@@ -85,15 +86,15 @@ remote_crash(Config) ->
{ok,Node} = ct_slave:start(nc_remote_crash),
Pa = filename:dirname(code:which(?NS)),
true = rpc:call(Node,code,add_patha,[Pa]),
-
- case rpc:call(Node,ssh,start,[]) of
- Ok when Ok==ok; Ok=={error,{already_started,ssh}} ->
+ rpc:call(Node,code,load_file,[crypto]),
+ case {rpc:call(Node,ssh,start,[]),rpc:call(Node,code,is_loaded,[crypto])} of
+ {Ok,{file,_}} when Ok==ok; Ok=={error,{already_started,ssh}} ->
ct:log("SSH started remote",[]),
ns(Node,start,[?config(ssh_dir,Config)]),
ct:log("netconf server started remote",[]),
remote_crash(Node,Config);
Other ->
- ct:log("could not start ssh remote: ~p",[Other]),
+ ct:log("could not start ssh or load crypto remote: ~p",[Other]),
{skip, "SSH could not be started remote!"}
end.