aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-09-14 12:59:17 +0200
committerAnders Svensson <[email protected]>2017-09-17 16:54:28 +0200
commitd38295257c5309e7291487edfacdfad605eec3e9 (patch)
tree82bc062e99322f24b23a333c4a0f03761d7ed837 /lib/diameter/test
parenta3749fd240260958053f90539b0f7e04e720d070 (diff)
downloadotp-d38295257c5309e7291487edfacdfad605eec3e9.tar.gz
otp-d38295257c5309e7291487edfacdfad605eec3e9.tar.bz2
otp-d38295257c5309e7291487edfacdfad605eec3e9.zip
Make unordered delivery configurable
Changing the default in the parent commit is possibly a bit dangerous, even if the motivation still holds. Take a step back and make unordered delivery a matter of configuration, without changing the default: configuration is {unordered, boolean() | pos_integer()}, with false the default, and N equivalent to OS =< N, where OS is the number of outbound streams negotiated on the association in question. A user can mess with this by configuring an sctp_default_send_param of their own, but unordered sending is them from start, not only after the second message reception.
Diffstat (limited to 'lib/diameter/test')
-rw-r--r--lib/diameter/test/diameter_traffic_SUITE.erl19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl
index f058ed65b8..2c478140f8 100644
--- a/lib/diameter/test/diameter_traffic_SUITE.erl
+++ b/lib/diameter/test/diameter_traffic_SUITE.erl
@@ -480,9 +480,10 @@ add_transports(Config) ->
LRef = ?util:listen(SN,
[T,
{sender, SS},
- {message_cb, ST andalso {?MODULE, message, [0]}}
- | [{packet, hd(?util:scramble([false, raw]))}
- || T == sctp andalso CS]],
+ {message_cb, ST andalso {?MODULE, message, [0]}}]
+ ++ [{packet, hd(?util:scramble([false, raw]))}
+ || T == sctp andalso CS]
+ ++ [{unordered, unordered()} || T == sctp],
[{capabilities_cb, fun capx/2},
{pool_size, 8}
| server_apps()]
@@ -498,13 +499,17 @@ add_transports(Config) ->
Id <- [{D,E}]],
?util:write_priv(Config, "transport", [LRef | Cs]).
+unordered() ->
+ element(rand:uniform(4), {true, false, 1, 2}).
+
client_opts(tcp) ->
[];
client_opts(sctp) ->
- [{sctp_initmsg, #sctp_initmsg{num_ostreams = N,
- max_instreams = 5}}
- || N <- [rand:uniform(8)],
- N =< 6].
+ [{unordered, unordered()}
+ | [{sctp_initmsg, #sctp_initmsg{num_ostreams = N,
+ max_instreams = 5}}
+ || N <- [rand:uniform(8)],
+ N =< 6]].
server_apps() ->
B = have_nas(),