summaryrefslogtreecommitdiff
path: root/lib/diameter
Commit message (Collapse)AuthorAgeFilesLines
* Prepare releaseErlang/OTP2023-05-153-2/+52
|
* Update copyright yearErlang/OTP2023-05-151-1/+1
|
* diameter: remove optional call to deprecated fn and update appupKiko Fernandez-Reyes2023-04-251-3/+5
| | | | | | | | | | | `diameter` should not call or rely on the deprecated function `dbg:stop_clear/0`. The main reason is that `dbg:stop_clear/0` is simply an alias to `dbg:stop/0`. Thus, `dbg:stop_clear/0` was marked as deprecated in a previous pull request GH-6903 (commit `861be72c5a1261ee1694ee468540256f6db11e87`), and these are the remains that I forgot to update.
* dbg: deprecates function dbg:stop_clear/1Kiko Fernandez-Reyes2023-04-192-2/+2
| | | | | | | | function `dbg:stop_clear/1` is not documented in the API but was kept for compatibility reasons. in this commit we make a step forward to deprecating its use such that it will be eventually removed. closes GH-6903.
* Revert "Prepare release"Henrik Nord2023-04-123-45/+2
| | | | This reverts commit d4e4511b19f4126d9271a6e3a8fa2eb716da7e85.
* Prepare releaseErlang/OTP2023-04-113-2/+45
|
* Update copyright yearErlang/OTP2023-04-111-1/+1
|
* ssl: Remove double assert and fix test cases to handle client defaults to ↵Ingela Anderton Andin2023-03-271-2/+2
| | | | {verify, verify_peer}
* Revert "Prepare release"Henrik Nord2023-03-223-45/+2
| | | | This reverts commit 1cf126f91eb533783409da95b117207d8c13d9aa.
* Prepare releaseErlang/OTP2023-03-213-2/+45
|
* Update copyright yearErlang/OTP2023-03-212-2/+2
|
* Make add_transport start failure more synchronousRaimo Niskanen2023-02-272-30/+23
| | | | | | | | | | If diameter_service:start_transport/2 fails return a start failure to the diameter_config child start to avoid that the supervisor thinks the child has started and registers it for a brief moment only to get a link message due to the start failure. This may change an `{error,Reason}` to a `Reason` indicating a supervisor child start error.
* Revert "Prepare release"Henrik Nord2023-02-152-35/+1
| | | | This reverts commit 587341d994f91af5b30483ee9434e932e3d7b802.
* Prepare releaseErlang/OTP2023-02-142-1/+35
|
* Update copyright yearErlang/OTP2023-02-149-9/+9
|
* diameter: replace size/1 by xxx_size/1Kiko Fernandez-Reyes2023-02-101-1/+1
| | | | | | | | | | | | | | | | | | The <c>size/1</c> BIF is not optimized by the JIT, and its use can result in worse types for Dialyzer. When one knows that the value being tested must be a tuple, <c>tuple_size/1</c> should always be preferred. When one knows that the value being tested must be a binary, <c>byte_size/1</c> should be preferred. However, <c>byte_size/1</c> also accepts a bitstring (rounding up size to a whole number of bytes), so one must make sure that the call to <c>byte_size/</c> is preceded by a call to <c>is_binary/1</c> to ensure that bitstrings are rejected. Note that the compiler removes redundant calls to <c>is_binary/1</c>, so if one is not sure whether previous code had made sure that the argument is a binary, it does not harm to add an <c>is_binary/1</c> test immediately before the call to <c>byte_size/1</c>.
* diameter: remove duplicate entries in appupKiko Fernandez-Reyes2023-02-091-8/+0
|
* diameter: replace size/1 by xxx_size/1Kiko Fernandez-Reyes2023-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | The <c>size/1</c> BIF is not optimized by the JIT, and its use can result in worse types for Dialyzer. When one knows that the value being tested must be a tuple, <c>tuple_size/1</c> should always be preferred. When one knows that the value being tested must be a binary, <c>byte_size/1</c> should be preferred. However, <c>byte_size/1</c> also accepts a bitstring (rounding up size to a whole number of bytes), so one must make sure that the call to <c>byte_size/</c> is preceded by a call to <c>is_binary/1</c> to ensure that bitstrings are rejected. Note that the compiler removes redundant calls to <c>is_binary/1</c>, so if one is not sure whether previous code had made sure that the argument is a binary, it does not harm to add an <c>is_binary/1</c> test immediately before the call to <c>byte_size/1</c>. This commit also updates the appup file forgotten in PR-6702 and PR-6769.
* diameter: increase appup file; replace size by xxx_sizeKiko Fernandez-Reyes2023-02-081-36/+22
| | | | | | | | | | | | | | | | | | | | The <c>size/1</c> BIF is not optimized by the JIT, and its use can result in worse types for Dialyzer. When one knows that the value being tested must be a tuple, <c>tuple_size/1</c> should always be preferred. When one knows that the value being tested must be a binary, <c>byte_size/1</c> should be preferred. However, <c>byte_size/1</c> also accepts a bitstring (rounding up size to a whole number of bytes), so one must make sure that the call to <c>byte_size/</c> is preceded by a call to <c>is_binary/1</c> to ensure that bitstrings are rejected. Note that the compiler removes redundant calls to <c>is_binary/1</c>, so if one is not sure whether previous code had made sure that the argument is a binary, it does not harm to add an <c>is_binary/1</c> test immediately before the call to <c>byte_size/1</c>. This commit also updates the appup file forgotten in PR-6702 and PR-6769.
* diameter: replace size/1 by xxx_size/1Kiko Fernandez-Reyes2023-02-012-8/+8
| | | | | | | | | | | | | | | | | | The <c>size/1</c> BIF is not optimized by the JIT, and its use can result in worse types for Dialyzer. When one knows that the value being tested must be a tuple, <c>tuple_size/1</c> should always be preferred. When one knows that the value being tested must be a binary, <c>byte_size/1</c> should be preferred. However, <c>byte_size/1</c> also accepts a bitstring (rounding up size to a whole number of bytes), so one must make sure that the call to <c>byte_size/</c> is preceded by a call to <c>is_binary/1</c> to ensure that bitstrings are rejected. Note that the compiler removes redundant calls to <c>is_binary/1</c>, so if one is not sure whether previous code had made sure that the argument is a binary, it does not harm to add an <c>is_binary/1</c> test immediately before the call to <c>byte_size/1</c>.
* diameter: improve codegen changing size/1 by XXX_size/1Kiko Fernandez-Reyes2023-01-246-13/+13
|
* Prepare releaseErlang/OTP2022-09-202-1/+20
|
* [diameter] Appup for version 2.2.7Rickard Green2022-09-191-2/+4
|
* Merge branch 'deterministic-build' of https://github.com/TD5/otp into maintBjörn Gustavsson2022-06-292-3/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | * 'deterministic-build' of https://github.com/TD5/otp: make: Allow OTP to be built deterministically compiler: Make test_lib robust to +deterministic compiler: Make compiler forward +determinsitic flag to epp compiler: Make yecc respect +deterministic compiler: Make leex respect +deterministic compiler: Make asn1ct_gen respect +deterministic compiler: Make EPP respect +deterministic OTP-18165
| * make: Allow OTP to be built deterministicallyTom Davies2022-06-242-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a --enable-deterministic-build to the configure script, which sets ERL_DETERMINISTIC=yes throughout the relevant Makefiles, which then invoke the relevant build stages with the +deterministic option. This addresses absolute paths being included in generated .erl files and compiled .beam files that resulted in builds from different source directories generating different artefacts (which is a component of the issue in erlang#4482). I think it would make sense to make this the default at some stage, but I've put the change behind a flag for now to decouple making deterministic OTP builds possible from making them the default. Having +deterministic set results in compiler options being removed from the module info for modules where this options was used. This may have other implications for users of OTP. For tests themselves, +determinism is not set, since many test cases depend on accessing the test module's compilation options, or other features not available in deterministic mode, in order to configure themselves. For tests of the determinism feature specifically, +deterministic must be explicitly passed to the compiler within the relevant test cases.
* | Prepare releaseErlang/OTP2022-05-172-1/+29
|/
* Revert "Prepare release"Henrik Nord2022-04-132-29/+1
| | | | This reverts commit a2c8df222e6d02fa518d5d6cbbea75a9dd720d30.
* Prepare releaseErlang/OTP2022-04-112-1/+29
|
* Revert "Prepare release"Henrik Nord2022-03-242-29/+1
| | | | This reverts commit 435bc5e68dd45ff6f7992077998930519208e910.
* Prepare releaseErlang/OTP2022-03-232-1/+29
|
* Merge branch 'anders/diameter/test/OTP-16752'Anders Svensson2022-03-186-67/+98
|\ | | | | | | | | * anders/diameter/test/OTP-16752: Ensure testsuites only write to temporary directory
| * Ensure testsuites only write to temporary directoryAnders Svensson2022-03-186-67/+98
| | | | | | | | | | | | The compiler, codec, and examples testsuites wrote to pwd, which common_test changes to its priv_dir, but that isn't ideal without common_test. Write to a created temporary directory in this case.
* | Merge branch 'anders/diameter/test/OTP-16752'Anders Svensson2022-03-188-57/+67
|\ \ | |/ | | | | | | | | | | * anders/diameter/test/OTP-16752: Tweak test/Makefile Fix peer-related testsuite noise Fix minor testsuite blunders
| * Tweak test/MakefileAnders Svensson2022-03-181-11/+11
| | | | | | | | | | | | One target for running suites without common_test (run), one with (ct): ignoring errors is better done on the command line with make -i. Disable crash dumps.
| * Fix peer-related testsuite noiseAnders Svensson2022-03-184-19/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Crashes like the one below after commit 0dad730b were just noise, but caused by the process running peer:start_link/1 exiting with a meaningful reason for the purpose of monitoring. Start from a middleman process to work around it. =ERROR REPORT==== 18-Mar-2022::10:50:22.260471 === ** Generic server <0.139.0> terminating ** Last message in was {'EXIT',<0.135.0>, {#Ref<0.2812022913.2652372994.101846>,[]}} ** When Server state == {peer_state,#{args => ["-pa", "/home/anders/dev/otp/lib/diameter/test", "/home/anders/dev/otp/lib/diameter/test/../ebin", "-setcookie", "zzz"], name => "diametertcpserver"}, diametertcpserver@elxa6vcfsf2, "/home/anders/dev/erlang/94c81bfd/erts-12.2.1/bin/erl", ["-sname","diametertcpserver","-detached", "-noinput","-user","peer","-origin", "g1hkACNkaWFtZXRlcl90ZXN0X19leGFtcGxlc0BlbHhhNnZjZnNmMgAAAIsAAAAAYjQeQw==", "-pa", "/home/anders/dev/otp/lib/diameter/test", "/home/anders/dev/otp/lib/diameter/test/../ebin", "-setcookie","zzz"], undefined,undefined,<<>>,running, {<0.135.0>, #Ref<0.2812022913.2652372994.101857>}, 0,#{}} ** Reason for termination == ** {#Ref<0.2812022913.2652372994.101846>,[]} =CRASH REPORT==== 18-Mar-2022::10:50:22.267130 === crasher: initial call: peer:init/1 pid: <0.139.0> registered_name: [] exception exit: {#Ref<0.2812022913.2652372994.101846>,[]} in function gen_server:decode_msg/9 (gen_server.erl, line 488) ancestors: [<0.135.0>] message_queue_len: 1 messages: [{nodedown,diametertcpserver@elxa6vcfsf2}] links: [] dictionary: [] trap_exit: true status: running heap_size: 6772 stack_size: 28 reductions: 11827 neighbours:
| * Fix minor testsuite blundersAnders Svensson2022-03-186-27/+9
| | | | | | | | | | | | | | | | | | | | | | Don't test that the current version isn't in the appup file since the way version numbers are handled has changed since that test was written, no longer being updated manually. As is, the relup testcase fails after the appup file is updated, until release results in a new version number. Tweak some timeouts after testing on some underpowered hosts. Remove some dead code.
* | Merge branch 'anders/diameter/Address/GH-5463/OTP-17976'Anders Svensson2022-03-172-5/+23
|\ \ | | | | | | | | | | | | | | | * anders/diameter/Address/GH-5463/OTP-17976: Add appup for diameter 2.2.6 Decode/encode Address types other than IP and IP6
| * | Add appup for diameter 2.2.6Anders Svensson2022-03-171-4/+12
| | |
| * | Decode/encode Address types other than IP and IP6Anders Svensson2022-03-171-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 6733 defines the Diameter Address type as follows. 4.3.1. Common Derived AVP Data Formats Address The Address format is derived from the OctetString Basic AVP Format. It is a discriminated union representing, for example, a 32-bit (IPv4) [RFC0791] or 128-bit (IPv6) [RFC4291] address, most significant octet first. The first two octets of the Address AVP represent the AddressType, which contains an Address Family, defined in [IANAADFAM]. The AddressType is used to discriminate the content and format of the remaining octets. IP and IP6 are AddressType 1 and 2 respectively, but there are many more defined in IANAADFAM, here: http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml None of these additional values were decoded/encoded in module diameter_types. All were treated as errors. The definition of other address families is spread across many different documents, not all of which are easily accessible or even identified by IANAADFAM, and the list can change. Given that the current decode has been in place for over 10 years now (ie. this has clearly not been a big problem), only provide a minimal decode of non-IP address families, splitting them into a 2-tuple of unreserved 16-bit family and remaining binary with no family-specific decode. Encode maps the 2-tuples back to binary, and accepts address families 1 and 2 as well. Note that even currently unassigned address families are decoded: only the reserved values (0 and 65535) are treated as errors. Decoding the binary to a 2-tuple at all is debatable since there's hardly anything to gain over simply treating Address like OctetString, with only validation that it contains an unreserved 2-octet AddressType, but choose the tuple for consistency with the IP address decodes. It's still possible to add family-specific decodes in the future with a decode option, similar to the existing {string_decode, boolean()}.
* | | Merge branch 'anders/diameter/test/OTP-16752'Anders Svensson2022-03-1731-1940/+1894
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | | | * anders/diameter/test/OTP-16752: Rework remaining diameter testsuites Rework diameter_{dist,distribution,examples}_SUITE Rework diameter_{traffic,tls,transport}_SUITE Simplify diameter_util Run fewer testcases in diameter_traffic_SUITE Remove is_port guard Skip diameter_gen_sctp_SUITE
| * Rework remaining diameter testsuitesAnders Svensson2022-03-1722-1005/+943
| | | | | | | | | | | | | | | | | | | | | | | | As in the previous two commit: remove common_test as a requirement and make all testcases independent. Add a make target for running any suite without common test; for example, to run all testcases in diameter_dpr_SUITE: make _dpr Similar to the target that runs suites with common_test, just add an underscore prefix.
| * Rework diameter_{dist,distribution,examples}_SUITEAnders Svensson2022-03-173-326/+559
| | | | | | | | | | | | | | | | | | | | | | These were redone somewhat in commit 96d28d7d, but that moved peer start into init_per_suite, whose failure unintuitively results in skipped rather than failed testcases, and that also suffers from the common_test woes mentioned in previous commits. Redo them again to make tests runnable without common_test, as in the parent commit. Also remove the interdependency that existed between the code and traffic testcases in the examples suite.
| * Rework diameter_{traffic,tls,transport}_SUITEAnders Svensson2022-03-173-450/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make them runnable without common_test, by way of run/0, which is convenient for running suites easily from the shell; for example: $ env ERL_CRASH_DUMP_BYTES=0 erl -noinput -pa ebin -pa test -s diameter_traffic_SUITE run -s init stop Just crashing also provides better diagnostics than common_test often provides in the shell; for example: diameter_traffic_SUITE:init_per_group failed Reason: {badmatch,undefined} rand:uniform_s failed on line 334 Reason: {function_clause,[{rand,...},{...}|...]} Having to look in html pages to find details of failures like this isn't ideal. Testcases were also dependent on one another, so one failure could lead to several. Now run everthing that needs to be done in sequence, and different tests within a sequence in parallel. Multiple simultaneous connections in the transport suite are often refused on macOS, so be satisfied with one.
| * Simplify diameter_utilAnders Svensson2022-03-171-58/+95
| | | | | | | | | | | | | | | | | | | | | | map_size/1 has existed since OTP 17.0 and is_map_key/2 since OTP 21.0: use them to simplify some mechanics. Simplify more as well, and add choose/1, tmpdir/0, and mktemp/1; the latter two for running suites that need a temporary directory without common_test. Ensure run/1 doesn't orphan any temporary processes when it returns. runtime_dependencies in the appfile states erts-10.0, which corresponds to OTP 21.0, so there is no new dependency.
| * Run fewer testcases in diameter_traffic_SUITEAnders Svensson2022-03-171-117/+23
| | | | | | | | | | | | | | | | Instead of even trying to run a meaningful subset of all the configuration possibilities, just choose one and simplify the common_test mechanics/workarounds. The test suite is run night after night on many different hosts, so simply choosing a configuration results in coverage over time.
| * Remove is_port guardAnders Svensson2022-03-171-5/+10
| | | | | | | | | | | | | | | | Sockets in gen_tcp have always been ports, but assuming this is abusing the interface since the type is documented as opaque. The assumption no longer holds with the socket backend (eg. -kernel inet_backend socket), so remove the is_port guard in the test functions diameter_tcp:ports/0,1.
| * Skip diameter_gen_sctp_SUITEAnders Svensson2022-03-172-3/+2
| | | | | | | | | | | | | | | | | | | | Testcases in this suite have failed for almost 9 years now. Either there's a reasonable explanation for it or no one is using gen_sctp enough to notice/care, but the failures are just noise in diameter's testing. May only affect the loopback address, which would explain the lack of interest.
* | Merge branch 'maint' into masterHenrik Nord2022-03-103-2/+19
|\ \ | | | | | | | | | | | | | | | | | | * maint: Updated OTP version Prepare release Update copyright year
| * | Prepare releaseErlang/OTP2022-03-092-1/+18
| | |
| * | Update copyright yearErlang/OTP2022-03-091-1/+1
| | |