aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-07-09 14:57:29 +0200
committerMicael Karlberg <[email protected]>2019-07-15 13:39:02 +0200
commitf371340eab3ecdbf944f9e787e53f2d3e9a816be (patch)
treeaa1bc3d3d50a14c53a219471f59a38ca49c9bdac /erts
parentca359d31a0128286edadac3ca384d51035d7b12f (diff)
downloadotp-f371340eab3ecdbf944f9e787e53f2d3e9a816be.tar.gz
otp-f371340eab3ecdbf944f9e787e53f2d3e9a816be.tar.bz2
otp-f371340eab3ecdbf944f9e787e53f2d3e9a816be.zip
[esock|test] Extend gcc and multicast checks
Extend the "checks" for faulty gcc (found another platform with the same problem (Old SLES 11). Also tweaked the multicast test a bit.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/test/socket_SUITE.erl47
1 files changed, 32 insertions, 15 deletions
diff --git a/erts/emulator/test/socket_SUITE.erl b/erts/emulator/test/socket_SUITE.erl
index a495ab18b4..d72b342f22 100644
--- a/erts/emulator/test/socket_SUITE.erl
+++ b/erts/emulator/test/socket_SUITE.erl
@@ -1752,13 +1752,15 @@ has_bugfree_gcc() ->
%% Make sure we are on linux
has_bugfree_gcc({unix, linux}) ->
- has_bugfree_gcc2(os:cmd("cat /etc/issue"));
+ has_bugfree_gcc2(string:trim(os:cmd("cat /etc/issue")));
has_bugfree_gcc(_) ->
ok.
%% Make sure we are on Fedora 16
has_bugfree_gcc2("Fedora release 16 " ++ _) ->
has_bugfree_gcc3(os:cmd("gcc --version"));
+has_bugfree_gcc2("Welcome to SUSE Linux " ++ _) ->
+ has_bugfree_gcc4(os:cmd("gcc --version"));
has_bugfree_gcc2(_) ->
ok.
@@ -1767,6 +1769,11 @@ has_bugfree_gcc3("gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2" ++ _) ->
has_bugfree_gcc3(_) ->
ok.
+has_bugfree_gcc4("gcc (SUSE Linux) 4.3.2" ++ _) ->
+ skip("Buggy GCC");
+has_bugfree_gcc4(_) ->
+ ok.
+
api_m_debug() ->
i("get initial info"),
#{debug := D0} = socket:info(),
@@ -1784,6 +1791,7 @@ api_m_debug() ->
ok.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
@@ -8591,6 +8599,7 @@ which_multicast_address(Domain) ->
which_multicast_address2(Domain, WhichMAddr);
Type ->
+ %% Actually, what is "not supported". is netstat!
not_supported({multicast, Type})
end.
@@ -8600,20 +8609,28 @@ which_multicast_address(Domain) ->
which_multicast_address2(Domain, WhichMAddr) ->
IfName = which_local_host_ifname(Domain),
- try
- begin
- %% On some platforms the netstat barfs out some crap on stderr
- %% before the actual info...
- NetstatGroupsStr = os:cmd("netstat -g 2>/dev/null | grep " ++ IfName),
- NetstatGroups0 = string:tokens(NetstatGroupsStr, [$\n]),
- NetstatGroups = [string:tokens(G, [$ ]) || G <- NetstatGroups0],
- MAddrs = [WhichMAddr(NetstatGroup) || NetstatGroup <-
- NetstatGroups],
- which_multicast_address3(Domain, MAddrs)
- end
- catch
- C:E:S ->
- not_supported({multicast, {C,E,S}})
+ %% On some platforms the netstat barfs out some crap on stderr
+ %% before the actual info...
+ case os:cmd("netstat -g 2>/dev/null | grep " ++ IfName) of
+ [] ->
+ %% Can't figure out if we support multicast or not...
+ not_supported(no_netstat);
+ NetstatGroupsStr ->
+ try
+ begin
+ NetstatGroups0 = string:tokens(NetstatGroupsStr, [$\n]),
+ NetstatGroups = [string:tokens(G, [$ ]) ||
+ G <- NetstatGroups0],
+ MAddrs = [WhichMAddr(NetstatGroup) ||
+ NetstatGroup <- NetstatGroups],
+ which_multicast_address3(Domain, MAddrs)
+ end
+ catch
+ throw:E:_ ->
+ throw(E);
+ C:E:S ->
+ not_supported({multicast, {C,E,S}})
+ end
end.
which_multicast_address3(_Domain, []) ->