aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test
AgeCommit message (Collapse)Author
2013-07-31Merge branch 'maint'Anders Svensson
2013-07-30Simplify Address encode/decodeAnders Svensson
By using binary comprehensions. Add string-valued addresses to codec suite.
2013-07-30Fix UTF8String encodeAnders Svensson
To accept any nested list of codepoints and binaries. A list containing a binary was previously misinterpreted and the documentation was incomplete. Also, rework codec suite slightly to be able to specify values for which decode o encode is the identity map, for which encode should succeed, and for which encode should fail.
2013-07-23Merge branch 'maint'Anders Svensson
2013-07-12Comment tweaksAnders Svensson
2013-06-14Merge branch 'maint'Anders Svensson
2013-06-13Fix list-valued Vendor-Specific-Application-Id configAnders Svensson
Commit f0a36c79 broke the handling of such configuration, resulting in a function clause error in diameter_capx if the list was not of length 3, and faulty extraction of application id's otherwise. Only record-valued config was properly interpreted.
2013-06-11Merge branch 'maint'Anders Svensson
2013-06-11Merge branch 'anders/diameter/release/R16B01/OTP-11120' into maintAnders Svensson
* anders/diameter/release/R16B01/OTP-11120: vsn -> 1.4.2 Update appup for R16B01 Trailing whitespace and copyright fixes Minor macro simplification Move app/appsrc from src/base into src
2013-06-11Merge branch 'anders/diameter/request_spawn/OTP-11060' into maintAnders Svensson
* anders/diameter/request_spawn/OTP-11060: Make spawn options for request processes configurable
2013-06-10Make spawn options for request processes configurableAnders Svensson
That is, for the process that's spawned for each incoming Diameter request message.
2013-06-10Let diameter_{tcp,sctp} be configured with permissible remote addressesAnders Svensson
Option 'accept' allows remote addresses to be configured as tuples or regular expressions. The remote addresses for any incoming (aka accepted) connection/association are matched against the configured values, any non-matching address causing the connection/association to be aborted.
2013-06-10Trailing whitespace and copyright fixesAnders Svensson
2013-06-02Merge branch 'maint'Anders Svensson
2013-06-02Fix setting of Failed-AVP on {answer_message, 5xxx} from handle_requestAnders Svensson
RFC 6733 says that certain 5xxx result codes must be accompanied by Failed-AVP, and decode populates #diameter_packet.errors with Result-Code/AVP pairs for errors it detects. However, Failed-AVP was not set in the outgoing answer if the handle_request callback returned {answer_message, 5xxx}. It is now set with the AVP from the first pair with the specified Result-Code, if found. Note that {answer_message, 5xxx} doesn't handle all cases in which a 5xxx answer is required, only that in which the setting above is appropriate. If it isn't then handle_request should construct its answer and return {reply, Ans}.
2013-05-29Merge branch 'maint'Anders Svensson
2013-05-29Merge branch 'anders/diameter/missed_5001/OTP-11087' into maintAnders Svensson
* anders/diameter/missed_5001/OTP-11087: Remove redundant integer type specifiers from binaries Fix recognition of 5001 on mandatory AVP's
2013-05-29Merge branch 'anders/diameter/avp_decode/OTP-11007' into maintAnders Svensson
* anders/diameter/avp_decode/OTP-11007: Detect all 5005 (MISSING_AVP) errors and don't reverse errors Adapt Failed-AVP setting to RFC 6733 Add spec to diameter_codec Add spec to diameter_gen Fix recognition of 5014 (INVALID_AVP_LENGTH) errors Ensure setting Failed-AVP is appropriate Correct AVP Length error testcases
2013-05-29Merge branch 'anders/diameter/avp_length_failure/OTP-11026' into maintAnders Svensson
* anders/diameter/avp_length_failure/OTP-11026: Fix decode failure when AVP Length < 8
2013-05-29Remove redundant integer type specifiers from binariesAnders Svensson
2013-05-29Fix recognition of 5001 on mandatory AVP'sAnders Svensson
An AVP setting the M-bit was not regarded as erroneous if it was defined in the dictionary in question and its container (message or Grouped AVP) had an 'AVP' field. It's now regarded as a 5001 error (AVP_UNSUPPORTED), as in the case that the AVP is not defined.
2013-05-29Merge branch 'maint'Anders Svensson
2013-05-17Detect all 5005 (MISSING_AVP) errors and don't reverse errorsAnders Svensson
The previous commit ensures that only one will be reported in an answer message when diameter itself sets Result-Code/Failed-AVP. The order of errors in #diameter_packet.errors is that in which they're detected, not the reverse as previously.
2013-05-17Fix recognition of 5014 (INVALID_AVP_LENGTH) errorsAnders Svensson
Invalid lengths come in two flavours: ones that correctly point at the end of an AVP's payload but don't agree with its type, and ones that point elsewhere. The former are relatively harmless but the latter leave no way to recover AVP boundaries, which typically results in failure to decode subsequent AVP's in the message in question. In the case that AVP Length points past the end of the message, diameter incorrectly regarded the error as 5009, INVALID_AVP_BITS: not right since the error has nothing to do with AVP Flags. Ditto if the length was less than 8, a minimal header length. Only in the remaining case was the detected error 5014, INVALID_AVP_LENGTH. However, in this case it slavishly followed RFC 3588 in suggesting the undecodable AVP as Failed-AVP, thereby passing the woeful payload back to the sender to have equal difficulty decoding. Now follow RFC 6733 and suggest an AVP with a zero-filled payload.
2013-05-02Correct AVP Length error testcasesAnders Svensson
To return what RFC 6733 says. 3588 says less so follow 6733, even though the extra specification of 6733 means that it isn't strictly backwards compatible. In particular, 6733 says to send a zero'd payload or none at all while 3588 says to send the offending AVP, despite the fact that the peer will likely have equal difficulty in decoding it. The testcases now fail, which will be remedied in subsequent commits.
2013-04-23Add examples testcase to help identify timetrap failuresAnders Svensson
There are still enslave/1 failures on some hosts despite a 2 minute timetrap.
2013-04-22Fix decode failure when AVP Length < 8Anders Svensson
Such a length caused decode of a message with valid (24-bit) length to fail. Note that the error detected is wrong: it should be 5014 (INVALID_AVP_LENGTH), not 3009 (INVALID_AVP_BITS). This will be dealt with by OTP-11007.
2013-04-19Remove the "coding: utf-8" comment from all Erlang source filesHans Bolinder
2013-04-15Minor traffic suite fixAnders Svensson
Point was to test that Session-Id was not undefined. Instead, test case send_error just returned false.
2013-04-15Add gen_tcp suiteAnders Svensson
This is initially to identify the source of some flakiness on Windows.
2013-04-15Lighten up on suite timetrapsAnders Svensson
Due to sporadic timeouts one some (slow) hosts.
2013-04-12Add more information to traffic suite timeout failuresAnders Svensson
In particular, have the resulting badmatch contain the starting and ending time. There are still sporadic failures on slow hosts.
2013-04-12Merge branch 'anders/diameter/watchdog_leak/OTP-11019' into maintAnders Svensson
* anders/diameter/watchdog_leak/OTP-11019: Minor doc fix Add testcase to exercise reconnect behaviour Fix watchdog table leak
2013-04-11Add testcase to exercise reconnect behaviourAnders Svensson
2013-04-11Comment fixAnders Svensson
2013-04-11More robust listening port lookup in test suitesAnders Svensson
In particular, remove timing dependence by using diameter_reg:wait/1 to wait on the term registered by diameter_{tcp,sctp} when opening a listening socket.
2013-04-06Fix handling of unknown options to diameter:start_service/2Anders Svensson
{error, Reason} is now returned, instead of the options being ignored. Note that diameter:add_transport/2 purposely ignores unknown options and that the behaviour is documented. This is historic: some users depend on it in order to store their own options for identifying transport config, instead of using the reference returned by add_transport.
2013-03-27Merge branch 'anders/diameter/app_not_configured/OTP-10972' into maintAnders Svensson
* anders/diameter/app_not_configured/OTP-10972: Fix faulty sequence validation Add config suite Deal with config errors detected at transport start less brutally Move most transport_opt() validation into diameter_config Minor doc/spec fix Minor diameter_lib cleanup
2013-03-26Add config suiteAnders Svensson
To verify return values from diameter:start_service/2 and diameter:add_transport/2 when passing various config.
2013-03-25Minor diameter_lib cleanupAnders Svensson
Remove unused functions, add dialyzer specs, make wait/1 less fallible.
2013-03-24Compile example dictionaries against both RFC 3588 and 6733Anders Svensson
2013-03-24Compile example dicts from the repo when running locallyAnders Svensson
Instead of from the installation.
2013-03-24Move example dict compilation to examples suiteAnders Svensson
From compiler suite.
2013-03-24Add examples suite for testing example codeAnders Svensson
That is, code installed under examples/code in an installation.
2013-03-24Minor tweaks and fixesAnders Svensson
Fix a broken include in example code, remove an inappropriate ct:pal/2 outside of a testcase, echo more info from test/Makefile.
2013-03-19Merge branch 'maint-r16' into maintAnders Svensson
2013-03-19Minor capx suite fixAnders Svensson
2013-03-18Deal with RFC 6733 change to Vendor-Specific-Application-IdAnders Svensson
RFC 6733 has changed the arity of Vendor-Id in this Grouped AVP, from 1* in RFC 3588 to 1 in RFC 6773. This impacts the generated dictionary modules: Vendor-Id is expected to be list-valued in the 3588 dictionary, integer-valued in the 6733 dictionary. This, in turn, breaks the independence of capabilities configuration on a service or transport from the dictionary that will be used to encode an outgoing CER or CEA. This commit fixes this by massaging any Vendor-Specific-Application-Id config as appropriate when constructing CER or CEA for a given dictionary.
2013-03-17Specify timeouts to ct_slave:start/2Anders Svensson
2013-03-17More flexible distribution configAnders Svensson
Allow both share_peers and use_shared_peers to be a list of nodes, or a function that returns a list of nodes.