From 1a6611c383fd0c85fecfd70e04e4e4525c0a55b1 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Thu, 20 Jan 2011 16:26:27 +0100 Subject: 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. --- lib/orber/test/orber_test_lib.erl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/orber/test/orber_test_lib.erl') 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 -- cgit v1.2.3