aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test
AgeCommit message (Collapse)Author
2017-08-28Fix influence of decode_format on service eventsAnders Svensson
Decoded CER/CEA messages are passed in events messages that can be subscribed to using diameter:subscribe/1. A configured decode_format was not reflected in these, messages always being passed as records. Clarify that strict_arities only applies to message callbacks.
2017-08-22Work around more common_test woeAnders Svensson
Testcase init functions are getting Config from groups and suites they're not in. Presumably related to the problems worked around in the parent commit.
2017-08-17Work around unexpected common_test behaviourAnders Svensson
diameter_traffic_SUITE has four layers of nested groups, so when a testcase is run it should get Config from four init_per_group plus one init_per_testcase. This isn't what happens: Config is being accumulated from several init_per_group in some manner that isn't clear, and the skip in the parent commit somehow results in growing test_server_gl:init/1 processes that eventually consume all memory. Replacing rather than prepending to Config in init_per_group works around this, but the common_test behaviour seems wrong.
2017-08-11Randomly skip groups in traffic suiteAnders Svensson
To limit the number of testcases being run.
2017-08-11Randomly disable traffic counters in traffic suiteAnders Svensson
To exercise the new traffic_counters option.
2017-08-10Sleep randomly at the start of (parallel) traffic testcasesAnders Svensson
2017-08-10Fix ct return value in traffic suiteAnders Svensson
Which has had no negative effect.
2017-08-03Use relaxed arity checks in traffic suiteAnders Svensson
2017-08-03Test Result-Code 5009 in traffic suiteAnders Svensson
Aka DIAMETER_AVP_OCCURS_TOO_MANY_TIMES. This reveals a fault. The RFC says this: A message was received that included an AVP that appeared more often than permitted in the message definition. The Failed-AVP AVP MUST be included and contain a copy of the first instance of the offending AVP that exceeded the maximum number of occurrences. The list of AVPs is reversed when diameter checks arities, so Failed-AVP contains the wrong AVP, causing the new testcase to fail.
2017-08-03Test decode_format record_from_map in traffic suiteAnders Svensson
2017-08-03Tweak limiting of testcases in traffic suiteAnders Svensson
Since the number is now under 50K again. Also make testing of individual groups or testcases easier.
2017-08-03Tweak map-valued decodeAnders Svensson
Use the same [MsgName | Avps] representation as for the list decode, but with Avps a map instead of a AVP name/values list. As a result, don't set the message/AVP name on an additional key in the map, which felt a bit odd. Messages are [MsgName :: atom() | map()], Grouped AVPs are just map(). Fix at least one problem in the traffic suite along the way: with decode_format false, the own decode in to_map/2 didn't know whether or not to decode strings, resulting on some failures.
2017-08-03Rearrange group names in traffic suiteAnders Svensson
For slightly better readability in the ct logs
2017-08-03Randomly wrap answers in diameter_packet in transport suiteAnders Svensson
To reduce the number of combinations tested, as in the parent commit.
2017-08-03Don't exercise client/server encoding independently in traffic suiteAnders Svensson
To reduce the number of config combinations that are tested. The encoding is the format in which messages are provided to diameter for encode (to binary), and if there is any difference in the end result then the peer will detect this at decode, independently of its encoding format.
2017-08-03Rename record_decode -> decode_formatAnders Svensson
{record_decode, map} is a bit too quirky.
2017-08-03Create fewer client connections in traffic suiteAnders Svensson
One for each server decoding/encoding/container combination is overkill. Just want a few from which one can be chosen in the pick_peer callback.
2017-08-03Test record_decode in traffic suiteAnders Svensson
2017-08-03Map answers to maps in traffic suiteAnders Svensson
Instead of to lists, to simplify matching.
2017-08-03Test map encoding in traffic suiteAnders Svensson
2017-08-03Add service_opt() record_decodeAnders Svensson
To control whether or not messages and grouped AVPs are decoded to records, in #diameter_packet.msg and #diameter_avp.value respectively. The decode became unnecessary for diameter's needs in parent commit, which decoupled it from the checking of AVP arities.
2017-08-03Fix message_cb in traffic suiteAnders Svensson
Matched a byte instead of a bit, and increment/decrement wasn't symmetric. Allow more requests since some requests timeout. Bungled in commit 09089872.
2017-07-10Exercise example RFC 4005 dictionary in traffic suiteAnders Svensson
Only exercising the standard dictionaries has missed some problems in the past.
2017-06-15Merge branch 'hans/otp/update_copyright'Hans Nilsson
2017-06-14Merge branch 'anders/diameter/transport/ERL-332'Anders Svensson
* anders/diameter/transport/ERL-332: Fix sctp check in examples suite
2017-06-14Fix sctp check in examples suiteAnders Svensson
To partake of the change in commit 69c5a741.
2017-06-14Update copyright yearHans Nilsson
2017-06-14Merge branch 'anders/diameter/capx_vs_dpr/OTP-14338'Anders Svensson
* anders/diameter/capx_vs_dpr/OTP-14338: Let candidate peers be passed to diameter:call/4 Comment on RFC ambiguity regarding application identifiers Remove trailing whitespace
2017-06-14Merge branch 'anders/diameter/performance/OTP-14343'Anders Svensson
* anders/diameter/performance/OTP-14343: (50 commits) Let spawn_opt config replace erlang:spawn_opt/2 for request processes Move (most of) diameter_gen.hrl to diameter_gen.erl Change signature associated with dictionary @custom_type/@codecs Avoid sending answer terms between processes unnecessarily Refactor handling of incoming requests Restore diameter_codec:decode/2, update diameter_codec(3) Add diameter_codec option ordered_encode Restore undocumented Failed-AVP setting convenience Fix/simplify setting of one Failed-AVP Avoid recreating records Avoid recreating records Avoid recreating records Avoid recreating records Adapt test suites to modified encode/decode Simplify diameter_caps construction Don't compute URI defaults unnecessarily Don't deconstruct {TPid, Caps} unnecessarily Remove use of process dictionary in decode Remove minor diameter_config bloat Fix maximum AVP arity check ...
2017-06-14Merge branch 'anders/diameter/transport/ERL-332'Anders Svensson
* anders/diameter/transport/ERL-332: (35 commits) Capitulate on SCTP vs sparc-sun-solaris2.10 Remove obsolete traffic testcase Fix dialyzer warnings Remove client/server string decode from traffic suite Add diameter_sctp option packet Add diameter_sctp send/recv callbacks Let diameter_tcp send/recv callbacks deal in diameter_packet Randomly select traffic testcases Exercise diameter_tcp message callbacks in traffic suite Exercise diameter_{tcp,sctp} sender in traffic suite Remove upgrade from diameter_traffic Add diameter_tcp send/recv callbacks Make diameter_{tcp,sctp} sender configurable Remove upgrade from diameter_sctp; tweak diameter_tcp to match Fix incomprehensible dialyzer warning Simplify acks to transport processes Strip throttling callbacks from diameter_tcp Deal with (another) SCTP association id quirk on Solaris Use binary:copy/2 when generating largish data in test suites Deal with SCTP association id quirk on Solaris ...
2017-06-13Let spawn_opt config replace erlang:spawn_opt/2 for request processesAnders Svensson
By accepting an MFA that is applied to the fun that is otherwise spawned for each incoming request, to allow handler processes to be reused. This is not yet documented and may change, but the motivation is to let spawn be replaced by process pool, from which the MFA selects. A list-valued spawn_opt is equivalent to {erlang, spawn_opt, [Opts]}.
2017-06-13Let candidate peers be passed to diameter:call/4Anders Svensson
To solve the problem of being able to send messages to a peer that hasn't advertised support for the application in question, as discussed in the parent commit. diameter:call/4 can be passed 'peer' options to identify candidates, and the only requirement is that an appropriate dictionary be configured for encode. Filters are applied as if candidates had been selected by advertised application.
2017-06-13Remove trailing whitespaceAnders Svensson
2017-06-13Move (most of) diameter_gen.hrl to diameter_gen.erlAnders Svensson
To remove the requirement that dictionary modules be recompiled whenever the encode/decode implementation changes. The included diameter_gen.hrl now only contains trivial functions that call info diameter_gen.erl.
2017-06-13Change signature associated with dictionary @custom_type/@codecsAnders Svensson
To pass the options map through the encode. This is not backwards compatible, and dictionaries supporting @custom_types or @codecs will need to be updated.
2017-06-13Adapt test suites to modified encode/decodeAnders Svensson
2017-06-13Capitulate on SCTP vs sparc-sun-solaris2.10Anders Svensson
Despite the efforts of commits 1df74351 and 111261d1 to salvage it, SCTP is just flakey on sparc-sun-solaris2.10. In addition to the woes of the loopback address, even connect on other addresses sporadically returns {error, eafnosupport}, so the initial check for a working SCTP (aka resistance) is futile. Revert both commits.
2017-06-12Remove obsolete traffic testcaseAnders Svensson
Outgoing requests no longer write to the request table, as of commit a4da06a5.
2017-06-12Remove upgrade-related codeAnders Svensson
This and subsequent commits are destined for OTP 20.0.
2017-06-12Don't create intermediate binaries unnecessarily during encodeAnders Svensson
Dict:avp(encode, Value, Name) no longer needs to return a binary, only an iolist(). Message encode runs list_to_binary/1 to convert accumulated lists into a message binary.
2017-06-12Replace slow binary comprehensionsAnders Svensson
Which appears to be about an order of magnitude slower than just creating a binary of the desired size.
2017-06-12Add {init,end}_per_suite/1 to codec suiteAnders Svensson
Do nothing, but convenient for adding trace.
2017-06-12Remove client/server string decode from traffic suiteAnders Svensson
Decode on both ends or not, since the choice doesn't affect the peer.
2017-06-12Add diameter_sctp option packetAnders Svensson
To determine the wrapping of messages passed to recv callbacks and into diameter. The default passing of the input stream in transport_data is probably of no practical use, but has been set since time immemorial.
2017-06-12Add diameter_sctp send/recv callbacksAnders Svensson
Corresponding to diameter_tcp callbacks a few commits back. Exercise the callbacks in the traffic suite.
2017-06-12Randomly select traffic testcasesAnders Svensson
Since the number of configuration variants tested makes for (too) many. Randomly select a subset of testcases in each configuration group.
2017-06-12Exercise diameter_tcp message callbacks in traffic suiteAnders Svensson
2017-06-12Exercise diameter_{tcp,sctp} sender in traffic suiteAnders Svensson
2017-06-12Add diameter_tcp send/recv callbacksAnders Svensson
From the receiver process, that can return binaries to send/receive and stop the transport process from reading on the socket. This is still undocumented, and may change.
2017-06-11Use binary:copy/2 when generating largish data in test suitesAnders Svensson
Faster than lists:duplicate/2.