aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2014-12-31 11:29:13 +0100
committerAnders Svensson <[email protected]>2015-02-25 17:00:13 +0100
commit3ecaab1ab162cd07dc245d0981454feb1b72265f (patch)
tree59ffc224b31b209f728c06271d6951c1f0f064fe /lib/diameter/test
parentaf87b1c3d4897840d8247589a88d3611106ecedc (diff)
downloadotp-3ecaab1ab162cd07dc245d0981454feb1b72265f.tar.gz
otp-3ecaab1ab162cd07dc245d0981454feb1b72265f.tar.bz2
otp-3ecaab1ab162cd07dc245d0981454feb1b72265f.zip
Don't discard outgoing answers with Result-Code/E-bit errors
Outgoing answers missing a Result-Code AVP or setting an E-bit inappropriately were discarded, but there's no particular reason for doing so if the answer can be encoded, and the sender has no way of knowing that their answer has been discarded. It's also inappropriate that the message be discarded in the relay case. Answers are now sent, and an error counter incremented.
Diffstat (limited to 'lib/diameter/test')
-rw-r--r--lib/diameter/test/diameter_traffic_SUITE.erl11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl
index 4b67372016..92c81d2d18 100644
--- a/lib/diameter/test/diameter_traffic_SUITE.erl
+++ b/lib/diameter/test/diameter_traffic_SUITE.erl
@@ -414,12 +414,13 @@ send_eval(Config) ->
= call(Config, Req).
%% Send an accounting ACR that the server tries to answer with an
-%% inappropriate header, resulting in no answer being sent and the
-%% request timing out.
+%% inappropriate header. That the error is detected is coded in
+%% handle_answer.
send_bad_answer(Config) ->
Req = ['ACR', {'Accounting-Record-Type', ?EVENT_RECORD},
{'Accounting-Record-Number', 2}],
- {timeout, _} = call(Config, Req).
+ ?answer_message(?SUCCESS)
+ = call(Config, Req).
%% Send an ACR that the server callback answers explicitly with a
%% protocol error.
@@ -1057,6 +1058,10 @@ answer(Pkt, Req, _Peer, Name, #group{client_dict0 = Dict0}) ->
[R | Vs] = Dict:'#get-'(answer(Ans, Es, Name)),
[Dict:rec2msg(R) | Vs].
+answer(Rec, Es, send_bad_answer) ->
+ [{5004, #diameter_avp{name = 'Result-Code'}} | _] = Es,
+ Rec;
+
answer(Rec, [_|_], N)
when N == send_long_avp_length;
N == send_short_avp_length;