From e0694680a8b59641369a478b1aec58c2c2acc5d4 Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Sat, 4 Jul 2015 10:49:33 +0200 Subject: ssh: add disjunction to ssh_trpt_test_lib:match --- lib/ssh/test/ssh_trpt_test_lib.erl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/ssh/test/ssh_trpt_test_lib.erl b/lib/ssh/test/ssh_trpt_test_lib.erl index a604fca1ac..75f495b6d7 100644 --- a/lib/ssh/test/ssh_trpt_test_lib.erl +++ b/lib/ssh/test/ssh_trpt_test_lib.erl @@ -218,6 +218,13 @@ match('$$', V, S) -> match('_', _, S) -> {true, S}; +match({'or',[P]}, V, S) -> match(P,V,S); +match({'or',[Ph|Pt]}, V, S) -> + case match(Ph,V,S) of + false -> match({'or',Pt}, V, S); + {true,S} -> {true,S} + end; + match(P, V, S) when is_atom(P) -> case atom_to_list(P) of "$"++_ -> -- cgit v1.2.3 From 9931cad6d5f653a8be2bb324450c1d4b2c5637cf Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Sat, 4 Jul 2015 10:50:22 +0200 Subject: ssh: be more generous about disconnect expects --- lib/ssh/test/ssh_protocol_SUITE.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/ssh/test/ssh_protocol_SUITE.erl b/lib/ssh/test/ssh_protocol_SUITE.erl index 58c8306c31..d82cdaf2c7 100644 --- a/lib/ssh/test/ssh_protocol_SUITE.erl +++ b/lib/ssh/test/ssh_protocol_SUITE.erl @@ -226,7 +226,8 @@ no_common_alg_server_disconnects(Config) -> {match, #ssh_msg_kexinit{_='_'}, receive_msg}, {send, ssh_msg_kexinit}, {match, - #ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED, _='_'}, + {'or',[#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED, _='_'}, + tcp_closed]}, receive_msg} ] ). @@ -269,10 +270,10 @@ no_common_alg_client_disconnects(Config) -> first_kex_packet_follows = false, reserved = 0 }}, - - {match, - #ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED, _='_'}, - receive_msg} + {match, + {'or',[#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED, _='_'}, + tcp_closed]}, + receive_msg} ], InitialState) } -- cgit v1.2.3