diff options
author | Micael Karlberg <[email protected]> | 2019-04-17 17:39:54 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-05-28 18:57:07 +0200 |
commit | 36e61f1e23bf06664206aaba1848e36440a36e4a (patch) | |
tree | 0762b68d33c2cd978a317ab915304bf6d0021e8c /lib/snmp/test/snmp_agent_test.erl | |
parent | 6c2bb8d54f774970a30365e3ee94af66e099886b (diff) | |
download | otp-36e61f1e23bf06664206aaba1848e36440a36e4a.tar.gz otp-36e61f1e23bf06664206aaba1848e36440a36e4a.tar.bz2 otp-36e61f1e23bf06664206aaba1848e36440a36e4a.zip |
[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
Diffstat (limited to 'lib/snmp/test/snmp_agent_test.erl')
-rw-r--r-- | lib/snmp/test/snmp_agent_test.erl | 55 |
1 files changed, 39 insertions, 16 deletions
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"} + %% <OS-CONDITIONAL-SKIP> + %% 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} + ] + }], + %% </OS-CONDITIONAL-SKIP> + 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) -> |