diff options
author | Hans Nilsson <[email protected]> | 2017-04-25 13:43:56 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-04-26 12:15:06 +0200 |
commit | 98fa13854707fc1f4aecb6d2f7bc167f478bdd6f (patch) | |
tree | 3de25377ada310700ef31c921ef9a9329c7e07e6 /lib/ssh/test/ssh_test_lib.erl | |
parent | 2e55f44545504aa1ba109e072e6833f5c045b58f (diff) | |
download | otp-98fa13854707fc1f4aecb6d2f7bc167f478bdd6f.tar.gz otp-98fa13854707fc1f4aecb6d2f7bc167f478bdd6f.tar.bz2 otp-98fa13854707fc1f4aecb6d2f7bc167f478bdd6f.zip |
ssh: test case adjustments
Diffstat (limited to 'lib/ssh/test/ssh_test_lib.erl')
-rw-r--r-- | lib/ssh/test/ssh_test_lib.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl index 6186d44890..ab44fc8275 100644 --- a/lib/ssh/test/ssh_test_lib.erl +++ b/lib/ssh/test/ssh_test_lib.erl @@ -858,8 +858,9 @@ get_kex_init(Conn) -> get_kex_init(Conn, Ref, TRef) -> %% First, validate the key exchange is complete (StateName == connected) - case sys:get_state(Conn) of - {{connected,_}, S} -> + {State, S} = sys:get_state(Conn), + case expected_state(State) of + true -> timer:cancel(TRef), %% Next, walk through the elements of the #state record looking %% for the #ssh_msg_kexinit record. This method is robust against @@ -873,8 +874,8 @@ get_kex_init(Conn, Ref, TRef) -> KexInit end; - {OtherState, S} -> - ct:log("Not in 'connected' state: ~p",[OtherState]), + false -> + ct:log("Not in 'connected' state: ~p",[State]), receive {reneg_timeout,Ref} -> ct:log("S = ~p", [S]), @@ -886,6 +887,10 @@ get_kex_init(Conn, Ref, TRef) -> end end. +expected_state({ext_info,_,_}) -> true; +expected_state({connected,_}) -> true; +expected_state(_) -> false. + %%%---------------------------------------------------------------- %%% Return a string with N random characters %%% |