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_manager_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_manager_test.erl')
-rw-r--r-- | lib/snmp/test/snmp_manager_test.erl | 70 |
1 files changed, 42 insertions, 28 deletions
diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl index 5b0ebf8647..8fd325192b 100644 --- a/lib/snmp/test/snmp_manager_test.erl +++ b/lib/snmp/test/snmp_manager_test.erl @@ -619,38 +619,52 @@ init_per_group(event_tests_mt = GroupName, Config) -> GroupName, [{manager_net_if_module, snmpm_net_if_mt} | Config]); init_per_group(ipv6_mt = GroupName, Config) -> - {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 -> - ipv6_init( - snmp_test_lib:init_group_top_dir( - GroupName, - [{manager_net_if_module, snmpm_net_if_mt} - | Config])); - false -> - {skip, "Host does not support IPv6"} - end; - _ -> - {skip, "Test config ipv6_hosts is missing"} - end; + init_per_group_ipv6(GroupName, + [{manager_net_if_module, snmpm_net_if_mt} | Config]); init_per_group(ipv6 = GroupName, Config) -> - {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 -> - ipv6_init(snmp_test_lib:init_group_top_dir(GroupName, Config)); - false -> - {skip, "Host does not support IPv6"} - end; - _ -> - {skip, "Test config ipv6_hosts is missing"} - end; + init_per_group_ipv6(GroupName, Config); init_per_group(GroupName, Config) -> snmp_test_lib:init_group_top_dir(GroupName, Config). + +init_per_group_ipv6(GroupName, Config) -> + %% <OS-CONDITIONAL-SKIP> + OSSkipable = [{unix, + [ + {darwin, fun(V) when (V > {9, 8, 0}) -> + %% This version is OK: No Skip + false; + (_) -> + %% This version is *not* ok: Skip + %% We need a fully qualified hostname + %% to get a proper IPv6 address (in this + %% version), but its just to messy, so + %% instead we skip this **OLD** darwin... + true + end} + ] + }], + %% </OS-CONDITIONAL-SKIP> + case ?OS_BASED_SKIP(OSSkipable) of + true -> + {skip, "Host *may* not *properly* support IPV6"}; + false -> + {ok, Hostname} = inet:gethostname(), + case ct:require(ipv6_hosts) of + ok -> + case lists:member(list_to_atom(Hostname), + ct:get_config(ipv6_hosts)) of + true -> + ipv6_init(snmp_test_lib:init_group_top_dir(GroupName, + Config)); + false -> + {skip, "Host does not support IPv6"} + end; + _ -> + {skip, "Test config ipv6_hosts is missing"} + end + end. + end_per_group(_GroupName, Config) -> %% Do we really need to do this? lists:keydelete(snmp_group_top_dir, 1, Config). |