aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-04-16 13:49:56 +0200
committerMicael Karlberg <[email protected]>2019-05-29 14:22:47 +0200
commit906a4e1161f1903caa4b7bafd5ca74f2f6789217 (patch)
treefc11a307d8db0d1c31067f3c20142abcf9256bd9 /erts/emulator/test
parent1039d05f393d470a1edba93a0026f4fba7d2ce5b (diff)
downloadotp-906a4e1161f1903caa4b7bafd5ca74f2f6789217.tar.gz
otp-906a4e1161f1903caa4b7bafd5ca74f2f6789217.tar.bz2
otp-906a4e1161f1903caa4b7bafd5ca74f2f6789217.zip
[socket] Add recvmsg(nowait) cancel test case
Add the recvmsg(nowait) cancel test cases.
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/socket_SUITE.erl34
1 files changed, 31 insertions, 3 deletions
diff --git a/erts/emulator/test/socket_SUITE.erl b/erts/emulator/test/socket_SUITE.erl
index aecd65096e..5a02f7904e 100644
--- a/erts/emulator/test/socket_SUITE.erl
+++ b/erts/emulator/test/socket_SUITE.erl
@@ -87,7 +87,7 @@
api_a_send_and_recv_tcp4/1,
api_a_sendmsg_and_recvmsg_tcp4/1,
api_a_recvfrom_cancel_udp4/1,
- %% api_a_recvmsg_cancel_udp4/1,
+ api_a_recvmsg_cancel_udp4/1,
%% api_a_accept_cancel_tcp4/1,
%% api_a_recv_cancel_tcp4/1,
%% api_a_recvmsg_cancel_tcp4/1,
@@ -678,8 +678,8 @@ api_async_cases() ->
api_a_sendmsg_and_recvmsg_udp4,
api_a_send_and_recv_tcp4,
api_a_sendmsg_and_recvmsg_tcp4,
- api_a_recvfrom_cancel_udp4%% ,
- %% api_a_recvmsg_cancel_udp4,
+ api_a_recvfrom_cancel_udp4,
+ api_a_recvmsg_cancel_udp4%%,
%% api_a_accept_cancel_tcp4,
%% api_a_recv_cancel_tcp4,
%% api_a_recvmsg_cancel_tcp4
@@ -3722,6 +3722,34 @@ api_a_recvfrom_cancel_udp4(_Config) when is_list(_Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Basically we make an async (Timeout = nowait) call to recvmsg,
+%% wait some time and then cancel.
+%%
+api_a_recvmsg_cancel_udp4(suite) ->
+ [];
+api_a_recvmsg_cancel_udp4(doc) ->
+ [];
+api_a_recvmsg_cancel_udp4(_Config) when is_list(_Config) ->
+ ?TT(?SECS(5)),
+ tc_try(api_a_recvmsg_cancel_udp4,
+ fun() ->
+ Recv = fun(Sock) ->
+ case socket:recvmsg(Sock, nowait) of
+ {ok, _} = OK ->
+ OK;
+ {error, _} = ERROR ->
+ ERROR
+ end
+ end,
+ InitState = #{domain => inet,
+ recv => Recv},
+ ok = api_a_recv_cancel_udp(InitState)
+ end).
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
api_a_recv_cancel_udp(InitState) ->
ServerSeq =
[