aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_traffic_SUITE.erl
AgeCommit message (Collapse)Author
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-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-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-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-13Remove trailing whitespaceAnders Svensson
2017-06-12Remove obsolete traffic testcaseAnders Svensson
Outgoing requests no longer write to the request table, as of commit a4da06a5.
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-11Use binary:copy/2 when generating largish data in test suitesAnders Svensson
Faster than lists:duplicate/2.
2017-06-11Make skipped SCTP testcases more visible in traffic suiteAnders Svensson
By explicitly skipping instead of omitting testcases from groups.
2017-06-11Make traffic suite fail less brutallyAnders Svensson
Autoskip traffic testcases if transport isn't established instead of having traffic cases run and fail.
2017-06-11Remove superfluous traffic testcaseAnders Svensson
Testcase is already run elsewhere on the suite.
2016-08-26Don't run traffic tests in parallel when {string_decode, true}Anders Svensson
Since the large strings copied between processes cause testcases to fail randomly. Option string_decode was added in commit 1590920c.
2016-05-30Fix leaking transports in traffic/relay suitesAnders Svensson
Listening transports weren't removed, which diameter_reg:subs/0 revealed.
2016-03-15update copyright-yearHenrik Nord
2016-01-27Merge branch 'maint-17' into maintAnders Svensson
2015-12-21Make peer handling more efficientAnders Svensson
Each service process maintains a dictionary of peers, mapping an application alias to a {pid(), #diameter_caps{}} list of connected peers. These lists are potentially large, peers were appended to the end of the list for no particular reason, and these long lists were constructed/deconstructed when filtering them for pick_peer callbacks. Many simultaneous outgoing request could then slow the VM to a crawl, with many scheduled processes mired in list manipulation. The pseudo-dicts are now replaced by plain ets tables. The reason for them was (once upon a time) to have an interface interchangeable with a plain dict for debugging purposes, but strict swapablity hasn't been the case for some time now, and in practice a swap has never taken place. Additional tables mapping Origin-Host/Realm have also been introduced, to minimize the size of the peers lists when peers are filtered on host/realm. For example, a filter like {any, [{all, [realm, host]}, realm]} is probably a very common case: preferring a Destination-Realm/Host match before falling back on Destination-Realm alone. This is now more efficiently (but not equivalently) expressed as {first, [{all, [realm, host]}, realm]} to stop the search when the best match is made, and extracts peers from host/realm tables instead of searching through the list of all peers supporting the application in question. The code to try and start with a lookup isn't exhaustive, and the 'any' filter is still as inefficient as previously.
2015-08-13Merge branch 'anders/diameter/17/time/OTP-12926' into maint-17Erlang/OTP
* anders/diameter/17/time/OTP-12926: Simplify time manipulation Remove use of monotonic time in pre-18 code Remove unnecessary redefinition of erlang:max/2
2015-08-05Simplify time manipulationAnders Svensson
By doing away with more wrapping that the parent commit started to remove.
2015-06-22Merge branch 'bruce/change-license'Bruce Yinhe
OTP-12845 * bruce/change-license: fix errors caused by changed line numbers Change license text to APLv2
2015-06-22Merge branch 'anders/diameter/sctp/OTP-12768'Anders Svensson
* anders/diameter/sctp/OTP-12768: Fix connection timeouts in test transports Fix start order of alternate transports Log discarded answers Ensure accepting processes are first in, first out Remove upgrade-related code Be less parallel in traffic suite Increase send/receive buffers for testsuite SCTP listeners Decrease unnecessarily long testsuite timetraps Simplify accepting transport start Simplify peeloff signaling Simplify socket close at terminate Don't monitor listener after peeloff Don't receive initial messages out of order Remove assumption that SCTP association ids will be unique
2015-06-19Be less parallel in traffic suiteAnders Svensson
At the current count, there are 128 groups run in parallel, each of which runs 52 testcases in parallel. That makes for 128*52 = 6656 testcases, which is probably also a factor in the sporadic failures addressed by the parent commit. Don't run the 128 groups in parallel.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-18Fix decode of Grouped AVPs containing errorsAnders Svensson
RFC 6733 says this of Failed-AVP in 7.5: In the case where the offending AVP is embedded within a Grouped AVP, the Failed-AVP MAY contain the grouped AVP, which in turn contains the single offending AVP. The same method MAY be employed if the grouped AVP itself is embedded in yet another grouped AVP and so on. In this case, the Failed-AVP MAY contain the grouped AVP hierarchy up to the single offending AVP. This enables the recipient to detect the location of the offending AVP when embedded in a group. It says this of DIAMETER_INVALID_AVP_LENGTH in 7.1.5: The request contained an AVP with an invalid length. A Diameter message indicating this error MUST include the offending AVPs within a Failed-AVP AVP. In cases where the erroneous AVP length value exceeds the message length or is less than the minimum AVP header length, it is sufficient to include the offending AVP header and a zero filled payload of the minimum required length for the payloads data type. If the AVP is a Grouped AVP, the Grouped AVP header with an empty payload would be sufficient to indicate the offending AVP. In the case where the offending AVP header cannot be fully decoded when the AVP length is less than the minimum AVP header length, it is sufficient to include an offending AVP header that is formulated by padding the incomplete AVP header with zero up to the minimum AVP header length. The AVPs placed in the errors field of a diameter_packet record are intended to be appropriate for inclusion in a Failed-AVP, but neither of the above paragraphs has been followed in the Grouped case: the entire faulty AVP (non-faulty components and all) has been included. This made it impossible to identify the actual faulty AVP in all but simple case. This commit adapts the decode to the RFC, and implements the suggested single faulty AVP, nested in as many Grouped containers as required. The best-effort decode of Failed-AVP in answer messages, initially implemented in commit 0f9cdbaf, is also applied.
2015-05-24Run traffic suite over SCTPAnders Svensson
Previously it was only run over TCP. Configure a pool of accepting processes since simultaneous connections are otherwise prone to rejection, as discussed in commit 4b691d8d. Tweak timeouts to more reasonable values.
2015-05-05Fix broken traffic testcaseAnders Svensson
The send_error testcase tested that Session-Id in an answer-message was not undefined, but that's always the case since the AVP has arity 0 or 1. The correct test is that it's a list of length 1, to ensure that diameter has inserted the session id as expected.