aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorRaimo Niskanen <raimo@erlang.org>2010-07-07 11:47:07 +0200
committerRaimo Niskanen <raimo@erlang.org>2010-07-07 11:47:07 +0200
commit8af186a816f67077e637c6b78415221e7cc05bbe (patch)
treec1be04c64c46b45adb1acb99df94411b53156236 /lib/kernel
parent69764c865db61c0351be215f7f36947a71ef82f1 (diff)
parent2128fcef45951e159f05e5667841a7442acfa1be (diff)
downloadotp-8af186a816f67077e637c6b78415221e7cc05bbe.tar.gz
otp-8af186a816f67077e637c6b78415221e7cc05bbe.tar.bz2
otp-8af186a816f67077e637c6b78415221e7cc05bbe.zip
Merge branch 'rani/sctp-udp-recv-error' into dev
* rani/sctp-udp-recv-error: Fix inet_drv to detect passive mode UDP errors for SCTP builds
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/test/gen_udp_SUITE.erl21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl
index bd5685952e..fa1991872b 100644
--- a/lib/kernel/test/gen_udp_SUITE.erl
+++ b/lib/kernel/test/gen_udp_SUITE.erl
@@ -34,12 +34,12 @@
-export([send_to_closed/1,
buffer_size/1, binary_passive_recv/1, bad_address/1,
- read_packets/1, open_fd/1]).
+ read_packets/1, open_fd/1, connect/1]).
all(suite) ->
[send_to_closed,
buffer_size, binary_passive_recv, bad_address, read_packets,
- open_fd].
+ open_fd, connect].
init_per_testcase(_Case, Config) ->
?line Dog=test_server:timetrap(?default_timeout),
@@ -408,3 +408,20 @@ start_node(Name) ->
stop_node(Node) ->
?t:stop_node(Node).
+
+
+connect(suite) ->
+ [];
+connect(doc) ->
+ ["Test that connect/3 has effect"];
+connect(Config) when is_list(Config) ->
+ Addr = {127,0,0,1},
+ {ok,S1} = gen_udp:open(0),
+ {ok,P1} = inet:port(S1),
+ {ok,S2} = gen_udp:open(0),
+ ok = inet:setopts(S2, [{active,false}]),
+ ok = gen_udp:close(S1),
+ ok = gen_udp:connect(S2, Addr, P1),
+ ok = gen_udp:send(S2, <<16#deadbeef:32>>),
+ {error,econnrefused} = gen_udp:recv(S2, 0, 5),
+ ok.