aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarcus Arendt <[email protected]>2014-09-01 16:13:37 +0200
committerMarcus Arendt <[email protected]>2014-09-02 10:28:48 +0200
commite3a947d06915bde9d11e80b9d6f4e31460a3cf51 (patch)
tree24e8cfa28e628f9df4d7337c95c0d45027b6cb6f /lib
parentcf53a360685b1a01a5c7fc0e06660ce8d76d96b0 (diff)
downloadotp-e3a947d06915bde9d11e80b9d6f4e31460a3cf51.tar.gz
otp-e3a947d06915bde9d11e80b9d6f4e31460a3cf51.tar.bz2
otp-e3a947d06915bde9d11e80b9d6f4e31460a3cf51.zip
ssh: check if ssh client supports newer cipher- and MAC-algorithms
Diffstat (limited to 'lib')
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE.erl28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl
index e003b135b1..3500bf012b 100644
--- a/lib/ssh/test/ssh_to_openssh_SUITE.erl
+++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl
@@ -91,6 +91,12 @@ end_per_group(erlang_server, Config) ->
end_per_group(_, Config) ->
Config.
+init_per_testcase(erlang_server_openssh_client_cipher_suites, Config) ->
+ check_ssh_client_support(Config);
+
+init_per_testcase(erlang_server_openssh_client_macs, Config) ->
+ check_ssh_client_support(Config);
+
init_per_testcase(_TestCase, Config) ->
ssh:start(),
Config.
@@ -537,3 +543,25 @@ receive_hej() ->
ct:pal("Extra info: ~p~n", [Info]),
receive_hej()
end.
+
+%%--------------------------------------------------------------------
+%%--------------------------------------------------------------------
+%% Check if we have a "newer" ssh client that supports these test cases
+%%--------------------------------------------------------------------
+check_ssh_client_support(Config) ->
+ Port = open_port({spawn, "ssh -Q cipher"}, [exit_status, stderr_to_stdout]),
+ case check_ssh_client_support2(Port) of
+ 0 -> % exit status from command (0 == ok)
+ ssh:start(),
+ Config;
+ _ ->
+ {skip, "test case not supported by ssh client"}
+ end.
+
+check_ssh_client_support2(P) ->
+ receive
+ {P, {data, _A}} ->
+ check_ssh_client_support2(P);
+ {P, {exit_status, E}} ->
+ E
+ end.