diff options
Diffstat (limited to 'lib/snmp/test')
-rw-r--r-- | lib/snmp/test/snmp_agent_test.erl | 17 | ||||
-rw-r--r-- | lib/snmp/test/snmp_manager_test.erl | 23 | ||||
-rw-r--r-- | lib/snmp/test/snmp_to_snmpnet_SUITE.erl | 10 |
3 files changed, 38 insertions, 12 deletions
diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index 9a9258aa91..05c91c37a3 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -651,11 +651,18 @@ init_per_group(GroupName, Config) -> init_per_group_ipv6(GroupName, Config, Init) -> case ct:require(ipv6_hosts) of ok -> - Init( - snmp_test_lib:init_group_top_dir( - GroupName, - [{ipfamily, inet6}, - {ip, ?LOCALHOST(inet6)} | lists:keydelete(ip, 1, Config)])); + case gen_udp:open(0, [inet6]) of + {ok, S} -> + ok = gen_udp:close(S), + Init( + snmp_test_lib:init_group_top_dir( + GroupName, + [{ipfamily, inet6}, + {ip, ?LOCALHOST(inet6)} + | lists:keydelete(ip, 1, Config)])); + {error, _} -> + {skip, "Host seems to not support IPv6"} + end; _ -> {skip, "Host does not support IPV6"} end. diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl index 78352e59cf..fa90872172 100644 --- a/lib/snmp/test/snmp_manager_test.erl +++ b/lib/snmp/test/snmp_manager_test.erl @@ -584,17 +584,30 @@ init_per_group(event_tests_mt = GroupName, Config) -> init_per_group(ipv6_mt = GroupName, Config) -> case ct:require(ipv6_hosts) of ok -> - ipv6_init( - snmp_test_lib:init_group_top_dir( - GroupName, - [{manager_net_if_module, snmpm_net_if_mt} | Config])); + case gen_udp:open(0, [inet6]) of + {ok, S} -> + ok = gen_udp:close(S), + ipv6_init( + snmp_test_lib:init_group_top_dir( + GroupName, + [{manager_net_if_module, snmpm_net_if_mt} + | Config])); + {error, _} -> + {skip, "Host seems to not support IPv6"} + end; _ -> {skip, "Host does not support IPV6"} end; init_per_group(ipv6 = GroupName, Config) -> case ct:require(ipv6_hosts) of ok -> - ipv6_init(snmp_test_lib:init_group_top_dir(GroupName, Config)); + case gen_udp:open(0, [inet6]) of + {ok, S} -> + ok = gen_udp:close(S), + ipv6_init(snmp_test_lib:init_group_top_dir(GroupName, Config)); + {error, _} -> + {skip, "Host seems to not support IPv6"} + end; _ -> {skip, "Host does not support IPV6"} end; diff --git a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl index 1c2e08dc41..5ce9cf9e5c 100644 --- a/lib/snmp/test/snmp_to_snmpnet_SUITE.erl +++ b/lib/snmp/test/snmp_to_snmpnet_SUITE.erl @@ -110,9 +110,15 @@ init_per_group(_, Config) -> init_per_group_ipv6(Families, Config) -> case ct:require(ipv6_hosts) of ok -> - init_per_group_ip(Families, Config); + case gen_udp:open(0, [inet6]) of + {ok, S} -> + ok = gen_udp:close(S), + init_per_group_ip(Families, Config); + {error, _} -> + {skip, "Host seems to not support IPv6"} + end; _ -> - {skip, "Host does not support IPV6"} + {skip, "Test config ipv6_hosts is missing"} end. init_per_group_ip(Families, Config) -> |