From 36e61f1e23bf06664206aaba1848e36440a36e4a Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 17 Apr 2019 17:39:54 +0200 Subject: [snmp|test] Maybe skipable (IPv6) groups Add an "os test" to the IPv6 group init. On "old" version of darwin (9.8.0) its simply to messy to figure out our IPv6 address, so its better to simply skip the IPv6 tests on those machines. OTP-15764 --- lib/snmp/test/snmp_agent_test.erl | 55 +++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 16 deletions(-) (limited to 'lib/snmp/test/snmp_agent_test.erl') diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index 71e3fa3b9a..fa7db87c38 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -667,22 +667,45 @@ init_per_group(GroupName, Config) -> snmp_test_lib:init_group_top_dir(GroupName, Config). init_per_group_ipv6(GroupName, Config, Init) -> - {ok, Hostname0} = inet:gethostname(), - case ct:require(ipv6_hosts) of - ok -> - case lists:member(list_to_atom(Hostname0), ct:get_config(ipv6_hosts)) of - true -> - Init( - snmp_test_lib:init_group_top_dir( - GroupName, - [{ipfamily, inet6}, - {ip, ?LOCALHOST(inet6)} - | lists:keydelete(ip, 1, Config)])); - false -> - {skip, "Host does not support IPV6"} - end; - _ -> - {skip, "Test config ipv6_hosts is missing"} + %% + %% This is a higly questionable test. + %% But until we have time to figure out what IPv6 issues + %% are actually causing the failures... + OSSkipable = [{unix, + [ + {darwin, fun(V) when (V > {9, 8, 0}) -> + %% This version is OK: No Skip + false; + (_) -> + %% This version is *not* ok: Skip + true + end} + ] + }], + %% + case ?OS_BASED_SKIP(OSSkipable) of + true -> + {skip, "Host *may* not *properly* support IPV6"}; + false -> + %% And now for the "proper" test... + case ct:require(ipv6_hosts) of + ok -> + {ok, Hostname0} = inet:gethostname(), + case lists:member(list_to_atom(Hostname0), + ct:get_config(ipv6_hosts)) of + true -> + Init( + snmp_test_lib:init_group_top_dir( + GroupName, + [{ipfamily, inet6}, + {ip, ?LOCALHOST(inet6)} + | lists:keydelete(ip, 1, Config)])); + false -> + {skip, "Host does not support IPV6"} + end; + _ -> + {skip, "Test config ipv6_hosts is missing"} + end end. end_per_group(all_tcs, Config) -> -- cgit v1.2.3 From e628d2cdf8953b8692e6b9ac0265c20bfce4b21d Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 29 May 2019 12:10:56 +0200 Subject: [snmp|test] Improved IPv6 test checks Improve the checks for if/when we shall run the IPv6 test cases. OTP-15764 --- lib/snmp/test/snmp_agent_test.erl | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'lib/snmp/test/snmp_agent_test.erl') diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index fa7db87c38..860ca17cdb 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -687,24 +687,18 @@ init_per_group_ipv6(GroupName, Config, Init) -> true -> {skip, "Host *may* not *properly* support IPV6"}; false -> - %% And now for the "proper" test... - case ct:require(ipv6_hosts) of - ok -> - {ok, Hostname0} = inet:gethostname(), - case lists:member(list_to_atom(Hostname0), - ct:get_config(ipv6_hosts)) of - true -> - Init( - snmp_test_lib:init_group_top_dir( - GroupName, - [{ipfamily, inet6}, - {ip, ?LOCALHOST(inet6)} - | lists:keydelete(ip, 1, Config)])); - false -> - {skip, "Host does not support IPV6"} - end; - _ -> - {skip, "Test config ipv6_hosts is missing"} + %% Even if this host supports IPv6 we don't use it unless its + %% one of the configured/supported IPv6 hosts... + case (?HAS_SUPPORT_IPV6() andalso ?IS_IPV6_HOST()) of + true -> + Init( + snmp_test_lib:init_group_top_dir( + GroupName, + [{ipfamily, inet6}, + {ip, ?LOCALHOST(inet6)} + | lists:keydelete(ip, 1, Config)])); + false -> + {skip, "Host does not support IPv6"} end end. -- cgit v1.2.3