aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/test/ssh_basic_SUITE.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-11-06 10:54:02 +0100
committerIngela Anderton Andin <[email protected]>2013-11-13 10:58:20 +0100
commit422ed9ecd9c95c25964381b7ca2888a0320a8ee4 (patch)
treeb501003998429de1850d0b067f285dcfbd8dcf18 /lib/ssh/test/ssh_basic_SUITE.erl
parent24f37acef3e7e33576bcd071569a94de980b6544 (diff)
downloadotp-422ed9ecd9c95c25964381b7ca2888a0320a8ee4.tar.gz
otp-422ed9ecd9c95c25964381b7ca2888a0320a8ee4.tar.bz2
otp-422ed9ecd9c95c25964381b7ca2888a0320a8ee4.zip
ssh: Simplify handling of connection attributes (e.i. user and sockname)
OTP-11296
Diffstat (limited to 'lib/ssh/test/ssh_basic_SUITE.erl')
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 813031eab2..b9745dda9c 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -478,7 +478,7 @@ send(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
peername_sockname() ->
- [{doc, "Test ssh:peername/1 and ssh:sockname/1"}].
+ [{doc, "Test ssh:connection_info([peername, sockname])"}].
peername_sockname(Config) when is_list(Config) ->
process_flag(trap_exit, true),
SystemDir = filename:join(?config(priv_dir, Config), system),
@@ -496,13 +496,17 @@ peername_sockname(Config) when is_list(Config) ->
{user_interaction, false}]),
{ok, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity),
success = ssh_connection:subsystem(ConnectionRef, ChannelId, "peername_sockname", infinity),
- {ok,{HostPeerClient,PortPeerClient}} = ssh:peername(ConnectionRef),
- {ok,{HostSockClient,PortSockClient}} = ssh:sockname(ConnectionRef),
+ [{peer, {_Name, {HostPeerClient,PortPeerClient} = ClientPeer}}] =
+ ssh:connection_info(ConnectionRef, [peer]),
+ [{sockname, {HostSockClient,PortSockClient} = ClientSock}] =
+ ssh:connection_info(ConnectionRef, [sockname]),
+ ct:pal("Client: ~p ~p", [ClientPeer, ClientSock]),
receive
{ssh_cm, ConnectionRef, {data, ChannelId, _, Response}} ->
{PeerNameSrv,SockNameSrv} = binary_to_term(Response),
- {ok,{HostPeerSrv,PortPeerSrv}} = PeerNameSrv,
- {ok,{HostSockSrv,PortSockSrv}} = SockNameSrv,
+ {HostPeerSrv,PortPeerSrv} = PeerNameSrv,
+ {HostSockSrv,PortSockSrv} = SockNameSrv,
+ ct:pal("Server: ~p ~p", [PeerNameSrv, SockNameSrv]),
host_equal(HostPeerSrv, HostSockClient),
PortPeerSrv = PortSockClient,
host_equal(HostSockSrv, HostPeerClient),