diff options
author | Anders Svensson <[email protected]> | 2017-09-04 11:26:39 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2017-09-04 15:45:36 +0200 |
commit | c207bcd1cd9633a982d0dfa4a5a8d4569f7c3eac (patch) | |
tree | 51d9d37f5cc848ace5ced39d7096525e3e8a3c0d | |
parent | 9aa6c4899cbc27805fd5cdfeea3fb2c97f61cb09 (diff) | |
download | otp-c207bcd1cd9633a982d0dfa4a5a8d4569f7c3eac.tar.gz otp-c207bcd1cd9633a982d0dfa4a5a8d4569f7c3eac.tar.bz2 otp-c207bcd1cd9633a982d0dfa4a5a8d4569f7c3eac.zip |
Exercise answer-message/AVP decode in traffic suite
In particular, that arbitrary application AVPs are decoded in an answer
setting the E-bit.
-rw-r--r-- | lib/diameter/test/diameter_traffic_SUITE.erl | 55 |
1 files changed, 41 insertions, 14 deletions
diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl index fdd1bde1a8..f3c2af07e6 100644 --- a/lib/diameter/test/diameter_traffic_SUITE.erl +++ b/lib/diameter/test/diameter_traffic_SUITE.erl @@ -674,29 +674,54 @@ send_protocol_error(Config) -> if D == nas4005 -> error = maps:find('Failed-AVP', Avps), - #{'AVP' := [#diameter_avp{name = 'Failed-AVP', - value = #{'AVP' := [_,NP]}}]} + #{'AVP' := [_,Failed]} = Avps, - #diameter_avp{name = 'NAS-Port', value = 44} - = NP; - + #diameter_avp{name = 'Failed-AVP', + value = #{'AVP' := [NP,FR,AP]}} + = Failed, + #diameter_avp{name = 'NAS-Port', + value = 44} + = NP, + #diameter_avp{name = 'Firmware-Revision', + value = 12} + = FR, + #diameter_avp{name = 'Auth-Grace-Period', + value = 13} + = AP; + D == diameter_gen_base_rfc3588; D == diameter_gen_basr_accounting -> error = maps:find('Failed-AVP', Avps), - #{'AVP' := [#diameter_avp{name = 'Failed-AVP', - value = #{'AVP' := [_,NP]}}]} + #{'AVP' := [_,Failed]} = Avps, - #diameter_avp{name = undefined, value = undefined} - = NP; + + #diameter_avp{name = 'Failed-AVP', + value = #{'AVP' := [NP,FR,AP]}} + = Failed, + #diameter_avp{name = undefined, + value = undefined} + = NP, + #diameter_avp{name = 'Firmware-Revision', + value = 12} + = FR, + #diameter_avp{name = 'Auth-Grace-Period', + value = 13} + = AP; D == diameter_gen_base_rfc6733; D == diameter_gen_acct_rfc6733 -> - error = maps:find('AVP', Avps), - #{'Failed-AVP' := [#{'AVP' := [NP]}], + #{'Failed-AVP' := [#{'AVP' := [NP,FR,AP]}], 'AVP' := [_]} = Avps, - #diameter_avp{name = undefined, value = undefined} - = NP + #diameter_avp{name = undefined, + value = undefined} + = NP, + #diameter_avp{name = 'Firmware-Revision', + value = 12} + = FR, + #diameter_avp{name = 'Auth-Grace-Period', + value = 13} + = AP end. %% Send a 3xxx Experimental-Result in an answer not setting the E-bit @@ -1763,9 +1788,11 @@ request(['ACR' | #{'Accounting-Record-Number' := 4}], %% that application. Encode as 'AVP' since RFC 3588 doesn't list %% Failed-AVP in the answer-message grammar while RFC 6733 does. NP = #diameter_avp{data = {nas4005, 'NAS-Port', 44}}, + FR = #diameter_avp{name = 'Firmware-Revision', value = 12}, %% M=0 + AP = #diameter_avp{name = 'Auth-Grace-Period', value = 13}, %% M=1 Failed = #diameter_avp{data = {diameter_gen_base_rfc3588, 'Failed-AVP', - [{'AVP', [NP]}]}}, + [{'AVP', [NP,FR,AP]}]}}, Ans = ['answer-message', {'Result-Code', ?TOO_BUSY}, {'Origin-Host', OH}, {'Origin-Realm', OR}, |