aboutsummaryrefslogtreecommitdiffstats
path: root/lib/orber/test
diff options
context:
space:
mode:
authorNiclas Eklund <[email protected]>2011-01-20 16:26:27 +0100
committerNiclas Eklund <[email protected]>2011-01-20 16:26:27 +0100
commit1a6611c383fd0c85fecfd70e04e4e4525c0a55b1 (patch)
tree77454ec8b694855e76d7adafe1bd9aee9257456d /lib/orber/test
parent06ff115c291c4bb07a728bbeb72f67822e9d4b80 (diff)
downloadotp-1a6611c383fd0c85fecfd70e04e4e4525c0a55b1.tar.gz
otp-1a6611c383fd0c85fecfd70e04e4e4525c0a55b1.tar.bz2
otp-1a6611c383fd0c85fecfd70e04e4e4525c0a55b1.zip
OTP-9035 - More tests added so that Orber does not try to run IPv6 tests
on a machine than cannot handle that. This only affect test code and not the application.
Diffstat (limited to 'lib/orber/test')
-rw-r--r--lib/orber/test/orber_test_lib.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl
index b95cf4b0ec..132f02bb78 100644
--- a/lib/orber/test/orber_test_lib.erl
+++ b/lib/orber/test/orber_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -126,13 +126,22 @@ version_ok() ->
_ ->
case gen_tcp:listen(0, [{reuseaddr, true}, inet6]) of
{ok, LSock} ->
- gen_tcp:close(LSock),
- true;
+ {ok, Port} = inet:port(LSock),
+ case gen_tcp:connect(Hostname, Port, [inet6]) of
+ {error, _} ->
+ gen_tcp:close(LSock),
+ {skipped, "Inet cannot handle IPv6"};
+ {ok, Socket} ->
+ gen_tcp:close(Socket),
+ gen_tcp:close(LSock),
+ true
+ end;
{error, _} ->
{skipped, "Inet cannot handle IPv6"}
end
end
end.
+
%%------------------------------------------------------------
%% function : get_host
%% Arguments: Family - inet | inet6