aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiclas Eklund <[email protected]>2011-03-08 15:18:49 +0100
committerNiclas Eklund <[email protected]>2011-05-19 14:38:22 +0200
commit61c134fa961a0aaa86be17d921dbe6727d0a7c1c (patch)
tree55ccd917391d891b8e5b7f914732e602d0e4cc8d
parent9100921827bdfb32bcfab2569618393997d5fef4 (diff)
downloadotp-61c134fa961a0aaa86be17d921dbe6727d0a7c1c.tar.gz
otp-61c134fa961a0aaa86be17d921dbe6727d0a7c1c.tar.bz2
otp-61c134fa961a0aaa86be17d921dbe6727d0a7c1c.zip
Fixed host handling in ssh_test_lib (daemon and connect functions).
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl10
-rw-r--r--lib/ssh/test/ssh_test_lib.erl6
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index b51b17b2f4..f01b0a719e 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -279,11 +279,11 @@ daemon_already_started(suite) ->
daemon_already_started(Config) when is_list(Config) ->
SystemDir = ?config(data_dir, Config),
- {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
- {failfun, fun ssh_test_lib:failfun/2}]),
- {error, eaddrinuse} = ssh_test_lib:daemon(Host, Port, [{system_dir, SystemDir},
- {failfun,
- fun ssh_test_lib:failfun/2}]),
+ {Pid, _Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ {error, eaddrinuse} = ssh_test_lib:daemon(Port, [{system_dir, SystemDir},
+ {failfun,
+ fun ssh_test_lib:failfun/2}]),
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl
index 8b7d5e2992..8c9fb9038d 100644
--- a/lib/ssh/test/ssh_test_lib.erl
+++ b/lib/ssh/test/ssh_test_lib.erl
@@ -44,9 +44,13 @@ connect(Options) ->
connect(Port, Options) when is_integer(Port) ->
connect(hostname(), Port, Options);
+connect(any, Options) ->
+ connect(hostname(), inet_port(), Options);
connect(Host, Options) ->
connect(Host, inet_port(), Options).
+connect(any, Port, Options) ->
+ connect(hostname(), Port, Options);
connect(Host, Port, Options) ->
case ssh:connect(Host, Port, Options) of
{ok, ConnectionRef} ->
@@ -65,6 +69,8 @@ daemon(Host, Options) ->
daemon(Host, Port, Options) ->
case ssh:daemon(Host, Port, Options) of
+ {ok, Pid} when Host == any ->
+ {Pid, hostname(), Port};
{ok, Pid} ->
{Pid, Host, Port};
Error ->