aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-03-30 14:24:29 +0200
committerBjörn Gustavsson <[email protected]>2016-03-30 14:29:54 +0200
commit02d9540ecacb42d4cc593b89eb7cf22fe6dedd42 (patch)
tree4f1ea1c7b51f36ab437f1a160b3e5c973d424cce
parentccae4cd1aaef5f30ba66871b52127f370e77f83f (diff)
downloadotp-02d9540ecacb42d4cc593b89eb7cf22fe6dedd42.tar.gz
otp-02d9540ecacb42d4cc593b89eb7cf22fe6dedd42.tar.bz2
otp-02d9540ecacb42d4cc593b89eb7cf22fe6dedd42.zip
inet_SUITE: Handle {error,enoent} in simple_netns_open
Allow an open operation to fail with {error,enoent}. That will happen if the executable has compiled-in support for netns, but the computer has not been configured for netns.
-rw-r--r--lib/kernel/test/inet_SUITE.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl
index 27c364c3e0..0f114a971a 100644
--- a/lib/kernel/test/inet_SUITE.erl
+++ b/lib/kernel/test/inet_SUITE.erl
@@ -1138,24 +1138,28 @@ jog_netns_opt(S) ->
ok.
+%% Smoke test netns support.
simple_netns_open(Config) when is_list(Config) ->
+ %% Note: {error,enoent} will be returned if the run-time executable
+ %% has support for netns, but /proc/self/ns/net is missing.
case gen_udp:open(0, [binary,{netns,"/"},inet]) of
{ok,U} ->
ok = gen_udp:close(U);
- {error,E1} when E1 =:= einval; E1 =:= eperm ->
+ {error,E1} when E1 =:= einval; E1 =:= eperm; E1 =:= enoent ->
ok
end,
case gen_tcp:listen(0, [binary,{netns,"/"},inet]) of
{ok,T} ->
ok = gen_tcp:close(T);
- {error,E2} when E2 =:= einval; E2 =:= eperm ->
+ {error,E2} when E2 =:= einval; E2 =:= eperm; E2 =:= enoent ->
ok
end,
try gen_sctp:open(0, [binary,{netns,"/"},inet]) of
{ok,S} ->
ok = gen_sctp:close(S);
{error,E3}
- when E3 =:= einval; E3 =:= eperm; E3 =:= eprotonosupport ->
+ when E3 =:= einval; E3 =:= eperm;
+ E3 =:= enoent; E3 =:= eprotonosupport ->
ok
catch
error:badarg ->