diff options
author | Micael Karlberg <[email protected]> | 2019-05-29 12:10:56 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-05-29 12:10:56 +0200 |
commit | e628d2cdf8953b8692e6b9ac0265c20bfce4b21d (patch) | |
tree | e151e1ce6545d92a483a531cbef01936ab04b73a /lib/snmp/test/snmp_agent_test.erl | |
parent | 36e61f1e23bf06664206aaba1848e36440a36e4a (diff) | |
download | otp-e628d2cdf8953b8692e6b9ac0265c20bfce4b21d.tar.gz otp-e628d2cdf8953b8692e6b9ac0265c20bfce4b21d.tar.bz2 otp-e628d2cdf8953b8692e6b9ac0265c20bfce4b21d.zip |
[snmp|test] Improved IPv6 test checks
Improve the checks for if/when we shall run the IPv6
test cases.
OTP-15764
Diffstat (limited to 'lib/snmp/test/snmp_agent_test.erl')
-rw-r--r-- | lib/snmp/test/snmp_agent_test.erl | 30 |
1 files changed, 12 insertions, 18 deletions
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. |