diff options
author | Niclas Eklund <[email protected]> | 2011-01-20 16:26:27 +0100 |
---|---|---|
committer | Niclas Eklund <[email protected]> | 2011-01-20 16:26:27 +0100 |
commit | 1a6611c383fd0c85fecfd70e04e4e4525c0a55b1 (patch) | |
tree | 77454ec8b694855e76d7adafe1bd9aee9257456d | |
parent | 06ff115c291c4bb07a728bbeb72f67822e9d4b80 (diff) | |
download | otp-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.
-rw-r--r-- | lib/orber/test/orber_test_lib.erl | 15 |
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 |