diff options
author | Raimo Niskanen <[email protected]> | 2016-07-28 10:16:28 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2016-07-28 10:16:28 +0200 |
commit | 2580e4f9e59baf4205f550f55392391668b441cd (patch) | |
tree | 3db3db3c3f4487de01b30dc5b865cd0556059831 /lib/kernel | |
parent | 96d877d53333e5031c7f751123593886819d7fc7 (diff) | |
download | otp-2580e4f9e59baf4205f550f55392391668b441cd.tar.gz otp-2580e4f9e59baf4205f550f55392391668b441cd.tar.bz2 otp-2580e4f9e59baf4205f550f55392391668b441cd.zip |
Test inet:getstat/1 dead for SCTP send
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/test/gen_sctp_SUITE.erl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index d38e5a35e7..620ab235a0 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -117,7 +117,11 @@ xfer_min(Config) when is_list(Config) -> Stream = 0, Data = <<"The quick brown fox jumps over a lazy dog 0123456789">>, Loopback = {127,0,0,1}, + StatOpts = + [recv_avg,recv_cnt,recv_max,recv_oct, + send_avg,send_cnt,send_max,send_oct], {ok,Sb} = gen_sctp:open([{type,seqpacket}]), + {ok,SbStat1} = inet:getstat(Sb, StatOpts), {ok,Pb} = inet:port(Sb), ok = gen_sctp:listen(Sb, true), @@ -212,6 +216,8 @@ xfer_min(Config) when is_list(Config) -> assoc_id=SbAssocId}} = recv_event(log_ok(gen_sctp:recv(Sb, infinity))), ok = gen_sctp:close(Sa), + {ok,SbStat2} = inet:getstat(Sb, StatOpts), + [] = filter_stat_eq(SbStat1, SbStat2), ok = gen_sctp:close(Sb), receive @@ -220,6 +226,18 @@ xfer_min(Config) when is_list(Config) -> end, ok. +filter_stat_eq([], []) -> + []; +filter_stat_eq([{Tag,Val1}=Stat|SbStat1], [{Tag,Val2}|SbStat2]) -> + if + Val1 == Val2 -> + [Stat|filter_stat_eq(SbStat1, SbStat2)]; + true -> + filter_stat_eq(SbStat1, SbStat2) + end. + + + %% Minimal data transfer in active mode. xfer_active(Config) when is_list(Config) -> Timeout = 2000, |