diff options
Diffstat (limited to 'lib/megaco/test')
-rw-r--r-- | lib/megaco/test/Makefile | 27 | ||||
-rw-r--r-- | lib/megaco/test/megaco_codec_mini_SUITE.erl | 401 | ||||
-rw-r--r-- | lib/megaco/test/megaco_codec_v2_SUITE.erl | 1776 | ||||
-rw-r--r-- | lib/megaco/test/megaco_codec_v3_SUITE.erl | 1921 | ||||
-rw-r--r-- | lib/megaco/test/megaco_config_SUITE.erl | 289 | ||||
-rw-r--r-- | lib/megaco/test/megaco_mess_SUITE.erl | 39 | ||||
-rw-r--r-- | lib/megaco/test/megaco_segment_SUITE.erl | 336 | ||||
-rw-r--r-- | lib/megaco/test/megaco_test_lib.erl | 1006 | ||||
-rw-r--r-- | lib/megaco/test/megaco_test_lib.hrl | 2 | ||||
-rw-r--r-- | lib/megaco/test/megaco_test_megaco_generator.erl | 9 | ||||
-rw-r--r-- | lib/megaco/test/megaco_test_mgc.erl | 44 | ||||
-rw-r--r-- | lib/megaco/test/megaco_test_msg_v3_lib.erl | 33 | ||||
-rw-r--r-- | lib/megaco/test/megaco_trans_SUITE.erl | 66 | ||||
-rw-r--r-- | lib/megaco/test/megaco_udp_SUITE.erl | 239 | ||||
-rw-r--r-- | lib/megaco/test/modules.mk | 27 |
15 files changed, 4227 insertions, 1988 deletions
diff --git a/lib/megaco/test/Makefile b/lib/megaco/test/Makefile index 8a595b88af..2ef820718e 100644 --- a/lib/megaco/test/Makefile +++ b/lib/megaco/test/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1999-2019. All Rights Reserved. +# Copyright Ericsson AB 1999-2020. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -360,31 +360,6 @@ generate_v2: make -s megaco_codec_v2_SUITE generate_text_messages \ $(ESTOP) -display_prev3a: make - $(MERL) $(ARGS) -sname megaco_display_text_msgs_prev3a $(ERL_PATH) \ - -s megaco_codec_prev3a_SUITE display_text_messages \ - $(ESTOP) - -display_prev3b: make - $(MERL) $(ARGS) -sname megaco_display_text_msgs_prev3b $(ERL_PATH) \ - -s megaco_codec_prev3b_SUITE display_text_messages \ - $(ESTOP) - -generate_prev3b: make - $(MERL) $(ARGS) -sname megaco_generate_text_msgs_prev3b $(ERL_PATH) \ - -s megaco_codec_prev3b_SUITE generate_text_messages \ - $(ESTOP) - -display_prev3c: make - $(MERL) $(ARGS) -sname megaco_display_text_msgs_prev3c $(ERL_PATH) \ - -s megaco_codec_prev3c_SUITE display_text_messages \ - $(ESTOP) - -generate_prev3c: make - $(MERL) $(ARGS) -sname megaco_generate_text_msgs_prev3c $(ERL_PATH) \ - -s megaco_codec_prev3c_SUITE generate_text_messages \ - $(ESTOP) - display_v3: make $(MERL) $(ARGS) -sname megaco_display_text_msgs_v3 $(ERL_PATH) \ -s megaco_codec_v3_SUITE display_text_messages \ diff --git a/lib/megaco/test/megaco_codec_mini_SUITE.erl b/lib/megaco/test/megaco_codec_mini_SUITE.erl index 12113aae70..6c7f60db05 100644 --- a/lib/megaco/test/megaco_codec_mini_SUITE.erl +++ b/lib/megaco/test/megaco_codec_mini_SUITE.erl @@ -39,7 +39,32 @@ init_per_testcase/2, end_per_testcase/2, otp7672_msg01/1, - otp7672_msg02/1 + otp7672_msg02/1, + + otp16631_msg01/1, + otp16631_msg02/1, + otp16631_msg03/1, + otp16631_msg04/1, + otp16631_msg05/1, + otp16631_msg06/1, + otp16631_msg11/1, + otp16631_msg12/1, + otp16631_msg13/1, + otp16631_msg14/1, + otp16631_msg15/1, + otp16631_msg16/1, + otp16631_msg21/1, + otp16631_msg22/1, + otp16631_msg23/1, + otp16631_msg24/1, + otp16631_msg25/1, + otp16631_msg26/1, + otp16631_msg31/1, + otp16631_msg32/1, + otp16631_msg33/1, + otp16631_msg34/1, + otp16631_msg35/1, + otp16631_msg36/1 ]). @@ -62,15 +87,51 @@ all() -> groups() -> [ - {tickets, [], tickets_cases()} + {tickets, [], tickets_cases()}, + {otp7672, [], otp7672_cases()}, + {otp16631, [], otp16631_cases()} ]. tickets_cases() -> [ + {group, otp7672}, + {group, otp16631} + ]. + +otp7672_cases() -> + [ otp7672_msg01, otp7672_msg02 ]. +otp16631_cases() -> + [ + otp16631_msg01, + otp16631_msg02, + otp16631_msg03, + otp16631_msg04, + otp16631_msg05, + otp16631_msg06, + otp16631_msg11, + otp16631_msg12, + otp16631_msg13, + otp16631_msg14, + otp16631_msg15, + otp16631_msg16, + otp16631_msg21, + otp16631_msg22, + otp16631_msg23, + otp16631_msg24, + otp16631_msg25, + otp16631_msg26, + otp16631_msg31, + otp16631_msg32, + otp16631_msg33, + otp16631_msg34, + otp16631_msg35, + otp16631_msg36 + ]. + %% @@ -200,6 +261,342 @@ otp7672(Msg) -> end. + +%% -------------------------------------------------------------- +%% + +otp16631_msg01(suite) -> + []; +otp16631_msg01(Config) when is_list(Config) -> + d("otp16631_msg01 -> entry", []), + ok = otp16631( otp16631_msg01() ), + ok. + +otp16631_msg01() -> + otp16631_msg("a"). + + +%% -- + +otp16631_msg02(suite) -> + []; +otp16631_msg02(Config) when is_list(Config) -> + d("otp16631_msg02 -> entry", []), + ok = otp16631( otp16631_msg02() ), + ok. + +otp16631_msg02() -> + otp16631_msg("b"). + + +%% -- + +otp16631_msg03(suite) -> + []; +otp16631_msg03(Config) when is_list(Config) -> + d("otp16631_msg03 -> entry", []), + ok = otp16631( otp16631_msg03() ), + ok. + +otp16631_msg03() -> + otp16631_msg("c"). + + +%% -- + +otp16631_msg04(suite) -> + []; +otp16631_msg04(Config) when is_list(Config) -> + d("otp16631_msg04 -> entry", []), + ok = otp16631( otp16631_msg04() ), + ok. + +otp16631_msg04() -> + otp16631_msg("d"). + + +%% -- + +otp16631_msg05(suite) -> + []; +otp16631_msg05(Config) when is_list(Config) -> + d("otp16631_msg05 -> entry", []), + ok = otp16631( otp16631_msg05() ), + ok. + +otp16631_msg05() -> + otp16631_msg("e"). + + +%% -- + +otp16631_msg06(suite) -> + []; +otp16631_msg06(Config) when is_list(Config) -> + d("otp16631_msg06 -> entry", []), + ok = otp16631( otp16631_msg06() ), + ok. + +otp16631_msg06() -> + otp16631_msg("f"). + + +%% -- + +otp16631_msg11(suite) -> + []; +otp16631_msg11(Config) when is_list(Config) -> + d("otp16631_msg11 -> entry", []), + ok = otp16631( otp16631_msg11() ), + ok. + +otp16631_msg11() -> + otp16631_msg("000a"). + + +%% -- + +otp16631_msg12(suite) -> + []; +otp16631_msg12(Config) when is_list(Config) -> + d("otp16631_msg12 -> entry", []), + ok = otp16631( otp16631_msg12() ), + ok. + +otp16631_msg12() -> + otp16631_msg("000b"). + + +%% -- + +otp16631_msg13(suite) -> + []; +otp16631_msg13(Config) when is_list(Config) -> + d("otp16631_msg13 -> entry", []), + ok = otp16631( otp16631_msg13() ), + ok. + +otp16631_msg13() -> + otp16631_msg("000c"). + + +%% -- + +otp16631_msg14(suite) -> + []; +otp16631_msg14(Config) when is_list(Config) -> + d("otp16631_msg14 -> entry", []), + ok = otp16631( otp16631_msg14() ), + ok. + +otp16631_msg14() -> + otp16631_msg("000d"). + + +%% -- + +otp16631_msg15(suite) -> + []; +otp16631_msg15(Config) when is_list(Config) -> + d("otp16631_msg15 -> entry", []), + ok = otp16631( otp16631_msg15() ), + ok. + +otp16631_msg15() -> + otp16631_msg("000e"). + + +%% -- + +otp16631_msg16(suite) -> + []; +otp16631_msg16(Config) when is_list(Config) -> + d("otp16631_msg16 -> entry", []), + ok = otp16631( otp16631_msg16() ), + ok. + +otp16631_msg16() -> + otp16631_msg("000f"). + + +%% -- + +otp16631_msg21(suite) -> + []; +otp16631_msg21(Config) when is_list(Config) -> + d("otp16631_msg21 -> entry", []), + ok = otp16631( otp16631_msg21() ), + ok. + +otp16631_msg21() -> + otp16631_msg("0a12"). + + +%% -- + +otp16631_msg22(suite) -> + []; +otp16631_msg22(Config) when is_list(Config) -> + d("otp16631_msg22 -> entry", []), + ok = otp16631( otp16631_msg22() ), + ok. + +otp16631_msg22() -> + otp16631_msg("0b12"). + + +%% -- + +otp16631_msg23(suite) -> + []; +otp16631_msg23(Config) when is_list(Config) -> + d("otp16631_msg23 -> entry", []), + ok = otp16631( otp16631_msg23() ), + ok. + +otp16631_msg23() -> + otp16631_msg("0c12"). + + +%% -- + +otp16631_msg24(suite) -> + []; +otp16631_msg24(Config) when is_list(Config) -> + d("otp16631_msg24 -> entry", []), + ok = otp16631( otp16631_msg24() ), + ok. + +otp16631_msg24() -> + otp16631_msg("0d12"). + + +%% -- + +otp16631_msg25(suite) -> + []; +otp16631_msg25(Config) when is_list(Config) -> + d("otp16631_msg25 -> entry", []), + ok = otp16631( otp16631_msg25() ), + ok. + +otp16631_msg25() -> + otp16631_msg("0e12"). + + +%% -- + +otp16631_msg26(suite) -> + []; +otp16631_msg26(Config) when is_list(Config) -> + d("otp16631_msg26 -> entry", []), + ok = otp16631( otp16631_msg26() ), + ok. + +otp16631_msg26() -> + otp16631_msg("0f12"). + + +%% -- + +otp16631_msg31(suite) -> + []; +otp16631_msg31(Config) when is_list(Config) -> + d("otp16631_msg31 -> entry", []), + ok = otp16631( otp16631_msg31() ), + ok. + +otp16631_msg31() -> + otp16631_msg("a123"). + + +%% -- + +otp16631_msg32(suite) -> + []; +otp16631_msg32(Config) when is_list(Config) -> + d("otp16631_msg32 -> entry", []), + ok = otp16631( otp16631_msg32() ), + ok. + +otp16631_msg32() -> + otp16631_msg("b123"). + + +%% -- + +otp16631_msg33(suite) -> + []; +otp16631_msg33(Config) when is_list(Config) -> + d("otp16631_msg33 -> entry", []), + ok = otp16631( otp16631_msg33() ), + ok. + +otp16631_msg33() -> + otp16631_msg("c123"). + + +%% -- + +otp16631_msg34(suite) -> + []; +otp16631_msg34(Config) when is_list(Config) -> + d("otp16631_msg34 -> entry", []), + ok = otp16631( otp16631_msg34() ), + ok. + +otp16631_msg34() -> + otp16631_msg("d123"). + + +%% -- + +otp16631_msg35(suite) -> + []; +otp16631_msg35(Config) when is_list(Config) -> + d("otp16631_msg35 -> entry", []), + ok = otp16631( otp16631_msg35() ), + ok. + +otp16631_msg35() -> + otp16631_msg("e123"). + + +%% -- + +otp16631_msg36(suite) -> + []; +otp16631_msg36(Config) when is_list(Config) -> + d("otp16631_msg36 -> entry", []), + ok = otp16631( otp16631_msg36() ), + ok. + +otp16631_msg36() -> + otp16631_msg("f123"). + + +%% ----- + +otp16631( Msg ) -> + Bin = erlang:list_to_binary(Msg), + try megaco_compact_text_encoder:decode_mini_message([], dynamic, Bin) of + {ok, _} -> + ok; + {error, _} = ERROR -> + ERROR + catch + C:E:S -> + {error, {C, E, S}} + end. + + +otp16631_msg(X) when is_list(X) -> + "!/1 [2409:8050:5005:1243:1011::" ++ X ++ + "] T=2523{C=-{SC=ROOT{SV{MT=RS,RE=901,PF=ETSI_BGF/2,V=3}}}}". + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% p(F, A) -> diff --git a/lib/megaco/test/megaco_codec_v2_SUITE.erl b/lib/megaco/test/megaco_codec_v2_SUITE.erl index 8a381804c3..0a60f36d7c 100644 --- a/lib/megaco/test/megaco_codec_v2_SUITE.erl +++ b/lib/megaco/test/megaco_codec_v2_SUITE.erl @@ -1,8 +1,8 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2003-2019. All Rights Reserved. -%% +%% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at @@ -14,7 +14,7 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% +%% %% %CopyrightEnd% %% @@ -42,76 +42,76 @@ init_per_group/2, end_per_group/2, init_per_testcase/2, end_per_testcase/2, - pretty_test_msgs/1, + pretty_test_msgs/1, + + compact_test_msgs/1, - compact_test_msgs/1, - - flex_pretty_init/1, - flex_pretty_finish/1, + flex_pretty_init/1, + flex_pretty_finish/1, flex_pretty_test_msgs/1, - - flex_compact_init/1, - flex_compact_finish/1, + + flex_compact_init/1, + flex_compact_finish/1, flex_compact_test_msgs/1, - flex_compact_dm_timers1/1, - flex_compact_dm_timers2/1, - flex_compact_dm_timers3/1, - flex_compact_dm_timers4/1, - flex_compact_dm_timers5/1, - flex_compact_dm_timers6/1, - flex_compact_dm_timers7/1, - flex_compact_dm_timers8/1, - + flex_compact_dm_timers1/1, + flex_compact_dm_timers2/1, + flex_compact_dm_timers3/1, + flex_compact_dm_timers4/1, + flex_compact_dm_timers5/1, + flex_compact_dm_timers6/1, + flex_compact_dm_timers7/1, + flex_compact_dm_timers8/1, + bin_test_msgs/1, - ber_test_msgs/1, - + ber_test_msgs/1, + per_test_msgs/1, - + erl_dist_m_test_msgs/1, - compact_otp4011_msg1/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, - compact_otp4013_msg1/1, - compact_otp4085_msg1/1, - compact_otp4085_msg2/1, - compact_otp4280_msg1/1, - compact_otp4299_msg1/1, - compact_otp4299_msg2/1, - compact_otp4359_msg1/1, - compact_otp4920_msg0/1, - compact_otp4920_msg1/1, - compact_otp4920_msg2/1, - compact_otp4920_msg3/1, - compact_otp4920_msg4/1, - compact_otp4920_msg5/1, - compact_otp4920_msg6/1, - compact_otp4920_msg7/1, - compact_otp4920_msg8/1, - compact_otp4920_msg9/1, - compact_otp4920_msg10/1, - compact_otp4920_msg11/1, - compact_otp4920_msg12/1, - compact_otp4920_msg20/1, - compact_otp4920_msg21/1, - compact_otp4920_msg22/1, - compact_otp4920_msg23/1, - compact_otp4920_msg24/1, - compact_otp4920_msg25/1, - compact_otp5186_msg01/1, - compact_otp5186_msg02/1, - compact_otp5186_msg03/1, - compact_otp5186_msg04/1, - compact_otp5186_msg05/1, - compact_otp5186_msg06/1, - compact_otp5290_msg01/1, - compact_otp5290_msg02/1, + compact_otp4013_msg1/1, + compact_otp4085_msg1/1, + compact_otp4085_msg2/1, + compact_otp4280_msg1/1, + compact_otp4299_msg1/1, + compact_otp4299_msg2/1, + compact_otp4359_msg1/1, + compact_otp4920_msg0/1, + compact_otp4920_msg1/1, + compact_otp4920_msg2/1, + compact_otp4920_msg3/1, + compact_otp4920_msg4/1, + compact_otp4920_msg5/1, + compact_otp4920_msg6/1, + compact_otp4920_msg7/1, + compact_otp4920_msg8/1, + compact_otp4920_msg9/1, + compact_otp4920_msg10/1, + compact_otp4920_msg11/1, + compact_otp4920_msg12/1, + compact_otp4920_msg20/1, + compact_otp4920_msg21/1, + compact_otp4920_msg22/1, + compact_otp4920_msg23/1, + compact_otp4920_msg24/1, + compact_otp4920_msg25/1, + compact_otp5186_msg01/1, + compact_otp5186_msg02/1, + compact_otp5186_msg03/1, + compact_otp5186_msg04/1, + compact_otp5186_msg05/1, + compact_otp5186_msg06/1, + compact_otp5290_msg01/1, + compact_otp5290_msg02/1, compact_otp5793_msg01/1, - compact_otp5993_msg01/1, - compact_otp5993_msg02/1, - compact_otp5993_msg03/1, + compact_otp5993_msg01/1, + compact_otp5993_msg02/1, + compact_otp5993_msg03/1, compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, @@ -123,9 +123,33 @@ compact_otp7534_msg01/1, compact_otp7576_msg01/1, compact_otp7671_msg01/1, - - flex_compact_otp7138_msg01/1, - flex_compact_otp7138_msg02/1, + compact_otp16818_msg01/1, + compact_otp16818_msg02/1, + compact_otp16818_msg03/1, + compact_otp16818_msg04/1, + compact_otp16818_msg05/1, + compact_otp16818_msg06/1, + compact_otp16818_msg11/1, + compact_otp16818_msg12/1, + compact_otp16818_msg13/1, + compact_otp16818_msg14/1, + compact_otp16818_msg15/1, + compact_otp16818_msg16/1, + compact_otp16818_msg21/1, + compact_otp16818_msg22/1, + compact_otp16818_msg23/1, + compact_otp16818_msg24/1, + compact_otp16818_msg25/1, + compact_otp16818_msg26/1, + compact_otp16818_msg31/1, + compact_otp16818_msg32/1, + compact_otp16818_msg33/1, + compact_otp16818_msg34/1, + compact_otp16818_msg35/1, + compact_otp16818_msg36/1, + + flex_compact_otp7138_msg01/1, + flex_compact_otp7138_msg02/1, flex_compact_otp7431_msg01/1, flex_compact_otp7431_msg02/1, flex_compact_otp7431_msg03/1, @@ -133,67 +157,67 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - flex_compact_otp7457_msg01/1, - flex_compact_otp7457_msg02/1, - flex_compact_otp7457_msg03/1, + flex_compact_otp7457_msg01/1, + flex_compact_otp7457_msg02/1, + flex_compact_otp7457_msg03/1, flex_compact_otp7534_msg01/1, flex_compact_otp7573_msg01/1, - flex_compact_otp7576_msg01/1, - flex_compact_otp10998_msg01/1, - flex_compact_otp10998_msg02/1, - flex_compact_otp10998_msg03/1, - flex_compact_otp10998_msg04/1, - - pretty_otp4632_msg1/1, - pretty_otp4632_msg2/1, - pretty_otp4632_msg3/1, - pretty_otp4632_msg4/1, - pretty_otp4710_msg1/1, - pretty_otp4710_msg2/1, - pretty_otp4945_msg1/1, - pretty_otp4945_msg2/1, - pretty_otp4945_msg3/1, - pretty_otp4945_msg4/1, - pretty_otp4945_msg5/1, - pretty_otp4945_msg6/1, - pretty_otp4949_msg1/1, - pretty_otp4949_msg2/1, - pretty_otp4949_msg3/1, - pretty_otp5042_msg1/1, - pretty_otp5068_msg1/1, - pretty_otp5085_msg1/1, - pretty_otp5085_msg2/1, - pretty_otp5085_msg3/1, - pretty_otp5085_msg4/1, - pretty_otp5085_msg5/1, - pretty_otp5085_msg6/1, - pretty_otp5085_msg7/1, - pretty_otp5600_msg1/1, - pretty_otp5600_msg2/1, - pretty_otp5601_msg1/1, + flex_compact_otp7576_msg01/1, + flex_compact_otp10998_msg01/1, + flex_compact_otp10998_msg02/1, + flex_compact_otp10998_msg03/1, + flex_compact_otp10998_msg04/1, + + pretty_otp4632_msg1/1, + pretty_otp4632_msg2/1, + pretty_otp4632_msg3/1, + pretty_otp4632_msg4/1, + pretty_otp4710_msg1/1, + pretty_otp4710_msg2/1, + pretty_otp4945_msg1/1, + pretty_otp4945_msg2/1, + pretty_otp4945_msg3/1, + pretty_otp4945_msg4/1, + pretty_otp4945_msg5/1, + pretty_otp4945_msg6/1, + pretty_otp4949_msg1/1, + pretty_otp4949_msg2/1, + pretty_otp4949_msg3/1, + pretty_otp5042_msg1/1, + pretty_otp5068_msg1/1, + pretty_otp5085_msg1/1, + pretty_otp5085_msg2/1, + pretty_otp5085_msg3/1, + pretty_otp5085_msg4/1, + pretty_otp5085_msg5/1, + pretty_otp5085_msg6/1, + pretty_otp5085_msg7/1, + pretty_otp5600_msg1/1, + pretty_otp5600_msg2/1, + pretty_otp5601_msg1/1, pretty_otp5793_msg01/1, - pretty_otp5882_msg01/1, - pretty_otp6490_msg01/1, - pretty_otp6490_msg02/1, - pretty_otp6490_msg03/1, - pretty_otp6490_msg04/1, - pretty_otp6490_msg05/1, - pretty_otp6490_msg06/1, + pretty_otp5882_msg01/1, + pretty_otp6490_msg01/1, + pretty_otp6490_msg02/1, + pretty_otp6490_msg03/1, + pretty_otp6490_msg04/1, + pretty_otp6490_msg05/1, + pretty_otp6490_msg06/1, pretty_otp7249_msg01/1, pretty_otp7671_msg01/1, pretty_otp7671_msg02/1, pretty_otp7671_msg03/1, pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, - - flex_pretty_otp5042_msg1/1, - flex_pretty_otp5085_msg1/1, - flex_pretty_otp5085_msg2/1, - flex_pretty_otp5085_msg3/1, - flex_pretty_otp5085_msg4/1, - flex_pretty_otp5085_msg5/1, - flex_pretty_otp5085_msg6/1, - flex_pretty_otp5085_msg7/1, + + flex_pretty_otp5042_msg1/1, + flex_pretty_otp5085_msg1/1, + flex_pretty_otp5085_msg2/1, + flex_pretty_otp5085_msg3/1, + flex_pretty_otp5085_msg4/1, + flex_pretty_otp5085_msg5/1, + flex_pretty_otp5085_msg6/1, + flex_pretty_otp5085_msg7/1, flex_pretty_otp5600_msg1/1, flex_pretty_otp5600_msg2/1, flex_pretty_otp5601_msg1/1, @@ -205,7 +229,7 @@ flex_pretty_otp7431_msg05/1, flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1 - ]). + ]). -export([display_text_messages/0, generate_text_messages/0]). @@ -215,7 +239,7 @@ profile_decode_compact_text_messages/0, profile_decode_compact_flex_text_messages/0, profile_decode_pretty_text_message/1, - profile_decode_pretty_text_messages/0, + profile_decode_pretty_text_messages/0, profile_decode_pretty_flex_text_messages/0, %% Encode @@ -251,18 +275,18 @@ %% Common Test interface functions %%====================================================================== -suite() -> +suite() -> [{ct_hooks, [ts_install_cth]}]. -all() -> +all() -> [ - {group, text}, - {group, binary}, + {group, text}, + {group, binary}, {group, erl_dist}, {group, tickets} ]. -groups() -> +groups() -> [ {text, [], text_cases()}, {binary, [], binary_cases()}, @@ -271,7 +295,7 @@ groups() -> {compact, [], compact_cases()}, {flex_pretty, [], flex_pretty_cases()}, {flex_compact, [], flex_compact_cases()}, - {bin, [], bin_cases()}, + {bin, [], bin_cases()}, {ber, [], ber_cases()}, {per, [], per_cases()}, {erl_dist_m, [], erl_dist_m_cases()}, @@ -285,16 +309,16 @@ groups() -> text_cases() -> [ - {group, pretty}, + {group, pretty}, {group, flex_pretty}, - {group, compact}, + {group, compact}, {group, flex_compact} ]. binary_cases() -> [ - {group, bin}, - {group, ber}, + {group, bin}, + {group, ber}, {group, per} ]. @@ -313,20 +337,20 @@ compact_cases() -> compact_test_msgs ]. -flex_pretty_cases() -> +flex_pretty_cases() -> [ flex_pretty_test_msgs ]. -flex_compact_cases() -> +flex_compact_cases() -> [ - flex_compact_test_msgs, + flex_compact_test_msgs, flex_compact_dm_timers1, - flex_compact_dm_timers2, + flex_compact_dm_timers2, flex_compact_dm_timers3, - flex_compact_dm_timers4, + flex_compact_dm_timers4, flex_compact_dm_timers5, - flex_compact_dm_timers6, + flex_compact_dm_timers6, flex_compact_dm_timers7, flex_compact_dm_timers8 ]. @@ -353,7 +377,7 @@ erl_dist_m_cases() -> tickets_cases() -> [ - {group, compact_tickets}, + {group, compact_tickets}, {group, pretty_tickets}, {group, flex_compact_tickets}, {group, flex_pretty_tickets} @@ -427,7 +451,32 @@ compact_tickets_cases() -> compact_otp7576_msg01, - compact_otp7671_msg01 + compact_otp7671_msg01, + + compact_otp16818_msg01, + compact_otp16818_msg02, + compact_otp16818_msg03, + compact_otp16818_msg04, + compact_otp16818_msg05, + compact_otp16818_msg06, + compact_otp16818_msg11, + compact_otp16818_msg12, + compact_otp16818_msg13, + compact_otp16818_msg14, + compact_otp16818_msg15, + compact_otp16818_msg16, + compact_otp16818_msg21, + compact_otp16818_msg22, + compact_otp16818_msg23, + compact_otp16818_msg24, + compact_otp16818_msg25, + compact_otp16818_msg26, + compact_otp16818_msg31, + compact_otp16818_msg32, + compact_otp16818_msg33, + compact_otp16818_msg34, + compact_otp16818_msg35, + compact_otp16818_msg36 ]. flex_compact_tickets_cases() -> @@ -436,7 +485,7 @@ flex_compact_tickets_cases() -> flex_compact_otp7138_msg02, flex_compact_otp7431_msg01, flex_compact_otp7431_msg02, - flex_compact_otp7431_msg03, + flex_compact_otp7431_msg03, flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, flex_compact_otp7431_msg06, @@ -470,7 +519,7 @@ pretty_tickets_cases() -> pretty_otp4945_msg4, pretty_otp4945_msg5, pretty_otp4945_msg6, - + pretty_otp4949_msg1, pretty_otp4949_msg2, pretty_otp4949_msg3, @@ -513,25 +562,25 @@ pretty_tickets_cases() -> ]. -flex_pretty_tickets_cases() -> +flex_pretty_tickets_cases() -> [ - flex_pretty_otp5042_msg1, + flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, - flex_pretty_otp5600_msg1, + flex_pretty_otp5600_msg1, flex_pretty_otp5600_msg2, - flex_pretty_otp5601_msg1, + flex_pretty_otp5601_msg1, flex_pretty_otp5793_msg01, - flex_pretty_otp7431_msg01, + flex_pretty_otp7431_msg01, flex_pretty_otp7431_msg02, - flex_pretty_otp7431_msg03, + flex_pretty_otp7431_msg03, flex_pretty_otp7431_msg04, - flex_pretty_otp7431_msg05, + flex_pretty_otp7431_msg05, flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07 ]. @@ -591,29 +640,29 @@ end_per_suite(Config0) when is_list(Config0) -> %% ----- %% -init_per_group(flex_pretty_tickets = Group, Config) -> +init_per_group(flex_pretty_tickets = Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), flex_pretty_init(Config); -init_per_group(flex_compact_tickets = Group, Config) -> +init_per_group(flex_compact_tickets = Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), flex_compact_init(Config); -init_per_group(flex_compact = Group, Config) -> +init_per_group(flex_compact = Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), flex_compact_init(Config); -init_per_group(flex_pretty = Group, Config) -> +init_per_group(flex_pretty = Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), flex_pretty_init(Config); init_per_group(Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), Config. -end_per_group(flex_pretty_tickets = _Group, Config) -> +end_per_group(flex_pretty_tickets = _Group, Config) -> flex_pretty_finish(Config); -end_per_group(flex_compact_tickets = _Group, Config) -> +end_per_group(flex_compact_tickets = _Group, Config) -> flex_compact_finish(Config); -end_per_group(flex_compact = _Group, Config) -> +end_per_group(flex_compact = _Group, Config) -> flex_compact_finish(Config); -end_per_group(flex_pretty = _Group, Config) -> +end_per_group(flex_pretty = _Group, Config) -> flex_pretty_finish(Config); end_per_group(_Group, Config) -> Config. @@ -641,8 +690,8 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% display_text_messages() -> - Msgs = - msgs4() ++ + Msgs = + msgs4() ++ msgs5(), megaco_codec_test_lib:display_text_messages(?VERSION, Msgs). @@ -650,8 +699,8 @@ display_text_messages() -> %% ---- generate_text_messages() -> - Msgs = - msgs4() ++ + Msgs = + msgs4() ++ msgs5(), megaco_codec_test_lib:generate_text_messages(?V2, ?VERSION, ?EC, Msgs). @@ -680,7 +729,7 @@ profile_decode_pretty_text_message(MsgTag) -> profile_decode_text_message(Codec, Config, MsgTag). profile_decode_text_message(Codec, Config, MsgTag) -> - Msgs = msgs4() ++ msgs5(), + Msgs = msgs4() ++ msgs5(), case lists:keysearch(MsgTag, 1, Msgs) of {value, Msg} -> profile_decode_text_messages(Codec, Config, [Msg]); @@ -692,14 +741,14 @@ profile_decode_text_message(Codec, Config, MsgTag) -> %% (catch megaco_codec_v2_test:profile_decode_compact_text_messages()). profile_decode_compact_text_messages() -> Config = [], - Slogan = decode_compact_v2, + Slogan = decode_compact_v2, profile_decode_compact_text_messages(Slogan, Config). %% (catch megaco_codec_v2_test:profile_decode_compact_flex_text_messages()). profile_decode_compact_flex_text_messages() -> Conf = flex_init([]), Config = flex_scanner_conf(Conf), - Slogan = decode_compact_flex_v2, + Slogan = decode_compact_flex_v2, Res = profile_decode_compact_text_messages(Slogan, [Config]), flex_finish(Conf), Res. @@ -711,14 +760,14 @@ profile_decode_compact_text_messages(Slogan, Config) -> %% (catch megaco_codec_v2_test:profile_decode_pretty_text_messages()). profile_decode_pretty_text_messages() -> Config = [], - Slogan = decode_pretty_v2, + Slogan = decode_pretty_v2, profile_decode_pretty_text_messages(Slogan, Config). %% (catch megaco_codec_v2_test:profile_decode_pretty_flex_text_messages()). profile_decode_pretty_flex_text_messages() -> Conf = flex_init([]), Config = flex_scanner_conf(Conf), - Slogan = decode_pretty_flex_v2, + Slogan = decode_pretty_flex_v2, Res = profile_decode_pretty_text_messages(Slogan, [Config]), flex_finish(Conf), Res. @@ -748,18 +797,18 @@ profile_decode_text_messages(Slogan, Codec, Config, Msgs0) -> profile_encode_compact_text_messages() -> Codec = megaco_compact_text_encoder, Config = [], - Slogan = encode_compact_v2, + Slogan = encode_compact_v2, profile_encode_text_messages(Slogan, Codec, Config). %% (catch megaco_codec_v2_test:profile_encode_pretty_text_messages()). profile_encode_pretty_text_messages() -> Codec = megaco_pretty_text_encoder, Config = [], - Slogan = encode_pretty_v2, + Slogan = encode_pretty_v2, profile_encode_text_messages(Slogan, Codec, Config). profile_encode_text_messages(Slogan, Codec, Config) -> - Msgs = msgs4() ++ msgs5(), + Msgs = msgs4() ++ msgs5(), profile_encode_text_messages(Slogan, Codec, Config, Msgs). profile_encode_text_messages(Slogan, Codec, Config, Msgs0) -> @@ -793,7 +842,7 @@ pretty_test_msgs(suite) -> pretty_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), Msgs = msgs1() ++ msgs2() ++ msgs3() ++ msgs4() ++ msgs5(), - %% Msgs = msgs5(), + %% Msgs = msgs5(), DynamicDecode = false, test_msgs(megaco_pretty_text_encoder, DynamicDecode, [], Msgs). @@ -802,10 +851,10 @@ pretty_test_msgs(Config) when is_list(Config) -> flex_pretty_init(Config) -> flex_init(Config). - + flex_pretty_finish(Config) -> flex_finish(Config). - + flex_pretty_test_msgs(suite) -> []; @@ -914,7 +963,7 @@ flex_pretty_otp5600_msg2(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), Conf = flex_scanner_conf(Config), pretty_otp5600(ok, pretty_otp5600_msg2(), [Conf]). - + flex_pretty_otp5601_msg1(suite) -> []; flex_pretty_otp5601_msg1(Config) when is_list(Config) -> @@ -1000,7 +1049,7 @@ otp7431(Expected, Codec, Msg0, Conf) -> case decode_message(Codec, false, Conf, Bin0) of {ok, _Msg1} when Expected =:= ok -> io:format(" decoded", []); - {error, {bad_property_parm, Reason}} when (Expected =:= error) andalso + {error, {bad_property_parm, Reason}} when (Expected =:= error) andalso is_list(Reason) -> io:format("expected result: ~s", [Reason]), ok; @@ -1017,20 +1066,20 @@ flex_pretty_otp7431_msg1() -> Add = A4445 { Media { Stream = 1 { - Local { - v=0 - o=- 2890844526 2890842807 IN IP4 124.124.124.222 - s=- - t= 0 0 - c=IN IP4 124.124.124.222 - m=audio 2222 RTP/AVP 4 - a=ptime:30 - a=recvonly + Local { + v=0 + o=- 2890844526 2890842807 IN IP4 124.124.124.222 + s=- + t= 0 0 + c=IN IP4 124.124.124.222 + m=audio 2222 RTP/AVP 4 + a=ptime:30 + a=recvonly } ; RTP profile for G.723.1 is 4 } } } - } + } }". flex_pretty_otp7431_msg2() -> @@ -1040,19 +1089,19 @@ flex_pretty_otp7431_msg2() -> Add = A4445 { Media { Stream = 1 { - Local { - v=0 - o=- 2890844526 2890842807 IN IP4 124.124.124.222 - s=- - t= 0 0 - c=IN IP4 124.124.124.222 - m=audio 2222 RTP/AVP 4 - a=ptime:30 + Local { + v=0 + o=- 2890844526 2890842807 IN IP4 124.124.124.222 + s=- + t= 0 0 + c=IN IP4 124.124.124.222 + m=audio 2222 RTP/AVP 4 + a=ptime:30 a= } } } } - } + } }". flex_pretty_otp7431_msg3() -> @@ -1062,19 +1111,19 @@ flex_pretty_otp7431_msg3() -> Add = A4445 { Media { Stream = 1 { - Local { - v=0 - o=- 2890844526 2890842807 IN IP4 124.124.124.222 - s=- - t= 0 0 - c=IN IP4 124.124.124.222 - m=audio 2222 RTP/AVP 4 - a=ptime:30 + Local { + v=0 + o=- 2890844526 2890842807 IN IP4 124.124.124.222 + s=- + t= 0 0 + c=IN IP4 124.124.124.222 + m=audio 2222 RTP/AVP 4 + a=ptime:30 a } } } } - } + } }". flex_pretty_otp7431_msg4() -> @@ -1084,19 +1133,19 @@ flex_pretty_otp7431_msg4() -> Add = A4445 { Media { Stream = 1 { - Local { - v=0 - o=- 2890844526 2890842807 IN IP4 124.124.124.222 - s=- - t= 0 0 - c=IN IP4 124.124.124.222 - m=audio 2222 RTP/AVP 4 - a=ptime:30 + Local { + v=0 + o=- 2890844526 2890842807 IN IP4 124.124.124.222 + s=- + t= 0 0 + c=IN IP4 124.124.124.222 + m=audio 2222 RTP/AVP 4 + a=ptime:30 a} } } } - } + } }". flex_pretty_otp7431_msg5() -> @@ -1106,12 +1155,12 @@ flex_pretty_otp7431_msg5() -> Add = A4445 { Media { Stream = 1 { - Local { + Local { v= } } } } - } + } }". flex_pretty_otp7431_msg6() -> @@ -1121,12 +1170,12 @@ flex_pretty_otp7431_msg6() -> Add = A4445 { Media { Stream = 1 { - Local { + Local { v } } } } - } + } }". flex_pretty_otp7431_msg7() -> @@ -1136,12 +1185,12 @@ flex_pretty_otp7431_msg7() -> Add = A4445 { Media { Stream = 1 { - Local { + Local { v} } } } - } + } }". @@ -1164,14 +1213,14 @@ flex_compact_init(Config) -> flex_compact_finish(Config) -> flex_finish(Config). - + flex_compact_test_msgs(suite) -> []; flex_compact_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), Msgs = msgs1() ++ msgs2() ++ msgs3() ++ msgs4(), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), DynamicDecode = true, test_msgs(megaco_compact_text_encoder, DynamicDecode, [Conf], Msgs). @@ -1182,7 +1231,7 @@ flex_compact_dm_timers1(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("1", "2", "3"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers1 -> " @@ -1200,7 +1249,7 @@ flex_compact_dm_timers2(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("02", "03", "04"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers2 -> " @@ -1218,7 +1267,7 @@ flex_compact_dm_timers3(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("1", "02", "31"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers3 -> " @@ -1236,7 +1285,7 @@ flex_compact_dm_timers4(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("10", "21", "99"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers4 -> " @@ -1254,7 +1303,7 @@ flex_compact_dm_timers5(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("99", "23", "11"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers5 -> " @@ -1272,7 +1321,7 @@ flex_compact_dm_timers6(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("77", "09", "1"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers6 -> " @@ -1290,7 +1339,7 @@ flex_compact_dm_timers7(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("77", "09", "1", "99"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers7 -> " @@ -1308,7 +1357,7 @@ flex_compact_dm_timers8(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("01", "09", "01", "02"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), case decode_message(megaco_compact_text_encoder, false, [Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers8 -> " @@ -1349,7 +1398,7 @@ get_dm_timers({transactions, T}) when is_list(T) -> get_dm_timers(Other) -> {error, {invalid_transactions, Other}}. -get_dm_timers1([{transactionRequest,T}|Ts]) +get_dm_timers1([{transactionRequest,T}|Ts]) when is_record(T,'TransactionRequest') -> case get_dm_timers2(T) of {ok, Timers} -> @@ -1429,7 +1478,7 @@ bin_test_msgs(Config) when is_list(Config) -> DynamicDecode = false, test_msgs(megaco_binary_encoder, DynamicDecode, [], Msgs). - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ber_test_msgs(suite) -> @@ -1440,7 +1489,7 @@ ber_test_msgs(Config) when is_list(Config) -> DynamicDecode = false, test_msgs(megaco_ber_encoder, DynamicDecode, [], Msgs). - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% per_test_msgs(suite) -> @@ -1460,7 +1509,7 @@ erl_dist_m_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), Msgs = msgs1() ++ msgs2() ++ msgs3() ++ msgs4(), DynamicDecode = false, - Conf = [megaco_compressed], + Conf = [megaco_compressed], test_msgs(megaco_erl_dist_encoder, DynamicDecode, Conf, Msgs). @@ -1526,11 +1575,11 @@ compact_otp4011(M) -> d("compact_otp4011 -> expected error: " "~n Reason: ~p", [Reason]), case Reason of - {0, megaco_text_parser_v2, - {do_merge_control_streamParms, [A,B]}} + {0, megaco_text_parser_v2, + {do_merge_control_streamParms, [A,B]}} when is_list(A) andalso is_record(B, 'LocalControlDescriptor') -> case lists:keysearch(mode,1,A) of - {value, {mode, Mode}} + {value, {mode, Mode}} when B#'LocalControlDescriptor'.streamMode /= asn1_NOVALUE -> d("compact_otp4011 -> " "expected error [~w]",[Mode]), @@ -1566,20 +1615,20 @@ compact_otp4013_msg1(Config) when is_list(Config) -> {ok, _} -> exit({decoded_erroneous_message,M}); {error, Reason} when is_list(Reason) -> - {value, {reason, no_version_found, _}} = + {value, {reason, no_version_found, _}} = lists:keysearch(reason, 1, Reason), - {value, {token, [{'SafeChars',_,"megcao/2"}|_]}} = + {value, {token, [{'SafeChars',_,"megcao/2"}|_]}} = lists:keysearch(token, 1, Reason), ok; Else -> exit({unexpected_decode_result,Else}) end. - + %% -------------------------------------------------------------- -%% -%% +%% +%% compact_otp4085_msg1(suite) -> []; compact_otp4085_msg1(Config) when is_list(Config) -> @@ -1638,8 +1687,8 @@ compact_otp4085_msg2(Config) when is_list(Config) -> %% This message lack the ending parentesis (}). compact_otp4085_erroneous_msg() -> - M = "!/" - ?VERSION_STR + M = "!/" + ?VERSION_STR " ML T=11223342{C=${A=${M{O{MO=SR,RV=OFF,RG=OFF},L{v=0," "c=ATM NSAP $ ," "a=eecid:$ ," @@ -1648,8 +1697,8 @@ compact_otp4085_erroneous_msg() -> M. %% -------------------------------------------------------------- -%% -%% +%% +%% compact_otp4280_msg1(suite) -> []; compact_otp4280_msg1(Config) when is_list(Config) -> @@ -1659,7 +1708,7 @@ compact_otp4280_msg1(Config) when is_list(Config) -> case decode_message(megaco_compact_text_encoder, false, [], Bin) of {ok, _Msg} -> ok; - {error, Error} when is_list(Error) -> + {error, Error} when is_list(Error) -> t("compact_otp4280_msg1 -> decode failed", []), case lists:keysearch(reason, 1, Error) of {value, {reason,{Line, Module, Reason} = R}} -> @@ -1743,8 +1792,8 @@ compact_otp4299_msg2_init() -> compact_otp4299_msg2_finish(Pid) -> stop_flex_scanner(Pid). - - + + compact_otp4299_msg() -> M = ";KALLE\n" "!/" @@ -1763,8 +1812,8 @@ compact_otp4299_msg() -> %% -------------------------------------------------------------- -%% -%% +%% +%% compact_otp4359_msg1(suite) -> []; compact_otp4359_msg1(Config) when is_list(Config) -> @@ -1792,8 +1841,8 @@ compact_otp4359_msg() -> %% -------------------------------------------------------------- -%% -%% +%% +%% compact_otp4920_msg0(suite) -> []; compact_otp4920_msg0(Config) when is_list(Config) -> @@ -1973,7 +2022,7 @@ compact_otp4920_msg_2(M1, ExpectedReason) -> ExpectedReason -> ok; _ -> - exit({unexpected_decode_error_reason, + exit({unexpected_decode_error_reason, ExpectedReason, Reason}) end; {error, [{reason, {_Mod, Reason}}|_]} -> @@ -1981,7 +2030,7 @@ compact_otp4920_msg_2(M1, ExpectedReason) -> ExpectedReason -> ok; _ -> - exit({unexpected_decode_error_reason, + exit({unexpected_decode_error_reason, ExpectedReason, Reason}) end; Else -> @@ -2191,7 +2240,7 @@ compact_otp5186_msg_2(Msg1, EncodeExpect, DecodeExpect) -> %% -- - + compact_otp5186_msg01() -> "!/2 <mg5>\nP=67111298{C=2699{AV=mg5_ipeph/0x0f0001{}}}". @@ -2331,7 +2380,7 @@ compact_otp5186_msg06() -> compact_otp5186_check_megamsg(M1, M1) -> ok; compact_otp5186_check_megamsg(#'MegacoMessage'{authHeader = AH, - mess = M1}, + mess = M1}, #'MegacoMessage'{authHeader = AH, mess = M2}) -> compact_otp5186_check_mess(M1, M2); @@ -2341,21 +2390,21 @@ compact_otp5186_check_megamsg(#'MegacoMessage'{authHeader = AH1}, compact_otp5186_check_mess(M, M) -> ok; -compact_otp5186_check_mess(#'Message'{version = V, +compact_otp5186_check_mess(#'Message'{version = V, mId = MId, messageBody = B1}, - #'Message'{version = V, + #'Message'{version = V, mId = MId, messageBody = B2}) -> compact_otp5186_check_body(B1, B2); -compact_otp5186_check_mess(#'Message'{version = V, +compact_otp5186_check_mess(#'Message'{version = V, mId = MId1}, - #'Message'{version = V, + #'Message'{version = V, mId = MId2}) -> exit({not_equal, mId, MId1, MId2}); -compact_otp5186_check_mess(#'Message'{version = V1, +compact_otp5186_check_mess(#'Message'{version = V1, mId = MId}, - #'Message'{version = V2, + #'Message'{version = V2, mId = MId}) -> exit({not_equal, version, V1, V2}). @@ -2393,12 +2442,12 @@ compact_otp5186_check_merr(#'ErrorDescriptor'{errorCode = EC1, compact_otp5186_check_transaction(T, T) -> ok; -compact_otp5186_check_transaction({transactionReply, TR1}, +compact_otp5186_check_transaction({transactionReply, TR1}, {transactionReply, TR2}) -> compact_otp5186_check_transRep(TR1, TR2); compact_otp5186_check_transaction(T1, T2) -> exit({unexpected_transactions, T1, T2}). - + compact_otp5186_check_transRep(T, T) -> ok; compact_otp5186_check_transRep(#'TransactionReply'{transactionId = TId, @@ -2413,7 +2462,7 @@ compact_otp5186_check_transRep(T1, T2) -> compact_otp5186_check_transRes(TR, TR) -> ok; -compact_otp5186_check_transRes({actionReplies, AR1}, +compact_otp5186_check_transRes({actionReplies, AR1}, {actionReplies, AR2}) -> compact_otp5186_check_actReps(AR1, AR2); compact_otp5186_check_transRes(TR1, TR2) -> @@ -2455,10 +2504,10 @@ compact_otp5186_check_cmdReps([CR1|CRs1], [CR2|CRs2]) -> compact_otp5186_check_cmdRep(CR, CR) -> ok; -compact_otp5186_check_cmdRep({auditValueReply, AVR1}, +compact_otp5186_check_cmdRep({auditValueReply, AVR1}, {auditValueReply, AVR2}) -> compact_otp5186_check_auditReply(AVR1, AVR2); -compact_otp5186_check_cmdRep({addReply, AVR1}, +compact_otp5186_check_cmdRep({addReply, AVR1}, {addReply, AVR2}) -> compact_otp5186_check_ammsReply(AVR1, AVR2); compact_otp5186_check_cmdRep(CR1, CR2) -> @@ -2466,7 +2515,7 @@ compact_otp5186_check_cmdRep(CR1, CR2) -> compact_otp5186_check_auditReply(AR, AR) -> ok; -compact_otp5186_check_auditReply({auditResult, AR1}, +compact_otp5186_check_auditReply({auditResult, AR1}, {auditResult, AR2}) -> compact_otp5186_check_auditRes(AR1, AR2); compact_otp5186_check_auditReply(AR1, AR2) -> @@ -2526,7 +2575,7 @@ compact_otp5186_check_termAudit([{emptyDescriptors, compact_otp5186_check_termAudit(TAR1, []) -> exit({not_equal, termAudit, TAR1, []}); %% An empty empty descriptor is removed -compact_otp5186_check_termAudit([], +compact_otp5186_check_termAudit([], [{emptyDescriptors, #'AuditDescriptor'{auditToken = asn1_NOVALUE, auditPropertyToken = asn1_NOVALUE}}|TAR2]) -> @@ -2539,7 +2588,7 @@ compact_otp5186_check_termAudit([ARP1|TAR1], [ARP2|TAR2]) -> compact_otp5186_check_auditRetParm(ARP, ARP) -> ok; -compact_otp5186_check_auditRetParm({emptyDescriptors, AD1}, +compact_otp5186_check_auditRetParm({emptyDescriptors, AD1}, {emptyDescriptors, AD2}) -> compact_otp5186_check_auditDesc(AD1, AD2); compact_otp5186_check_auditRetParm(ARP1, ARP2) -> @@ -2677,7 +2726,7 @@ compact_otp5993(Expected, Msg) -> compact_otp5993_msg01() -> MT = h221, T = #megaco_term_id{id = ?A4444}, - TL = [T], + TL = [T], MD = #'MuxDescriptor'{muxType = MT, termList = TL}, compact_otp5993_msg(MD). @@ -2686,14 +2735,14 @@ compact_otp5993_msg02() -> MT = h223, T1 = #megaco_term_id{id = ?A4445}, T2 = #megaco_term_id{id = ?A5556}, - TL = [T1, T2], + TL = [T1, T2], MD = #'MuxDescriptor'{muxType = MT, termList = TL}, compact_otp5993_msg(MD). compact_otp5993_msg(MD) when is_record(MD, 'MuxDescriptor') -> AmmDesc = {muxDescriptor, MD}, - AmmReq = #'AmmRequest'{terminationID = [hd(MD#'MuxDescriptor'.termList)], + AmmReq = #'AmmRequest'{terminationID = [hd(MD#'MuxDescriptor'.termList)], descriptors = [AmmDesc]}, Cmd = {addReq, AmmReq}, CmdReq = #'CommandRequest'{command = Cmd}, @@ -2702,7 +2751,7 @@ compact_otp5993_msg(MD) when is_record(MD, 'MuxDescriptor') -> TransReq = #'TransactionRequest'{transactionId = 3995, actions = [ActReq]}, Trans = {transactionRequest, TransReq}, - Body = {transactions, [Trans]}, + Body = {transactions, [Trans]}, Msg = #'Message'{version = ?VERSION, mId = ?MG1_MID, messageBody = Body}, @@ -2711,15 +2760,15 @@ compact_otp5993_msg(MD) when is_record(MD, 'MuxDescriptor') -> compact_otp5993_msg03() -> T1 = #megaco_term_id{id = ?A4445}, T2 = #megaco_term_id{id = ?A5556}, - TIDs = [T1, T2], - AudRep = {contextAuditResult, TIDs}, - CmdRep = {auditValueReply, AudRep}, + TIDs = [T1, T2], + AudRep = {contextAuditResult, TIDs}, + CmdRep = {auditValueReply, AudRep}, ActRep = #'ActionReply'{contextId = 5993, commandReply = [CmdRep]}, TransRes = {actionReplies, [ActRep]}, TransRep = #'TransactionReply'{transactionId = 3995, transactionResult = TransRes}, - Trans = {transactionReply, TransRep}, + Trans = {transactionReply, TransRep}, Body = {transactions, [Trans]}, Msg = #'Message'{version = ?VERSION, mId = ?MG1_MID, @@ -2835,7 +2884,7 @@ compact_otp7138(EC, BinMsg) -> {error, Reason} end. - + compact_otp7457_msg01(suite) -> []; compact_otp7457_msg01(Config) when is_list(Config) -> @@ -2929,8 +2978,8 @@ compact_otp7576_msg01(Config) when is_list(Config) -> ok. compact_otp7576_msg01() -> - M = "!/" - ?VERSION_STR + M = "!/" + ?VERSION_STR "[130.100.144.37]:2944\nT=10032{C=${tp{*,*,is,st=1},pr=6,a=rtp/2/${m{st=1{o{mo=so,rv=ON},l{ v=0 c=IN IP4 $ @@ -2967,7 +3016,7 @@ compact_otp7576(EC, BinMsg) -> d("compact_otp7138 -> encode successfull but result differ: " "~n ~p", [binary_to_list(BinMsg2)]), case decode_message(Codec, false, EC, BinMsg2) of - {ok, Msg} -> + {ok, Msg} -> d("compact_otp7138 -> " "extra verification decode ok", []), ok; @@ -3017,6 +3066,338 @@ compact_otp7671_msg01() -> pretty_otp7671_msg01(). + +%% -------------------------------------------------------------- +%% +compact_otp16818_msg01(suite) -> + []; +compact_otp16818_msg01(Config) when is_list(Config) -> + d("compact_otp16818_msg01 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg01() ), + ok. + +compact_otp16818_msg01() -> + compact_otp16818_msg("a"). + + +%% -- + +compact_otp16818_msg02(suite) -> + []; +compact_otp16818_msg02(Config) when is_list(Config) -> + d("compact_otp16818_msg02 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg02() ), + ok. + +compact_otp16818_msg02() -> + compact_otp16818_msg("b"). + + +%% -- + +compact_otp16818_msg03(suite) -> + []; +compact_otp16818_msg03(Config) when is_list(Config) -> + d("compact_otp16818_msg03 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg03() ), + ok. + +compact_otp16818_msg03() -> + compact_otp16818_msg("c"). + + +%% -- + +compact_otp16818_msg04(suite) -> + []; +compact_otp16818_msg04(Config) when is_list(Config) -> + d("compact_otp16818_msg04 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg04() ), + ok. + +compact_otp16818_msg04() -> + compact_otp16818_msg("d"). + + +%% -- + +compact_otp16818_msg05(suite) -> + []; +compact_otp16818_msg05(Config) when is_list(Config) -> + d("compact_otp16818_msg05 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg05() ), + ok. + +compact_otp16818_msg05() -> + compact_otp16818_msg("e"). + + +%% -- + +compact_otp16818_msg06(suite) -> + []; +compact_otp16818_msg06(Config) when is_list(Config) -> + d("compact_otp16818_msg06 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg06() ), + ok. + +compact_otp16818_msg06() -> + compact_otp16818_msg("f"). + + +%% -- + +compact_otp16818_msg11(suite) -> + []; +compact_otp16818_msg11(Config) when is_list(Config) -> + d("compact_otp16818_msg11 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg11() ), + ok. + +compact_otp16818_msg11() -> + compact_otp16818_msg("000a"). + + +%% -- + +compact_otp16818_msg12(suite) -> + []; +compact_otp16818_msg12(Config) when is_list(Config) -> + d("compact_otp16818_msg12 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg12() ), + ok. + +compact_otp16818_msg12() -> + compact_otp16818_msg("000b"). + + +%% -- + +compact_otp16818_msg13(suite) -> + []; +compact_otp16818_msg13(Config) when is_list(Config) -> + d("compact_otp16818_msg13 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg13() ), + ok. + +compact_otp16818_msg13() -> + compact_otp16818_msg("000c"). + + +%% -- + +compact_otp16818_msg14(suite) -> + []; +compact_otp16818_msg14(Config) when is_list(Config) -> + d("compact_otp16818_msg14 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg14() ), + ok. + +compact_otp16818_msg14() -> + compact_otp16818_msg("000d"). + + +%% -- + +compact_otp16818_msg15(suite) -> + []; +compact_otp16818_msg15(Config) when is_list(Config) -> + d("compact_otp16818_msg15 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg15() ), + ok. + +compact_otp16818_msg15() -> + compact_otp16818_msg("000e"). + + +%% -- + +compact_otp16818_msg16(suite) -> + []; +compact_otp16818_msg16(Config) when is_list(Config) -> + d("compact_otp16818_msg16 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg16() ), + ok. + +compact_otp16818_msg16() -> + compact_otp16818_msg("000f"). + + +%% -- + +compact_otp16818_msg21(suite) -> + []; +compact_otp16818_msg21(Config) when is_list(Config) -> + d("compact_otp16818_msg21 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg21() ), + ok. + +compact_otp16818_msg21() -> + compact_otp16818_msg("0a12"). + + +%% -- + +compact_otp16818_msg22(suite) -> + []; +compact_otp16818_msg22(Config) when is_list(Config) -> + d("compact_otp16818_msg22 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg22() ), + ok. + +compact_otp16818_msg22() -> + compact_otp16818_msg("0b12"). + + +%% -- + +compact_otp16818_msg23(suite) -> + []; +compact_otp16818_msg23(Config) when is_list(Config) -> + d("compact_otp16818_msg23 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg23() ), + ok. + +compact_otp16818_msg23() -> + compact_otp16818_msg("0c12"). + + +%% -- + +compact_otp16818_msg24(suite) -> + []; +compact_otp16818_msg24(Config) when is_list(Config) -> + d("compact_otp16818_msg24 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg24() ), + ok. + +compact_otp16818_msg24() -> + compact_otp16818_msg("0d12"). + + +%% -- + +compact_otp16818_msg25(suite) -> + []; +compact_otp16818_msg25(Config) when is_list(Config) -> + d("compact_otp16818_msg25 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg25() ), + ok. + +compact_otp16818_msg25() -> + compact_otp16818_msg("0e12"). + + +%% -- + +compact_otp16818_msg26(suite) -> + []; +compact_otp16818_msg26(Config) when is_list(Config) -> + d("compact_otp16818_msg26 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg26() ), + ok. + +compact_otp16818_msg26() -> + compact_otp16818_msg("0f12"). + + +%% -- + +compact_otp16818_msg31(suite) -> + []; +compact_otp16818_msg31(Config) when is_list(Config) -> + d("compact_otp16818_msg31 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg31() ), + ok. + +compact_otp16818_msg31() -> + compact_otp16818_msg("a123"). + + +%% -- + +compact_otp16818_msg32(suite) -> + []; +compact_otp16818_msg32(Config) when is_list(Config) -> + d("compact_otp16818_msg32 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg32() ), + ok. + +compact_otp16818_msg32() -> + compact_otp16818_msg("b123"). + + +%% -- + +compact_otp16818_msg33(suite) -> + []; +compact_otp16818_msg33(Config) when is_list(Config) -> + d("compact_otp16818_msg33 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg33() ), + ok. + +compact_otp16818_msg33() -> + compact_otp16818_msg("c123"). + + +%% -- + +compact_otp16818_msg34(suite) -> + []; +compact_otp16818_msg34(Config) when is_list(Config) -> + d("compact_otp16818_msg34 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg34() ), + ok. + +compact_otp16818_msg34() -> + compact_otp16818_msg("d123"). + + +%% -- + +compact_otp16818_msg35(suite) -> + []; +compact_otp16818_msg35(Config) when is_list(Config) -> + d("compact_otp16818_msg35 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg35() ), + ok. + +compact_otp16818_msg35() -> + compact_otp16818_msg("e123"). + + +%% -- + +compact_otp16818_msg36(suite) -> + []; +compact_otp16818_msg36(Config) when is_list(Config) -> + d("compact_otp16818_msg36 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg36() ), + ok. + +compact_otp16818_msg36() -> + compact_otp16818_msg("f123"). + + +%% ----- + +compact_otp16818( Msg ) -> + Bin = erlang:list_to_binary(Msg), + try megaco_compact_text_encoder:decode_message([], dynamic, Bin) of + {ok, _} -> + ok; + {error, _} = ERROR -> + ERROR + catch + C:E:S -> + {error, {C, E, S}} + end. + +compact_otp16818_msg(X) when is_list(X) -> + "!/2 [2409:8050:5005:1243:1011::" ++ X ++ + "] T=2523{C=-{SC=ROOT{SV{MT=RS,RE=901,PF=ETSI_BGF/2,V=3}}}}". + + %% ============================================================== %% %% F l e x C o m p a c t T e s t c a s e s @@ -3315,173 +3696,173 @@ flex_compact_otp7576_msg01(Config) when is_list(Config) -> flex_compact_otp10998_msg01() -> <<"!/2 stofmg0 P=25165898{C=34227581{AV=r01/03/01/38/22{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227613{AV=r01/03/01/38/12{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227744{AV=r01/03/01/38/11{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227755{AV=r01/03/01/38/2{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227768{AV=r01/03/01/38/14{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227774{AV=r01/03/01/38/15{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227775{AV=r01/03/01/38/16{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323119{AV=r01/03/01/38/9{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323122{AV=r01/03/01/38/7{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323156{AV=r01/03/01/38/8{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323260{AV=r01/03/01/38/13{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323272{AV=r01/03/01/38/30{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323273{AV=r01/03/01/38/29{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323275{AV=r01/03/01/38/25{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323276{AV=r01/03/01/38/28{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323279{AV=r01/03/01/38/26{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323280{AV=r01/03/01/38/24{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323281{AV=r01/03/01/38/27{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323284{AV=r01/03/01/38/23{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34129764{AV=r01/03/01/55/31{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227463{AV=r01/03/01/55/26{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227472{AV=r01/03/01/55/22{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227484{AV=r01/03/01/55/16{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227555{AV=r01/03/01/55/5{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227556{AV=r01/03/01/55/14{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227557{AV=r01/03/01/55/10{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227563{AV=r01/03/01/55/7{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227565{AV=r01/03/01/55/13{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227602{AV=r01/03/01/55/21{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227616{AV=r01/03/01/55/1{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227704{AV=r01/03/01/55/19{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227705{AV=r01/03/01/55/18{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34227715{AV=r01/03/01/55/20{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34322656{AV=r01/03/01/55/30{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34322804{AV=r01/03/01/55/24{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34322812{AV=r01/03/01/55/15{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34322825{AV=r01/03/01/55/4{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34322836{AV=r01/03/01/55/17{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323007{AV=r01/03/01/55/6{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323008{AV=r01/03/01/55/2{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323071{AV=r01/03/01/55/28{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}},C=34323075{AV=r01/03/01/55/29{M{TS{eri_terminfo/dev_state=norm,eri_terminfo/dev_type=cee1,eri_terminfo/law_conv=on,SI=IV},O{MO=SR,RV=OFF,semper/act=on,tdmc/ec=off,semper/termstatus=0x00},L{ -v=0
-c=TN RFC2543 -
-m=audio - TDM -
+v=0 +c=TN RFC2543 - +m=audio - TDM - }}}}}">>. @@ -3990,7 +4371,7 @@ flex_compact_otp10998_msg01(Config) when is_list(Config) -> d("flex_compact_otp10998_msg01 -> entry", []), Msg = flex_compact_otp10998_msg01(), d("flex_compact_otp10998_msg01 -> message created", []), - Conf = + Conf = try flex_scanner_conf(Config) of C -> C @@ -4011,7 +4392,7 @@ flex_compact_otp10998_msg02(Config) when is_list(Config) -> d("flex_compact_otp10998_msg02 -> entry", []), Msg = flex_compact_otp10998_msg02(), d("flex_compact_otp10998_msg02 -> message created", []), - Conf = + Conf = try flex_scanner_conf(Config) of C -> C @@ -4032,7 +4413,7 @@ flex_compact_otp10998_msg03(Config) when is_list(Config) -> d("flex_compact_otp10998_msg03 -> entry", []), Msg = flex_compact_otp10998_msg03(), d("flex_compact_otp10998_msg03 -> message created", []), - Conf = + Conf = try flex_scanner_conf(Config) of C -> C @@ -4053,7 +4434,7 @@ flex_compact_otp10998_msg04(Config) when is_list(Config) -> d("flex_compact_otp10998_msg04 -> entry", []), Msg = flex_compact_otp10998_msg04(), d("flex_compact_otp10998_msg04 -> message created", []), - Conf = + Conf = try flex_scanner_conf(Config) of C -> C @@ -4078,7 +4459,7 @@ flex_compact_otp10998(EC, N, BinMsg) -> "decode ~w failed: ~p", [No, Reason]), throw({error, No, Reason}) end - end, + end, do_flex_compact_otp10998(N, Decode). do_flex_compact_otp10998(N, Decode) when N > 0 -> @@ -4102,7 +4483,7 @@ pretty_otp4632_msg1(Config) when is_list(Config) -> Msg0 = pretty_otp4632_msg1(), case encode_message(megaco_pretty_text_encoder, [], Msg0) of {ok, BinMsg} when is_binary(BinMsg) -> - {ok, Msg1} = decode_message(megaco_pretty_text_encoder, false, + {ok, Msg1} = decode_message(megaco_pretty_text_encoder, false, [], BinMsg), ok = chk_MegacoMessage(Msg0, Msg1); Else -> @@ -4122,7 +4503,7 @@ pretty_otp4632_msg2(Config) when is_list(Config) -> Msg0 = pretty_otp4632_msg2(), case encode_message(megaco_pretty_text_encoder, [], Msg0) of {ok, BinMsg} when is_binary(BinMsg) -> - {ok, Msg1} = decode_message(megaco_pretty_text_encoder, false, + {ok, Msg1} = decode_message(megaco_pretty_text_encoder, false, [], BinMsg), ok = chk_MegacoMessage(Msg0,Msg1); Else -> @@ -4142,7 +4523,7 @@ pretty_otp4632_msg3(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), Msg0 = pretty_otp4632_msg3(), Bin0 = list_to_binary(Msg0), - case decode_message(megaco_pretty_text_encoder, + case decode_message(megaco_pretty_text_encoder, false, [], Bin0) of {ok, Msg} when is_record(Msg, 'MegacoMessage') -> {ok, Bin1} = encode_message(megaco_pretty_text_encoder, [], Msg), @@ -4187,11 +4568,11 @@ pretty_otp4632_msg4() -> pretty_otp4632_msg4_chk([], []) -> - exit(messages_not_eq); + exit(messages_not_eq); pretty_otp4632_msg4_chk([], Rest1) -> - exit({messages_not_eq1, Rest1}); + exit({messages_not_eq1, Rest1}); pretty_otp4632_msg4_chk(Rest0, []) -> - exit({messages_not_eq0, Rest0}); + exit({messages_not_eq0, Rest0}); pretty_otp4632_msg4_chk([$R,$e,$a,$s,$o,$n,$ ,$=,$ ,$9,$0,$1|_Rest0], [$R,$e,$a,$s,$o,$n,$ ,$=,$ ,$",$9,$0,$1,$"|_Rest1]) -> ok; @@ -4207,7 +4588,7 @@ pretty_otp4710_msg1(Config) when is_list(Config) -> Msg0 = pretty_otp4710_msg1(), case encode_message(megaco_pretty_text_encoder, [], Msg0) of {ok, Bin} when is_binary(Bin) -> - {ok, Msg1} = decode_message(megaco_pretty_text_encoder, false, + {ok, Msg1} = decode_message(megaco_pretty_text_encoder, false, [], Bin), ok = chk_MegacoMessage(Msg0,Msg1); Else -> @@ -4294,13 +4675,13 @@ pretty_otp4945_msg1() -> ServiceChange = ROOT { Services { Method = Restart, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". - + pretty_otp4945_msg2(suite) -> []; @@ -4331,14 +4712,14 @@ pretty_otp4945_msg2() -> ServiceChange = ROOT { Services { Reason = 901, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". - + pretty_otp4945_msg3(suite) -> []; pretty_otp4945_msg3(Config) when is_list(Config) -> @@ -4369,14 +4750,14 @@ pretty_otp4945_msg3() -> Context = - { ServiceChange = ROOT { Services { - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". - + pretty_otp4945_msg4(suite) -> []; pretty_otp4945_msg4(Config) when is_list(Config) -> @@ -4400,13 +4781,13 @@ pretty_otp4945_msg4() -> Services { Method = Restart, Reason = 901, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". - + pretty_otp4945_msg5(suite) -> []; @@ -4440,13 +4821,13 @@ pretty_otp4945_msg5() -> Method = Restart, Reason = 901, Profile = ResGW/1, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/2 } } - } + } }". - + pretty_otp4945_msg6(suite) -> []; @@ -4479,14 +4860,14 @@ pretty_otp4945_msg6() -> Services { Method = Restart, Reason = 901, - ServiceChangeAddress = 55555, - MgcIdToTry = kalle, + ServiceChangeAddress = 55555, + MgcIdToTry = kalle, Profile = ResGW/1 } } - } + } }". - + pretty_otp4949_msg1(suite) -> []; @@ -4509,13 +4890,13 @@ pretty_otp4949_msg1() -> Context = - { ServiceChange = ROOT { Services { - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". - + pretty_otp4949_msg2(suite) -> []; @@ -4547,13 +4928,13 @@ pretty_otp4949_msg2() -> ServiceChange = ROOT { Services { Profile = ResGW/1, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/2 } } - } + } }". - + pretty_otp4949_msg3(suite) -> []; @@ -4584,14 +4965,14 @@ pretty_otp4949_msg3() -> Context = - { ServiceChange = ROOT { Services { - ServiceChangeAddress = 55555, - MgcIdToTry = kalle, + ServiceChangeAddress = 55555, + MgcIdToTry = kalle, Profile = ResGW/1 } } - } + } }". - + pretty_otp5042_msg1(suite) -> []; @@ -4619,14 +5000,14 @@ pretty_otp5042_msg1(Config) when is_list(Config) -> pretty_otp5042_msg1() -> "MEGACO/" ?VERSION_STR " <CATAPULT>:2944 -Transaction = 102 { -Context = 5 { Notify = MUX/1 { ObservedEvents = 1 { +Transaction = 102 { +Context = 5 { Notify = MUX/1 { ObservedEvents = 1 { h245bh/h245msgin { Stream = 1 , h245enc = 0270020600088175000653401004100403E802E00180018001780680000034301160000700088175010101007A0100020001800001320000C0000219D005027F0070500100040100021080000319D005027F00504001008000041C001250000700088175010000400280010003000880000518AA027F400006850130008011020100000001030002000300040005000006 - } } + } } } } }". - + pretty_otp5068_msg1(suite) -> []; @@ -4681,7 +5062,7 @@ pretty_otp5068_msg1() -> asn1_NOVALUE, inSvc}, asn1_NOVALUE}}]}}}]}]}}}]}}}. - + pretty_otp5085_msg1(suite) -> @@ -4782,7 +5163,7 @@ pretty_otp5085_msg1() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, {'ErrorDescriptor',504,asn1_NOVALUE}, asn1_NOVALUE, @@ -4809,7 +5190,7 @@ pretty_otp5085_msg2() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, asn1_NOVALUE, asn1_NOVALUE, @@ -4836,7 +5217,7 @@ pretty_otp5085_msg3() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, asn1_NOVALUE, #'ContextRequest'{priority = 3}, @@ -4863,11 +5244,11 @@ pretty_otp5085_msg4() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, asn1_NOVALUE, asn1_NOVALUE, - [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, + [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, {notifyReply, cre_NotifyRep([#megaco_term_id{id = ?A5555}])}] } ] @@ -4891,11 +5272,11 @@ pretty_otp5085_msg5() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, asn1_NOVALUE, #'ContextRequest'{priority = 5}, - [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, + [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, {notifyReply, cre_NotifyRep([#megaco_term_id{id = ?A5555}])}] } ] @@ -4919,11 +5300,11 @@ pretty_otp5085_msg6() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, {'ErrorDescriptor',504,asn1_NOVALUE}, #'ContextRequest'{priority = 6}, - [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, + [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, {notifyReply, cre_NotifyRep([#megaco_term_id{id = ?A5555}])}] } ] @@ -4947,7 +5328,7 @@ pretty_otp5085_msg7() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, {'ErrorDescriptor',504,asn1_NOVALUE}, #'ContextRequest'{priority = 7}, @@ -5023,29 +5404,29 @@ pretty_otp5600(Expected, Msg, Conf) -> pretty_otp5600_msg1() -> SRE = #'SecondRequestedEvent'{ pkgdName = "al/on", evParList = [] }, - + SED = #'SecondEventsDescriptor'{ requestID = 2, eventList = [ SRE ] }, - + SIG = { signal, #'Signal'{ signalName = "cg/dt", sigParList = [] } }, - + RA = #'RequestedActions'{ secondEvent = SED, signalsDescriptor = [ SIG ] }, - + RE = #'RequestedEvent'{ pkgdName = "al/of", eventAction = RA, evParList = [] }, - + EV = #'EventsDescriptor'{ requestID = 1, eventList = [ RE ] }, - + TermID = {megaco_term_id, true, [[$*]] }, - + AMMR = #'AmmRequest'{ terminationID = [ TermID ], descriptors = [ { eventsDescriptor, EV } ] }, - + CR = #'CommandRequest'{command = {modReq, AMMR}}, - + AR = #'ActionRequest'{contextId = ?megaco_null_context_id, commandRequests = [CR]}, ARs = [AR], @@ -5055,12 +5436,12 @@ pretty_otp5600_msg1() -> mId = ?MGC_MID, messageBody = {transactions, TRs}}, #'MegacoMessage'{mess = Mess}. - - + + pretty_otp5600_msg2() -> SIG = { signal, #'Signal'{ signalName = "cg/dt", sigParList = [] } }, - + SRA = #'SecondRequestedActions'{ signalsDescriptor = [ SIG ] }, SRE = #'SecondRequestedEvent'{ pkgdName = "al/on", @@ -5069,22 +5450,22 @@ pretty_otp5600_msg2() -> SED = #'SecondEventsDescriptor'{ requestID = 2, eventList = [ SRE ] }, - + RA = #'RequestedActions'{ secondEvent = SED }, - + RE = #'RequestedEvent'{ pkgdName = "al/of", eventAction = RA, evParList = [] }, - + EV = #'EventsDescriptor'{ requestID = 1, eventList = [ RE ] }, - + TermID = {megaco_term_id, true, [[$*]] }, - + AMMR = #'AmmRequest'{ terminationID = [ TermID ], descriptors = [ { eventsDescriptor, EV } ] }, - + CR = #'CommandRequest'{command = {modReq, AMMR}}, - + AR = #'ActionRequest'{contextId = ?megaco_null_context_id, commandRequests = [CR]}, ARs = [AR], @@ -5094,7 +5475,7 @@ pretty_otp5600_msg2() -> mId = ?MGC_MID, messageBody = {transactions, TRs}}, #'MegacoMessage'{mess = Mess}. - + pretty_otp5601_msg1(suite) -> []; @@ -5238,10 +5619,10 @@ pretty_otp5882_msg01(Config) when is_list(Config) -> %% put(dbg,true), pretty_otp5882(). -pretty_otp5882() -> +pretty_otp5882() -> otp5882(megaco_pretty_text_encoder, []). -otp5882(Codec, Conf) -> +otp5882(Codec, Conf) -> Msg = pretty_otp5882_msg01(), case (catch encode_message(Codec, Conf, Msg)) of {error, {message_encode_failed, {error, {ActualReason, _}}, _}} -> @@ -5256,7 +5637,7 @@ otp5882(Codec, Conf) -> {ok, Bin} -> exit({unexpected_encode_sucess, binary_to_list(Bin)}) end. - + pretty_otp5882_msg01() -> LCD = #'LocalControlDescriptor'{}, % Create illegal LCD Parms = ?MSG_LIB:cre_StreamParms(LCD), @@ -5275,10 +5656,10 @@ pretty_otp5882_msg01() -> Mid = ?MG1_MID, Mess = ?MSG_LIB:cre_Message(?VERSION, Mid, [Trans]), ?MSG_LIB:cre_MegacoMessage(Mess). - + %% -------------------------------------------------------------- -%% +%% pretty_otp6490_msg01(suite) -> []; pretty_otp6490_msg01(Config) when is_list(Config) -> @@ -5290,7 +5671,7 @@ pretty_otp6490_msg01(Config) when is_list(Config) -> %% erase(dbg), %% erase(severity), ok. - + pretty_otp6490_msg02(suite) -> []; pretty_otp6490_msg02(Config) when is_list(Config) -> @@ -5302,7 +5683,7 @@ pretty_otp6490_msg02(Config) when is_list(Config) -> %% erase(severity), %% erase(dbg), ok. - + pretty_otp6490_msg03(suite) -> []; pretty_otp6490_msg03(Config) when is_list(Config) -> @@ -5314,7 +5695,7 @@ pretty_otp6490_msg03(Config) when is_list(Config) -> %% erase(severity), %% erase(dbg), ok. - + pretty_otp6490_msg04(suite) -> []; pretty_otp6490_msg04(Config) when is_list(Config) -> @@ -5326,7 +5707,7 @@ pretty_otp6490_msg04(Config) when is_list(Config) -> %% erase(severity), %% erase(dbg), ok. - + pretty_otp6490_msg05(suite) -> []; pretty_otp6490_msg05(Config) when is_list(Config) -> @@ -5338,7 +5719,7 @@ pretty_otp6490_msg05(Config) when is_list(Config) -> %% erase(severity), %% erase(dbg), ok. - + pretty_otp6490_msg06(suite) -> []; pretty_otp6490_msg06(Config) when is_list(Config) -> @@ -5350,7 +5731,7 @@ pretty_otp6490_msg06(Config) when is_list(Config) -> %% erase(severity), %% erase(dbg), ok. - + pretty_otp6490(Msg, Conf) -> pretty_otp6490(Msg, Conf, ok). @@ -5358,10 +5739,10 @@ pretty_otp6490(Msg, Conf, ExpectedEncode) -> pretty_otp6490(Msg, Conf, ExpectedEncode, ok). pretty_otp6490(Msg, Conf, ExpectedEncode, ExpectedDecode) -> - otp6490(Msg, megaco_pretty_text_encoder, Conf, + otp6490(Msg, megaco_pretty_text_encoder, Conf, ExpectedEncode, ExpectedDecode). -otp6490(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode) -> +otp6490(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode) -> case (catch encode_message(Codec, Conf, Msg)) of {error, _Reason} when ExpectedEncode == error -> ok; @@ -5385,7 +5766,7 @@ otp6490(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode) -> exit({unexpected_decode_failure, Msg, Reason}) end end. - + pretty_otp6490_msg(EBD) -> AmmDesc = ?MSG_LIB:cre_AmmDescriptor(EBD), @@ -5405,16 +5786,16 @@ pretty_otp6490_msg01() -> EvSpecs = [], % This will result in an error EBD = EvSpecs, % This is because the lib checks that the size is valid pretty_otp6490_msg(EBD). - + pretty_otp6490_msg02() -> EvPar = ?MSG_LIB:cre_EventParameter("sune", ["mangs"]), PkgdName = ?MSG_LIB:cre_PkgdName("foo", "a"), EvName = ?MSG_LIB:cre_EventName(PkgdName), EvSpec = ?MSG_LIB:cre_EventSpec(EvName, [EvPar]), - EvSpecs = [EvSpec], + EvSpecs = [EvSpec], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). - + pretty_otp6490_msg03() -> EvPar1 = ?MSG_LIB:cre_EventParameter("sune", ["mangs"]), EvPar2 = ?MSG_LIB:cre_EventParameter("kalle", ["anka"]), @@ -5422,10 +5803,10 @@ pretty_otp6490_msg03() -> PkgdName = ?MSG_LIB:cre_PkgdName("foo", "a"), EvName = ?MSG_LIB:cre_EventName(PkgdName), EvSpec = ?MSG_LIB:cre_EventSpec(EvName, [EvPar1,EvPar2,EvPar3]), - EvSpecs = [EvSpec], + EvSpecs = [EvSpec], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). - + pretty_otp6490_msg04() -> EvPar1 = ?MSG_LIB:cre_EventParameter("sune", ["mangs"]), EvPar2 = ?MSG_LIB:cre_EventParameter("kalle", ["anka"]), @@ -5437,31 +5818,31 @@ pretty_otp6490_msg04() -> PkgdName2 = ?MSG_LIB:cre_PkgdName("bar", "b"), EvName2 = ?MSG_LIB:cre_EventName(PkgdName2), EvSpec2 = ?MSG_LIB:cre_EventSpec(EvName2, [EvPar4]), - EvSpecs = [EvSpec1,EvSpec2], + EvSpecs = [EvSpec1,EvSpec2], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). - + pretty_otp6490_msg05() -> EvPar = ?MSG_LIB:cre_EventParameter("sune", ["mangs"]), PkgdName = ?MSG_LIB:cre_PkgdName("foo", root), EvName = ?MSG_LIB:cre_EventName(PkgdName), EvSpec = ?MSG_LIB:cre_EventSpec(EvName, [EvPar]), - EvSpecs = [EvSpec], + EvSpecs = [EvSpec], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). - + pretty_otp6490_msg06() -> EvPar = ?MSG_LIB:cre_EventParameter("sune", ["mangs"]), PkgdName = ?MSG_LIB:cre_PkgdName(root, root), EvName = ?MSG_LIB:cre_EventName(PkgdName), EvSpec = ?MSG_LIB:cre_EventSpec(EvName, [EvPar]), - EvSpecs = [EvSpec], + EvSpecs = [EvSpec], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). - + %% -------------------------------------------------------------- -%% +%% pretty_otp7249_msg01(suite) -> []; pretty_otp7249_msg01(doc) -> @@ -5478,15 +5859,15 @@ pretty_otp7249_msg01(Config) when is_list(Config) -> %% erase(dbg), %% erase(severity), ok. - + pretty_otp7249_msg01() -> "MEGACO/2 <AGW95_DCT_2_DPNSS>\r\nTransaction = 500017 { \r\nContext = - { ServiceChange = ROOT { Services { \r\nMethod = Disconnected, Reason = 900, 20070116T15233997 } \r\n } } } \r\n". pretty_otp7249(EncodedMsg) -> - Codec = megaco_pretty_text_encoder, - Conf = [], - Bin = list_to_binary(EncodedMsg), + Codec = megaco_pretty_text_encoder, + Conf = [], + Bin = list_to_binary(EncodedMsg), case decode_mini_message(Codec, Conf, Bin) of {ok, Msg} when is_record(Msg, 'MegacoMessage') -> %% io:format("Msg: ~n~p" @@ -5577,12 +5958,12 @@ pretty_otp7671(Msg, Conf, ExpectedEncode, ExpectedDecode, Check) -> ExpectedEncode, ExpectedDecode, Check). otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode) -> - Check = fun(M1, M2) -> + Check = fun(M1, M2) -> exit({unexpected_decode_result, M1, M2}) end, otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode, Check). -otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode, Check) +otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode, Check) when is_function(Check) -> case (catch encode_message(Codec, Conf, Msg)) of {error, _Reason} when ExpectedEncode =:= error -> @@ -5655,9 +6036,9 @@ pretty_otp7671_msg05() -> asn1_NOVALUE}}}]}}, asn1_NOVALUE,asn1_NOVALUE}]}]}}]}}}. -cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE, - mess = M1}, - #'MegacoMessage'{authHeader = asn1_NOVALUE, +cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE, + mess = M1}, + #'MegacoMessage'{authHeader = asn1_NOVALUE, mess = M2}) -> #'Message'{messageBody = Body1} = M1, #'Message'{messageBody = Body2} = M2, @@ -5673,11 +6054,11 @@ cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE, [#'CommandRequest'{command = Cmd2}] = CR2, {modReq, #'AmmRequest'{descriptors = Descs1}} = Cmd1, {modReq, #'AmmRequest'{descriptors = Descs2}} = Cmd2, - [{digitMapDescriptor, - #'DigitMapDescriptor'{digitMapName = Name, + [{digitMapDescriptor, + #'DigitMapDescriptor'{digitMapName = Name, digitMapValue = Value1}}] = Descs1, - [{digitMapDescriptor, - #'DigitMapDescriptor'{digitMapName = Name, + [{digitMapDescriptor, + #'DigitMapDescriptor'{digitMapName = Name, digitMapValue = Value2}}] = Descs2, #'DigitMapValue'{startTimer = asn1_NOVALUE, shortTimer = asn1_NOVALUE, @@ -5686,7 +6067,7 @@ cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE, durationTimer = asn1_NOVALUE} = Value1, asn1_NOVALUE = Value2, ok. - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -5728,7 +6109,7 @@ expect_codec(Expect, Codec, Msg, Conf) -> exit({unexpected_encode_result, Else}) end. - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% msgs() -> @@ -5736,83 +6117,83 @@ msgs() -> [M || {_, M, _, _} <- Msgs]. msgs1() -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, - EC, M) + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + EC, M) end, [ - {msg01a, msg1a(), Plain, [{dbg,false}]}, + {msg01a, msg1a(), Plain, [{dbg,false}]}, {msg01b, msg1b(), Plain, [{dbg,false}]}, - {msg02, msg2(), Plain, [{dbg,false}]}, - {msg03, msg3(), Plain, [{dbg,false}]}, - {msg04, msg4(), Plain, [{dbg,false}]}, - {msg05, msg5(), Plain, [{dbg,false}]}, - {msg06a, msg6a(), Plain, [{dbg,false}]}, - {msg06b, msg6b(), Plain, [{dbg,false}]}, - {msg07, msg7(), Plain, [{dbg,false}]}, - {msg08a, msg8a(), Plain, [{dbg,false}]}, - {msg08b, msg8b(), Plain, [{dbg,false}]}, - {msg09, msg9(), Plain, [{dbg,false}]}, - {msg10, msg10(), Plain, [{dbg,false}]}, - {msg11, msg11(), Plain, [{dbg,false}]}, - {msg12, msg12(), Plain, [{dbg,false}]}, - {msg13, msg13(), Plain, [{dbg,false}]}, - {msg14, msg14(), Plain, [{dbg,false}]}, - {msg15, msg15(), Plain, [{dbg,false}]}, - {msg16, msg16(), Plain, [{dbg,false}]}, - {msg17, msg17(), Plain, [{dbg,false}]}, - {msg18, msg18(), Plain, [{dbg,false}]}, - {msg19, msg19(), Plain, [{dbg,false}]}, - {msg20, msg20(), Plain, [{dbg,false}]}, - {msg21, msg21(), Plain, [{dbg,false}]}, - {msg22a, msg22a(), Plain, [{dbg,false}]}, - {msg22b, msg22b(), Plain, [{dbg,false}]}, - {msg22c, msg22c(), Plain, [{dbg,false}]}, - {msg22d, msg22d(), Plain, [{dbg,false}]}, - {msg22e, msg22e(), Plain, [{dbg,false}]}, - {msg22f, msg22f(), Plain, [{dbg,false}]}, - {msg23a, msg23a(), Plain, [{dbg,false}]}, - {msg23b, msg23b(), Plain, [{dbg,false}]}, - {msg23c, msg23c(), Plain, [{dbg,false}]}, - {msg23d, msg23d(), Plain, [{dbg,false}]}, - {msg24, msg24(), Plain, [{dbg,false}]}, - {msg25, msg25(), Plain, [{dbg,false}]}, - {msg30a, msg30a(), Plain, [{dbg,false}]}, - {msg30b, msg30b(), Plain, [{dbg,false}]}, - {msg30c, msg30c(), Plain, [{dbg,false}]}, + {msg02, msg2(), Plain, [{dbg,false}]}, + {msg03, msg3(), Plain, [{dbg,false}]}, + {msg04, msg4(), Plain, [{dbg,false}]}, + {msg05, msg5(), Plain, [{dbg,false}]}, + {msg06a, msg6a(), Plain, [{dbg,false}]}, + {msg06b, msg6b(), Plain, [{dbg,false}]}, + {msg07, msg7(), Plain, [{dbg,false}]}, + {msg08a, msg8a(), Plain, [{dbg,false}]}, + {msg08b, msg8b(), Plain, [{dbg,false}]}, + {msg09, msg9(), Plain, [{dbg,false}]}, + {msg10, msg10(), Plain, [{dbg,false}]}, + {msg11, msg11(), Plain, [{dbg,false}]}, + {msg12, msg12(), Plain, [{dbg,false}]}, + {msg13, msg13(), Plain, [{dbg,false}]}, + {msg14, msg14(), Plain, [{dbg,false}]}, + {msg15, msg15(), Plain, [{dbg,false}]}, + {msg16, msg16(), Plain, [{dbg,false}]}, + {msg17, msg17(), Plain, [{dbg,false}]}, + {msg18, msg18(), Plain, [{dbg,false}]}, + {msg19, msg19(), Plain, [{dbg,false}]}, + {msg20, msg20(), Plain, [{dbg,false}]}, + {msg21, msg21(), Plain, [{dbg,false}]}, + {msg22a, msg22a(), Plain, [{dbg,false}]}, + {msg22b, msg22b(), Plain, [{dbg,false}]}, + {msg22c, msg22c(), Plain, [{dbg,false}]}, + {msg22d, msg22d(), Plain, [{dbg,false}]}, + {msg22e, msg22e(), Plain, [{dbg,false}]}, + {msg22f, msg22f(), Plain, [{dbg,false}]}, + {msg23a, msg23a(), Plain, [{dbg,false}]}, + {msg23b, msg23b(), Plain, [{dbg,false}]}, + {msg23c, msg23c(), Plain, [{dbg,false}]}, + {msg23d, msg23d(), Plain, [{dbg,false}]}, + {msg24, msg24(), Plain, [{dbg,false}]}, + {msg25, msg25(), Plain, [{dbg,false}]}, + {msg30a, msg30a(), Plain, [{dbg,false}]}, + {msg30b, msg30b(), Plain, [{dbg,false}]}, + {msg30c, msg30c(), Plain, [{dbg,false}]}, {msg30d, msg30d(), Plain, [{dbg,false}]} ]. msgs2() -> - TransFirst = + TransFirst = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:trans_first_encode_decode(Codec, DD, - Ver, EC, M) + megaco_codec_test_lib:trans_first_encode_decode(Codec, DD, + Ver, EC, M) end, - ActionsFirst = + ActionsFirst = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:actions_first_encode_decode(Codec, DD, - Ver, EC, M) + megaco_codec_test_lib:actions_first_encode_decode(Codec, DD, + Ver, EC, M) end, - ActionFirst = + ActionFirst = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:action_first_encode_decode(Codec, DD, - Ver, EC, M) + megaco_codec_test_lib:action_first_encode_decode(Codec, DD, + Ver, EC, M) end, [ - {msg01a_tf, msg1a(), TransFirst, [{dbg,false}]}, - {msg02_tf, msg2(), TransFirst, [{dbg,false}]}, - {msg10_tf, msg10(), TransFirst, [{dbg,false}]}, - {msg11_tf, msg11(), TransFirst, [{dbg,false}]}, - {msg23d_tf, msg23d(), TransFirst, [{dbg,false}]}, - {msg30b_tf, msg30b(), TransFirst, [{dbg,false}]}, - {msg30c_tf, msg30c(), TransFirst, [{dbg,false}]}, - {msg01a_asf, msg1a(), ActionsFirst, [{dbg,false}]}, - {msg02_asf, msg2(), ActionsFirst, [{dbg,false}]}, - {msg10_asf, msg10(), ActionsFirst, [{dbg,false}]}, - {msg23d_asf, msg23d(), ActionsFirst, [{dbg,false}]}, + {msg01a_tf, msg1a(), TransFirst, [{dbg,false}]}, + {msg02_tf, msg2(), TransFirst, [{dbg,false}]}, + {msg10_tf, msg10(), TransFirst, [{dbg,false}]}, + {msg11_tf, msg11(), TransFirst, [{dbg,false}]}, + {msg23d_tf, msg23d(), TransFirst, [{dbg,false}]}, + {msg30b_tf, msg30b(), TransFirst, [{dbg,false}]}, + {msg30c_tf, msg30c(), TransFirst, [{dbg,false}]}, + {msg01a_asf, msg1a(), ActionsFirst, [{dbg,false}]}, + {msg02_asf, msg2(), ActionsFirst, [{dbg,false}]}, + {msg10_asf, msg10(), ActionsFirst, [{dbg,false}]}, + {msg23d_asf, msg23d(), ActionsFirst, [{dbg,false}]}, {msg01a_af, msg1a(), ActionFirst, [{dbg,false}]}, {msg02_af, msg2(), ActionFirst, [{dbg,false}]}, {msg10_af, msg10(), ActionFirst, [{dbg,false}]}, @@ -5821,10 +6202,10 @@ msgs2() -> msgs3() -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, - EC, M) + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + EC, M) end, [{msgs3_name(Name), rfc3525_decode(M), Plain, [{dbg, false}]} || {Name, M} <- rfc3525_msgs()]. @@ -5844,10 +6225,10 @@ rfc3525_decode(M) when is_binary(M) -> msgs4() -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, - EC, M) + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + EC, M) end, [ {msg51a, msg51a(), Plain, [{dbg, false}]}, @@ -5870,19 +6251,19 @@ msgs4() -> {msg58a, msg58a(), Plain, [{dbg, false}]}, {msg58b, msg58b(), Plain, [{dbg, false}]} ]. - - + + msgs5() -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, EC, M) - end, + end, - PlainEDFail = + PlainEDFail = fun(Codec, DD, Ver, EC, M) -> - Res = - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + Res = + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, EC, M), case Res of {error, {message_encode_failed, Reason, _M}} -> @@ -5896,11 +6277,11 @@ msgs5() -> Res end end, - - PlainDE = + + PlainDE = fun(Codec, _DD, Ver, EC, B) -> - Res = - megaco_codec_test_lib:decode_message(Codec, false, Ver, + Res = + megaco_codec_test_lib:decode_message(Codec, false, Ver, EC, B), case Res of {ok, M} -> @@ -5919,7 +6300,7 @@ msgs5() -> Res end end, - + [ {msg61a, msg61a(), Plain, [{dbg, false}]}, {msg61b, msg61b(), Plain, [{dbg, false}]}, @@ -5927,8 +6308,8 @@ msgs5() -> {msg62a, msg62a(), PlainEDFail, [{dbg, false}]}, {msg62b, msg62b(), PlainDE, [{dbg, false}]} ]. - - + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% msg_actions([], Actions) -> @@ -5942,7 +6323,7 @@ megaco_trans_req([], Transactions) -> megaco_trans_req([{TransId, ActionInfo}|TransInfo], Transactions) -> Actions = msg_actions(ActionInfo, []), TR = ?MSG_LIB:cre_TransactionRequest(TransId, Actions), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), megaco_trans_req(TransInfo, [Trans|Transactions]). megaco_message(Version, Mid, Body) -> @@ -5957,7 +6338,7 @@ msg_request(Mid, TransId, ContextId, CmdReq) -> Action = ?MSG_LIB:cre_ActionRequest(ContextId, CmdReq), Actions = [Action], TR = ?MSG_LIB:cre_TransactionRequest(TransId, Actions), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, Mid, [Trans]), ?MSG_LIB:cre_MegacoMessage(Mess). @@ -5965,15 +6346,15 @@ msg_request(Auth, Mid, TransId, ContextId, CmdReq) -> Action = ?MSG_LIB:cre_ActionRequest(ContextId, CmdReq), Actions = [Action], TR = ?MSG_LIB:cre_TransactionRequest(TransId, Actions), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, Mid, [Trans]), ?MSG_LIB:cre_MegacoMessage(Auth, Mess). msg_reply(Mid, TransId, ContextId, CmdReply) -> Action = cre_ActRep(ContextId, CmdReply), - Actions = [Action], + Actions = [Action], TR = cre_TransRep(TransId, Actions), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, Mid, [Trans]), ?MSG_LIB:cre_MegacoMessage(Mess). @@ -6000,7 +6381,7 @@ make_tra(Ranges) -> msg1(Mid, Tid) -> Gain = cre_PropParm("tdmc/gain", "2"), - Ec = cre_PropParm("tdmc/ec", "g165"), + Ec = cre_PropParm("tdmc/ec", "g165"), LCD = cre_LocalControlDesc(sendRecv,[Gain, Ec]), V = cre_PropParm("v", "0"), %% C = cre_PropParm("c", "IN IP4 $ "), @@ -6039,7 +6420,7 @@ msg2(Mid) -> msg2(Mid, ?A4444). msg2(Mid, Tid) -> Gain = cre_PropParm("tdmc/gain", "2"), - Ec = cre_PropParm("tdmc/ec", "g165"), + Ec = cre_PropParm("tdmc/ec", "g165"), LCD = cre_LocalControlDesc(sendRecv,[Gain, Ec]), V = cre_PropParm("v", "0"), %% C = cre_PropParm("c", "IN IP4 $ "), @@ -6276,7 +6657,7 @@ msg14() -> msg14(?MGC_MID). msg14(Mid) -> %% Cmd 1) - Signal = cre_Sig("cg/rt"), + Signal = cre_Sig("cg/rt"), AmmReq1 = cre_AmmReq([#megaco_term_id{id = ?A4444}], [{signalsDescriptor, [{signal, Signal}]}]), CmdReq1 = cre_CmdReq({modReq, AmmReq1}), @@ -6443,11 +6824,11 @@ msg22(Mid, N) -> Audits = [{mediaDescriptor, Media}, {packagesDescriptor, [PackagesItem, PackagesItem2]}, {statisticsDescriptor, Statistics}], - Reply = {auditResult, + Reply = {auditResult, cre_AuditRes(#megaco_term_id{id = ?A5556},Audits)}, - msg_reply(Mid, 50007, ?megaco_null_context_id, + msg_reply(Mid, 50007, ?megaco_null_context_id, lists:duplicate(N,{auditValueReply, Reply})). -%% msg_reply(Mid, 50007, ?megaco_null_context_id, +%% msg_reply(Mid, 50007, ?megaco_null_context_id, %% lists.duplicate([{auditValueReply, Reply}]). @@ -6548,7 +6929,7 @@ msg25(Mid) -> Stats2 = [Stat21, Stat22, Stat23, Stat24, Stat25, Stat26, Stat27], Reply2 = cre_AmmsReply([#megaco_term_id{id = ?A5556}], [{statisticsDescriptor, Stats2}]), - msg_reply(Mid, 50009, 5000, + msg_reply(Mid, 50009, 5000, [{subtractReply, Reply1}, {subtractReply, Reply2}]). @@ -6559,7 +6940,7 @@ msg30b() -> msg_ack(?MG2_MID, [{9,13}]). msg30c() -> - msg_ack(?MG2_MID, + msg_ack(?MG2_MID, [{9,13}, {15,15}, {33,40}, {50,60}, {70,80}, {85,90}, {101,105},{109,119},{121,130},{140,160},{170,175},{180,189}, {201,205},{209,219},{221,230},{240,260},{270,275},{280,289}, @@ -6571,7 +6952,7 @@ msg30c() -> %% Don't think this will be used by the megaco stack, but since it %% seem's to be a valid construction... msg30d() -> - msg_ack(?MG2_MID, + msg_ack(?MG2_MID, [[{9,13}, {15,15}, {33,40}, {50,60}, {70,80}, {85,90}], [{101,105},{109,119},{121,130},{140,160},{170,175},{180,189}], [{201,205},{209,219},{221,230},{240,260},{270,275},{280,289}], @@ -6581,7 +6962,7 @@ msg30d() -> ]). - + msg40() -> msg40(?MG1_MID_NO_PORT, "901 mg col boot"). msg40(Mid, Reason) when is_list(Reason) -> @@ -6599,14 +6980,14 @@ msg50(Mid, APT) -> Req = cre_AuditReq(#megaco_term_id{id = ?A5556},AD), CmdReq = cre_CmdReq({auditValueRequest, Req}), msg_request(Mid, 50007, ?megaco_null_context_id, [CmdReq]). - + %% IndAudMediaDescriptor: msg51(Mid, IATSDorStream) -> IAMD = cre_IndAudMediaDesc(IATSDorStream), IAP = cre_IndAudParam(IAMD), APT = [IAP], msg50(Mid, APT). - + msg51a() -> msg51a(?MG2_MID). msg51a(Mid) -> @@ -6638,7 +7019,7 @@ msg51d(Mid) -> msg51e() -> msg51e(?MG2_MID). msg51e(Mid) -> - IALCD = cre_IndAudLocalControlDesc('NULL', asn1_NOVALUE, + IALCD = cre_IndAudLocalControlDesc('NULL', asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE), IASP = cre_IndAudStreamParms(IALCD), msg51(Mid, IASP). @@ -6646,7 +7027,7 @@ msg51e(Mid) -> msg51f() -> msg51f(?MG2_MID). msg51f(Mid) -> - IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, 'NULL', + IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, 'NULL', asn1_NOVALUE, asn1_NOVALUE), IASP = cre_IndAudStreamParms(IALCD), msg51(Mid, IASP). @@ -6654,7 +7035,7 @@ msg51f(Mid) -> msg51g() -> msg51g(?MG2_MID). msg51g(Mid) -> - IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, asn1_NOVALUE, + IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, asn1_NOVALUE, 'NULL', asn1_NOVALUE), IASP = cre_IndAudStreamParms(IALCD), msg51(Mid, IASP). @@ -6664,7 +7045,7 @@ msg51h() -> msg51h(Mid) -> Name = "nt/jit", IAPP = cre_IndAudPropertyParm(Name), - IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, asn1_NOVALUE, + IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, [IAPP]), IASP = cre_IndAudStreamParms(IALCD), SID = 123, @@ -6679,7 +7060,7 @@ msg51i(Mid) -> Name2 = "tdmc/ec", IAPP = cre_IndAudPropertyParm(Name), IAPP2 = cre_IndAudPropertyParm(Name2), - IALCD = cre_IndAudLocalControlDesc('NULL', 'NULL', 'NULL', + IALCD = cre_IndAudLocalControlDesc('NULL', 'NULL', 'NULL', [IAPP, IAPP2]), IASP = cre_IndAudStreamParms(IALCD), SID = 123, @@ -6715,7 +7096,7 @@ msg54(Mid, Sig) -> IAP = cre_IndAudParam(IASD), APT = [IAP], msg50(Mid, APT). - + msg54a() -> msg54a(?MG2_MID). msg54a(Mid) -> @@ -6757,7 +7138,7 @@ msg56(Mid) -> IASD = cre_IndAudStatsDesc(SN), IAP = cre_IndAudParam(IASD), APT = [IAP], - msg50(Mid, APT). + msg50(Mid, APT). %% IndAudPackagesDescriptor: msg57() -> @@ -6768,30 +7149,30 @@ msg57(Mid) -> IAPD = cre_IndAudPkgsDesc(PN, PV), IAP = cre_IndAudParam(IAPD), APT = [IAP], - msg50(Mid, APT). - + msg50(Mid, APT). + %% Sum it up: msg58_iaMediaDesc_iap(IATSD) -> IAMD = cre_IndAudMediaDesc(IATSD), cre_IndAudParam(IAMD). - + msg58_iaMediaDesc_iap_a() -> PP = cre_IndAudPropertyParm("tdmc/gain"), PPs = [PP], IATSD = cre_IndAudTermStateDesc(PPs), msg58_iaMediaDesc_iap(IATSD). - + msg58_iaMediaDesc_iap_b() -> IATSD = cre_IndAudTermStateDesc([], 'NULL', asn1_NOVALUE), msg58_iaMediaDesc_iap(IATSD). - + msg58_iaEvsDesc_iap() -> RequestID = 1235, PkgdName = "tonedet/std", IAED = cre_IndAudEvsDesc(RequestID, PkgdName), cre_IndAudParam(IAED). -msg58_iaEvBufDesc_iap() -> +msg58_iaEvBufDesc_iap() -> EN = "tonedet/std", SID = 1, IAEBD = cre_IndAudEvBufDesc(EN, SID), @@ -6805,7 +7186,7 @@ msg58_iaSigsDesc_iap_a() -> SN = "tonegen/pt", Sig = cre_IndAudSig(SN), msg58_iaSigsDesc_iap(Sig). - + msg58_iaSigsDesc_iap_b() -> SN = "ct/ct", Sig = cre_IndAudSig(SN), @@ -6817,7 +7198,7 @@ msg58_iaDigMapDesc_iap() -> DMN = "dialplan00", IADMD = cre_IndAudDigitMapDesc(DMN), cre_IndAudParam(IADMD). - + msg58_iaStatsDesc_iap() -> SN = "nt/dur", IASD = cre_IndAudStatsDesc(SN), @@ -6856,7 +7237,7 @@ msg58b(Mid) -> msg50(Mid, APT). -%% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +%% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %% Tests some of the changes in the v2 corr 1 (EmergencyOff and ModemDesc) %% Emergency On/Off (optional) tests @@ -6871,7 +7252,7 @@ msg61(EM) -> ActReq = ?MSG_LIB:cre_ActionRequest(1, CtxReq, [CmdReq]), Acts = [ActReq], TR = ?MSG_LIB:cre_TransactionRequest(9898, Acts), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, ?MG1_MID, [Trans]), ?MSG_LIB:cre_MegacoMessage(Mess). @@ -6897,12 +7278,12 @@ msg62a() -> ActReq = ?MSG_LIB:cre_ActionRequest(2, [CmdReq]), Acts = [ActReq], TR = ?MSG_LIB:cre_TransactionRequest(9898, Acts), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, ?MG1_MID, [Trans]), ?MSG_LIB:cre_MegacoMessage(Mess). msg62b() -> - MP = + MP = "MEGACO/" ?VERSION_STR " [124.124.124.222]:55555 Transaction = 9898 { Context = 2 { @@ -6913,11 +7294,11 @@ Transaction = 9898 { } } }", -% MC = +% MC = % "!/" ?VERSION_STR " [124.124.124.222]:55555\nT=9898{C=2{A=11111111/00000000/00000000{MD[V18]{tdmc/gain=2}}}}", list_to_binary(MP). -%% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +%% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %% Pretty RFC 3525 messages: %% Added Reason @@ -6928,11 +7309,11 @@ rfc3525_msg1() -> Services { Method = Restart, Reason = 901, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". rfc3525_msg2() -> @@ -6940,11 +7321,11 @@ rfc3525_msg2() -> Context = - { ServiceChange = ROOT { Services { - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 - } - } - } + } + } + } }". @@ -6953,7 +7334,7 @@ rfc3525_msg3() -> "MEGACO/" ?VERSION_STR " [123.123.123.4]:55555 Transaction = 9999 { Context = - { Modify = A4444 { - Media { + Media { Stream = 1 { LocalControl { Mode = SendReceive, @@ -6985,15 +7366,15 @@ rfc3525_msg6() -> 19990729T22000000:al/of{init=false} } } - } + } }". - + rfc3525_msg7() -> "MEGACO/" ?VERSION_STR " [123.123.123.4]:55555 Reply = 10000 { Context = - { Notify = A4444 - } + } }". rfc3525_msg8() -> @@ -7001,11 +7382,11 @@ rfc3525_msg8() -> Context = - { Modify = A4444 { Events = 2223 { - al/on {strict=state}, + al/on {strict=state}, dd/ce {DigitMap=Dialplan0} }, Signals {cg/dt}, - DigitMap = Dialplan0 { + DigitMap = Dialplan0 { (0| 00|[1-7]xxx|8xxxxxxx|fxxxxxxx|exx|91xxxxxxxxxx|9011x.) } } @@ -7030,7 +7411,7 @@ rfc3525_msg10() -> } } } - } + } }". @@ -7053,13 +7434,13 @@ rfc3525_msg12() -> Mode = ReceiveOnly, nt/jit=40 ; in ms }, - Local { + Local { v=0 c=IN IP4 $ m=audio $ RTP/AVP 4 a=ptime:30 v=0 c=IN IP4 $ m=audio $ RTP/AVP 0 } } } } - } + } }". %% Added ? @@ -7070,28 +7451,28 @@ rfc3525_msg13() -> Add = A4445 { Media { Stream = 1 { - Local { -v=0 -o=- 2890844526 2890842807 IN IP4 124.124.124.222 -s=- -t= 0 0 -c=IN IP4 124.124.124.222 -m=audio 2222 RTP/AVP 4 -a=ptime:30 -a=recvonly + Local { +v=0 +o=- 2890844526 2890842807 IN IP4 124.124.124.222 +s=- +t= 0 0 +c=IN IP4 124.124.124.222 +m=audio 2222 RTP/AVP 4 +a=ptime:30 +a=recvonly } ; RTP profile for G.723.1 is 4 } } } - } + } }". -%% +%% %% Added ? rfc3525_msg14() -> "MEGACO/" ?VERSION_STR " [123.123.123.4]:55555 Transaction = 50003 { Context = $ { - Add = A5555 { + Add = A5555 { Media { Stream = 1 { LocalControl { @@ -7111,16 +7492,16 @@ rfc3525_msg14() -> Mode = SendReceive, nt/jit=40 ; in ms }, - Local { + Local { v=0 c=IN IP4 $ m=audio $ RTP/AVP 4 a=ptime:30 }, - Remote { + Remote { v=0 c=IN IP4 124.124.124.222 m=audio 2222 RTP/AVP 4 a=ptime:30 } ; RTP profile for G.723.1 is 4 } } } - } + } }". %% Added ? @@ -7131,10 +7512,10 @@ rfc3525_msg15() -> Add = A5556 { Media { Stream = 1 { - Local { - v=0 o=- 7736844526 7736842807 IN IP4 125.125.125.111 s=- t= 0 0 c=IN IP4 125.125.125.111 m=audio 1111 RTP/AVP 4 + Local { + v=0 o=- 7736844526 7736842807 IN IP4 125.125.125.111 s=- t= 0 0 c=IN IP4 125.125.125.111 m=audio 1111 RTP/AVP 4 } ; RTP profile for G723.1 is 4 - } + } } } } @@ -7150,10 +7531,10 @@ rfc3525_msg16a() -> Modify = A4445 { Media { Stream = 1 { - Remote { + Remote { v=0 o=- 7736844526 7736842807 IN IP4 125.125.125.111 s=- t= 0 0 c=IN IP4 125.125.125.111 m=audio 1111 RTP/AVP 4 } ; RTP profile for G723.1 is 4 - } + } } } } @@ -7162,7 +7543,7 @@ rfc3525_msg16a() -> rfc3525_msg16b() -> "MEGACO/" ?VERSION_STR " [124.124.124.222]:55555 Reply = 10005 { Context = 2000 { - Modify = A4444, + Modify = A4444, Modify = A4445 } }". @@ -7219,7 +7600,7 @@ rfc3525_msg18a() -> } }, Modify = A4444 { - Signals + Signals } } }". @@ -7227,7 +7608,7 @@ rfc3525_msg18a() -> rfc3525_msg18b() -> "MEGACO/" ?VERSION_STR " [124.124.124.222]:55555 Reply = 10006 { Context = 2000 { - Modify = A4445, + Modify = A4445, Modify = A4444 } }". @@ -7246,22 +7627,22 @@ rfc3525_msg19() -> %% Added ? rfc3525_msg20() -> "MEGACO/" ?VERSION_STR " [125.125.125.111]:55555 Reply = 50007 { - Context = - { + Context = - { AuditValue = A5556 { Media { - TerminationState { + TerminationState { ServiceStates = InService, - Buffer = OFF + Buffer = OFF }, Stream = 1 { - LocalControl { + LocalControl { Mode = SendReceive, - nt/jit=40 + nt/jit=40 }, - Local { + Local { v=0 o=- 7736844526 7736842807 IN IP4 125.125.125.111 s=- t= 0 0 c=IN IP4 125.125.125.111 m=audio 1111 RTP/AVP 4 a=ptime:30 }, - Remote { + Remote { v=0 o=- 2890844526 2890842807 IN IP4 124.124.124.222 s=- t= 0 0 c=IN IP4 124.124.124.222 m=audio 2222 RTP/AVP 4 a=ptime:30 } } @@ -7270,7 +7651,7 @@ rfc3525_msg20() -> Signals, DigitMap, Packages {nt-1, rtp-1}, - Statistics { + Statistics { rtp/ps=1200, ; packets sent nt/os=62300, ; octets sent rtp/pr=700, ; packets received @@ -7278,7 +7659,7 @@ rfc3525_msg20() -> rtp/pl=0.2, ; % packet loss rtp/jit=20, rtp/delay=40 ; avg latency - } + } } } }". @@ -7431,13 +7812,13 @@ skip(Reason) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% decode_message(Codec, DynamicDecode, Conf, Bin) -> - megaco_codec_test_lib:decode_message(Codec, DynamicDecode, ?VERSION, + megaco_codec_test_lib:decode_message(Codec, DynamicDecode, ?VERSION, Conf, Bin). encode_message(Codec, Conf, Msg) -> megaco_codec_test_lib:encode_message(Codec, ?VERSION, Conf, Msg). test_msgs(Codec, DynamicDecode, Conf, Msgs) -> - megaco_codec_test_lib:test_msgs(Codec, DynamicDecode, ?VERSION, Conf, + megaco_codec_test_lib:test_msgs(Codec, DynamicDecode, ?VERSION, Conf, fun chk_MegacoMessage/2, Msgs). @@ -7463,8 +7844,8 @@ cre_MegacoMessage(V, Mid, Body) -> ?MSG_LIB:cre_MegacoMessage(Mess). cre_AuthHeader() -> - SecParmIdx = [239, 205, 171, 137], - SeqNum = [18, 52, 86, 120], + SecParmIdx = [239, 205, 171, 137], + SeqNum = [18, 52, 86, 120], AD = [18, 52, 86, 120, 137, 171, 205, 239, 118, 84, 50, 16], cre_AuthHeader(SecParmIdx, SeqNum, AD). @@ -7491,7 +7872,7 @@ cre_TransRep(TransId, Actions) -> cre_TransAck(First, Last) -> ?MSG_LIB:cre_TransactionAck(First, Last). - + cre_ActReq(CtxId, CmdReqs) -> ?MSG_LIB:cre_ActionRequest(CtxId, CmdReqs). @@ -7527,7 +7908,7 @@ cre_IndAudTermStateDesc(PP) -> cre_IndAudTermStateDesc(PP, EBC, SS) -> ?MSG_LIB:cre_IndAudTerminationStateDescriptor(PP, EBC, SS). -cre_IndAudEvsDesc(RID, PN) +cre_IndAudEvsDesc(RID, PN) when is_integer(RID) -> ?MSG_LIB:cre_IndAudEventsDescriptor(RID, PN). @@ -7562,7 +7943,7 @@ cre_StatsParm(Name, Val) -> ?MSG_LIB:cre_StatisticsParameter(Name, [Val]). -% Event related +% Event related cre_EvParm(Name, Val) -> ?MSG_LIB:cre_EventParameter(Name, Val). @@ -7788,6 +8169,5 @@ p(_,_,_,_) -> p(F, A) -> io:format("*** [~s] ***" - "~n " ++ F ++ "~n", + "~n " ++ F ++ "~n", [?FTS() | A]). - diff --git a/lib/megaco/test/megaco_codec_v3_SUITE.erl b/lib/megaco/test/megaco_codec_v3_SUITE.erl index 5f4951acce..56a92b5f0a 100644 --- a/lib/megaco/test/megaco_codec_v3_SUITE.erl +++ b/lib/megaco/test/megaco_codec_v3_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2019. All Rights Reserved. +%% Copyright Ericsson AB 2006-2020. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. -%% +%% %% %CopyrightEnd% %% @@ -50,61 +50,61 @@ flex_pretty_finish/1, flex_pretty_test_msgs/1, - flex_compact_init/1, - flex_compact_finish/1, + flex_compact_init/1, + flex_compact_finish/1, flex_compact_test_msgs/1, - flex_compact_dm_timers1/1, - flex_compact_dm_timers2/1, - flex_compact_dm_timers3/1, - flex_compact_dm_timers4/1, - flex_compact_dm_timers5/1, - flex_compact_dm_timers6/1, - flex_compact_dm_timers7/1, - flex_compact_dm_timers8/1, + flex_compact_dm_timers1/1, + flex_compact_dm_timers2/1, + flex_compact_dm_timers3/1, + flex_compact_dm_timers4/1, + flex_compact_dm_timers5/1, + flex_compact_dm_timers6/1, + flex_compact_dm_timers7/1, + flex_compact_dm_timers8/1, bin_test_msgs/1, - ber_test_msgs/1, + ber_test_msgs/1, per_test_msgs/1, erl_dist_m_test_msgs/1, - compact_otp4011_msg1/1, + compact_otp4011_msg1/1, compact_otp4011_msg2/1, compact_otp4011_msg3/1, - compact_otp4013_msg1/1, - compact_otp4085_msg1/1, - compact_otp4085_msg2/1, - compact_otp4280_msg1/1, - compact_otp4299_msg1/1, - compact_otp4359_msg1/1, - compact_otp4920_msg0/1, - compact_otp4920_msg1/1, - compact_otp4920_msg2/1, - compact_otp4920_msg3/1, - compact_otp4920_msg4/1, - compact_otp4920_msg5/1, - compact_otp4920_msg6/1, - compact_otp4920_msg7/1, - compact_otp4920_msg8/1, - compact_otp4920_msg9/1, - compact_otp4920_msg10/1, - compact_otp4920_msg11/1, - compact_otp4920_msg12/1, - compact_otp4920_msg20/1, - compact_otp4920_msg21/1, - compact_otp4920_msg22/1, - compact_otp4920_msg23/1, - compact_otp4920_msg24/1, - compact_otp4920_msg25/1, - compact_otp5186_msg01/1, - compact_otp5186_msg02/1, - compact_otp5186_msg03/1, - compact_otp5186_msg04/1, - compact_otp5186_msg05/1, - compact_otp5186_msg06/1, + compact_otp4013_msg1/1, + compact_otp4085_msg1/1, + compact_otp4085_msg2/1, + compact_otp4280_msg1/1, + compact_otp4299_msg1/1, + compact_otp4359_msg1/1, + compact_otp4920_msg0/1, + compact_otp4920_msg1/1, + compact_otp4920_msg2/1, + compact_otp4920_msg3/1, + compact_otp4920_msg4/1, + compact_otp4920_msg5/1, + compact_otp4920_msg6/1, + compact_otp4920_msg7/1, + compact_otp4920_msg8/1, + compact_otp4920_msg9/1, + compact_otp4920_msg10/1, + compact_otp4920_msg11/1, + compact_otp4920_msg12/1, + compact_otp4920_msg20/1, + compact_otp4920_msg21/1, + compact_otp4920_msg22/1, + compact_otp4920_msg23/1, + compact_otp4920_msg24/1, + compact_otp4920_msg25/1, + compact_otp5186_msg01/1, + compact_otp5186_msg02/1, + compact_otp5186_msg03/1, + compact_otp5186_msg04/1, + compact_otp5186_msg05/1, + compact_otp5186_msg06/1, compact_otp5793_msg01/1, compact_otp5836_msg01/1, compact_otp5993_msg01/1, @@ -113,6 +113,32 @@ compact_otp6017_msg01/1, compact_otp6017_msg02/1, compact_otp6017_msg03/1, + compact_otp16818_msg01/1, + compact_otp16818_msg02/1, + compact_otp16818_msg03/1, + compact_otp16818_msg04/1, + compact_otp16818_msg05/1, + compact_otp16818_msg06/1, + compact_otp16818_msg11/1, + compact_otp16818_msg12/1, + compact_otp16818_msg13/1, + compact_otp16818_msg14/1, + compact_otp16818_msg15/1, + compact_otp16818_msg16/1, + compact_otp16818_msg21/1, + compact_otp16818_msg22/1, + compact_otp16818_msg23/1, + compact_otp16818_msg24/1, + compact_otp16818_msg25/1, + compact_otp16818_msg26/1, + compact_otp16818_msg31/1, + compact_otp16818_msg32/1, + compact_otp16818_msg33/1, + compact_otp16818_msg34/1, + compact_otp16818_msg35/1, + compact_otp16818_msg36/1, + compact_erl1405_msg01/1, + compact_erl1405_msg02/1, flex_compact_otp4299_msg1/1, flex_compact_otp7431_msg01/1, @@ -122,32 +148,32 @@ flex_compact_otp7431_msg05/1, flex_compact_otp7431_msg06/1, flex_compact_otp7431_msg07/1, - - pretty_otp4632_msg1/1, - pretty_otp4632_msg2/1, - pretty_otp4632_msg3/1, - pretty_otp4632_msg4/1, - pretty_otp4710_msg1/1, - pretty_otp4710_msg2/1, - pretty_otp4945_msg1/1, - pretty_otp4945_msg2/1, - pretty_otp4945_msg3/1, - pretty_otp4945_msg4/1, - pretty_otp4945_msg5/1, - pretty_otp4945_msg6/1, - pretty_otp4949_msg1/1, - pretty_otp4949_msg2/1, - pretty_otp4949_msg3/1, - pretty_otp5042_msg1/1, - pretty_otp5068_msg1/1, - pretty_otp5085_msg1/1, - pretty_otp5085_msg2/1, - pretty_otp5085_msg3/1, - pretty_otp5085_msg4/1, - pretty_otp5085_msg5/1, - pretty_otp5085_msg6/1, - pretty_otp5085_msg7/1, - pretty_otp5085_msg8/1, + + pretty_otp4632_msg1/1, + pretty_otp4632_msg2/1, + pretty_otp4632_msg3/1, + pretty_otp4632_msg4/1, + pretty_otp4710_msg1/1, + pretty_otp4710_msg2/1, + pretty_otp4945_msg1/1, + pretty_otp4945_msg2/1, + pretty_otp4945_msg3/1, + pretty_otp4945_msg4/1, + pretty_otp4945_msg5/1, + pretty_otp4945_msg6/1, + pretty_otp4949_msg1/1, + pretty_otp4949_msg2/1, + pretty_otp4949_msg3/1, + pretty_otp5042_msg1/1, + pretty_otp5068_msg1/1, + pretty_otp5085_msg1/1, + pretty_otp5085_msg2/1, + pretty_otp5085_msg3/1, + pretty_otp5085_msg4/1, + pretty_otp5085_msg5/1, + pretty_otp5085_msg6/1, + pretty_otp5085_msg7/1, + pretty_otp5085_msg8/1, pretty_otp5600_msg1/1, pretty_otp5600_msg2/1, pretty_otp5601_msg1/1, @@ -155,20 +181,22 @@ pretty_otp5803_msg01/1, pretty_otp5803_msg02/1, pretty_otp5805_msg01/1, - pretty_otp5836_msg01/1, - pretty_otp5882_msg01/1, - pretty_otp6490_msg01/1, - pretty_otp6490_msg02/1, - pretty_otp6490_msg03/1, - pretty_otp6490_msg04/1, - pretty_otp6490_msg05/1, - pretty_otp6490_msg06/1, + pretty_otp5836_msg01/1, + pretty_otp5882_msg01/1, + pretty_otp6490_msg01/1, + pretty_otp6490_msg02/1, + pretty_otp6490_msg03/1, + pretty_otp6490_msg04/1, + pretty_otp6490_msg05/1, + pretty_otp6490_msg06/1, pretty_otp7671_msg01/1, pretty_otp7671_msg02/1, pretty_otp7671_msg03/1, pretty_otp7671_msg04/1, pretty_otp7671_msg05/1, pretty_otp8114_msg01/1, + pretty_erl1405_msg01/1, + pretty_erl1405_msg02/1, flex_pretty_otp5042_msg1/1, flex_pretty_otp5085_msg1/1, @@ -194,7 +222,8 @@ flex_pretty_otp7431_msg05/1, flex_pretty_otp7431_msg06/1, flex_pretty_otp7431_msg07/1 - ]). + + ]). -export([display_text_messages/0, generate_text_messages/0]). @@ -230,18 +259,18 @@ %% Common Test interface functions %%====================================================================== -suite() -> +suite() -> [{ct_hooks, [ts_install_cth]}]. -all() -> +all() -> [ - {group, text}, - {group, binary}, + {group, text}, + {group, binary}, {group, erl_dist}, {group, tickets} ]. -groups() -> +groups() -> [ {text, [], text_cases()}, {binary, [], binary_cases()}, @@ -250,7 +279,7 @@ groups() -> {compact, [], compact_cases()}, {flex_pretty, [], flex_pretty_cases()}, {flex_compact, [], flex_compact_cases()}, - {bin, [], bin_cases()}, + {bin, [], bin_cases()}, {ber, [], ber_cases()}, {per, [], per_cases()}, {erl_dist_m, [], erl_dist_m_cases()}, @@ -263,16 +292,16 @@ groups() -> text_cases() -> [ - {group, pretty}, + {group, pretty}, {group, flex_pretty}, - {group, compact}, + {group, compact}, {group, flex_compact} ]. binary_cases() -> [ - {group, bin}, - {group, ber}, + {group, bin}, + {group, ber}, {group, per} ]. @@ -316,15 +345,15 @@ erl_dist_m_cases() -> erl_dist_m_test_msgs ]. -flex_compact_cases() -> +flex_compact_cases() -> [ - flex_compact_test_msgs, + flex_compact_test_msgs, flex_compact_dm_timers1, - flex_compact_dm_timers2, + flex_compact_dm_timers2, flex_compact_dm_timers3, - flex_compact_dm_timers4, + flex_compact_dm_timers4, flex_compact_dm_timers5, - flex_compact_dm_timers6, + flex_compact_dm_timers6, flex_compact_dm_timers7, flex_compact_dm_timers8 ]. @@ -332,7 +361,7 @@ flex_compact_cases() -> tickets_cases() -> [ {group, compact_tickets}, - {group, flex_compact_tickets}, + {group, flex_compact_tickets}, {group, pretty_tickets}, {group, flex_pretty_tickets} ]. @@ -380,18 +409,44 @@ compact_tickets_cases() -> compact_otp5993_msg03, compact_otp6017_msg01, compact_otp6017_msg02, - compact_otp6017_msg03 + compact_otp6017_msg03, + compact_otp16818_msg01, + compact_otp16818_msg02, + compact_otp16818_msg03, + compact_otp16818_msg04, + compact_otp16818_msg05, + compact_otp16818_msg06, + compact_otp16818_msg11, + compact_otp16818_msg12, + compact_otp16818_msg13, + compact_otp16818_msg14, + compact_otp16818_msg15, + compact_otp16818_msg16, + compact_otp16818_msg21, + compact_otp16818_msg22, + compact_otp16818_msg23, + compact_otp16818_msg24, + compact_otp16818_msg25, + compact_otp16818_msg26, + compact_otp16818_msg31, + compact_otp16818_msg32, + compact_otp16818_msg33, + compact_otp16818_msg34, + compact_otp16818_msg35, + compact_otp16818_msg36, + compact_erl1405_msg01, + compact_erl1405_msg02 ]. -flex_compact_tickets_cases() -> +flex_compact_tickets_cases() -> [ - flex_compact_otp4299_msg1, + flex_compact_otp4299_msg1, flex_compact_otp7431_msg01, - flex_compact_otp7431_msg02, + flex_compact_otp7431_msg02, flex_compact_otp7431_msg03, - flex_compact_otp7431_msg04, + flex_compact_otp7431_msg04, flex_compact_otp7431_msg05, - flex_compact_otp7431_msg06, + flex_compact_otp7431_msg06, flex_compact_otp7431_msg07 ]. @@ -442,34 +497,36 @@ pretty_tickets_cases() -> pretty_otp7671_msg03, pretty_otp7671_msg04, pretty_otp7671_msg05, - pretty_otp8114_msg01 + pretty_otp8114_msg01, + pretty_erl1405_msg01, + pretty_erl1405_msg02 ]. flex_pretty_tickets_cases() -> [ - flex_pretty_otp5042_msg1, + flex_pretty_otp5042_msg1, flex_pretty_otp5085_msg1, - flex_pretty_otp5085_msg2, + flex_pretty_otp5085_msg2, flex_pretty_otp5085_msg3, - flex_pretty_otp5085_msg4, + flex_pretty_otp5085_msg4, flex_pretty_otp5085_msg5, - flex_pretty_otp5085_msg6, + flex_pretty_otp5085_msg6, flex_pretty_otp5085_msg7, - flex_pretty_otp5085_msg8, + flex_pretty_otp5085_msg8, flex_pretty_otp5600_msg1, - flex_pretty_otp5600_msg2, + flex_pretty_otp5600_msg2, flex_pretty_otp5601_msg1, - flex_pretty_otp5793_msg01, + flex_pretty_otp5793_msg01, flex_pretty_otp5803_msg01, - flex_pretty_otp5803_msg02, + flex_pretty_otp5803_msg02, flex_pretty_otp5805_msg01, - flex_pretty_otp5836_msg01, + flex_pretty_otp5836_msg01, flex_pretty_otp7431_msg01, - flex_pretty_otp7431_msg02, + flex_pretty_otp7431_msg02, flex_pretty_otp7431_msg03, - flex_pretty_otp7431_msg04, + flex_pretty_otp7431_msg04, flex_pretty_otp7431_msg05, - flex_pretty_otp7431_msg06, + flex_pretty_otp7431_msg06, flex_pretty_otp7431_msg07 ]. @@ -527,29 +584,29 @@ end_per_suite(Config0) when is_list(Config0) -> %% ----- %% -init_per_group(flex_pretty_tickets = Group, Config) -> +init_per_group(flex_pretty_tickets = Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), flex_pretty_init(Config); -init_per_group(flex_compact_tickets = Group, Config) -> +init_per_group(flex_compact_tickets = Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), flex_compact_init(Config); -init_per_group(flex_compact = Group, Config) -> +init_per_group(flex_compact = Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), flex_compact_init(Config); -init_per_group(flex_pretty = Group, Config) -> +init_per_group(flex_pretty = Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), flex_pretty_init(Config); init_per_group(Group, Config) -> ?ANNOUNCE_GROUP_INIT(Group), Config. -end_per_group(flex_pretty_tickets = _Group, Config) -> +end_per_group(flex_pretty_tickets = _Group, Config) -> flex_pretty_finish(Config); -end_per_group(flex_compact_tickets = _Group, Config) -> +end_per_group(flex_compact_tickets = _Group, Config) -> flex_compact_finish(Config); -end_per_group(flex_compact = _Group, Config) -> +end_per_group(flex_compact = _Group, Config) -> flex_compact_finish(Config); -end_per_group(flex_pretty = _Group, Config) -> +end_per_group(flex_pretty = _Group, Config) -> flex_pretty_finish(Config); end_per_group(_Group, Config) -> Config. @@ -574,15 +631,15 @@ end_per_testcase(Case, Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% display_text_messages() -> - Msgs = - msgs7(text) ++ + Msgs = + msgs7(text) ++ msgs8(text), megaco_codec_test_lib:display_text_messages(?VERSION, ?EC, Msgs). generate_text_messages() -> - Msgs = - msgs7(text) ++ + Msgs = + msgs7(text) ++ msgs8(text), megaco_codec_test_lib:generate_text_messages(?V3, ?VERSION, ?EC, Msgs). @@ -593,20 +650,20 @@ pretty_test_msgs(suite) -> []; pretty_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(text) ++ - msgs1b(text) ++ - msgs3525(text) ++ - msgs5(text) ++ - msgs6(text) ++ - msgs7(text) ++ - msgs8(text), + Msgs = + msgs1a(text) ++ + msgs1b(text) ++ + msgs3525(text) ++ + msgs5(text) ++ + msgs6(text) ++ + msgs7(text) ++ + msgs8(text), %% Msgs = msgs1a(text), %% Msgs = msgs1b(text), %% Msgs = msgs35525(text), %% Msgs = msgs5(text), %% Msgs = msgs6(text), - %% Msgs = msgs7(text), + %% Msgs = msgs7(text), DynamicDecode = false, test_msgs(megaco_pretty_text_encoder, DynamicDecode, ?EC, Msgs). @@ -619,18 +676,18 @@ flex_pretty_init(Config) -> flex_pretty_finish(Config) -> flex_finish(Config). - + flex_pretty_test_msgs(suite) -> []; flex_pretty_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(text) ++ - msgs1b(text) ++ - msgs3525(text) ++ - msgs5(text) ++ - msgs6(text) ++ - msgs7(text) ++ + Msgs = + msgs1a(text) ++ + msgs1b(text) ++ + msgs3525(text) ++ + msgs5(text) ++ + msgs6(text) ++ + msgs7(text) ++ msgs8(text), Conf = flex_scanner_conf(Config), DynamicDecode = false, @@ -643,13 +700,13 @@ compact_test_msgs(suite) -> []; compact_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(text) ++ - msgs1b(text) ++ - msgs3525(text) ++ - msgs5(text) ++ - msgs6(text) ++ - msgs7(text) ++ + Msgs = + msgs1a(text) ++ + msgs1b(text) ++ + msgs3525(text) ++ + msgs5(text) ++ + msgs6(text) ++ + msgs7(text) ++ msgs8(text), %% Msgs = msgs7(text), DynamicDecode = false, @@ -663,21 +720,21 @@ flex_compact_init(Config) -> flex_compact_finish(Config) -> flex_finish(Config). - + flex_compact_test_msgs(suite) -> []; flex_compact_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(text) ++ - msgs1b(text) ++ - msgs3525(text) ++ - msgs5(text) ++ - msgs6(text) ++ - msgs7(text) ++ + Msgs = + msgs1a(text) ++ + msgs1b(text) ++ + msgs3525(text) ++ + msgs5(text) ++ + msgs6(text) ++ + msgs7(text) ++ msgs8(text), - Conf = flex_scanner_conf(Config), + Conf = flex_scanner_conf(Config), DynamicDecode = true, test_msgs(megaco_compact_text_encoder, DynamicDecode, [?EC_V3,Conf], Msgs). @@ -688,8 +745,8 @@ flex_compact_dm_timers1(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("1", "2", "3"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), - case decode_message(megaco_compact_text_encoder, false, + Conf = flex_scanner_conf(Config), + case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers1 -> " @@ -707,8 +764,8 @@ flex_compact_dm_timers2(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("02", "03", "04"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), - case decode_message(megaco_compact_text_encoder, false, + Conf = flex_scanner_conf(Config), + case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers2 -> " @@ -726,8 +783,8 @@ flex_compact_dm_timers3(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("1", "02", "31"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), - case decode_message(megaco_compact_text_encoder, false, + Conf = flex_scanner_conf(Config), + case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers3 -> " @@ -745,8 +802,8 @@ flex_compact_dm_timers4(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("10", "21", "99"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), - case decode_message(megaco_compact_text_encoder, false, + Conf = flex_scanner_conf(Config), + case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers4 -> " @@ -764,8 +821,8 @@ flex_compact_dm_timers5(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("99", "23", "11"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), - case decode_message(megaco_compact_text_encoder, false, + Conf = flex_scanner_conf(Config), + case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers5 -> " @@ -783,8 +840,8 @@ flex_compact_dm_timers6(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("77", "09", "1"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), - case decode_message(megaco_compact_text_encoder, false, + Conf = flex_scanner_conf(Config), + case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers6 -> " @@ -802,8 +859,8 @@ flex_compact_dm_timers7(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("77", "09", "1", "99"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), - case decode_message(megaco_compact_text_encoder, false, + Conf = flex_scanner_conf(Config), + case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers7 -> " @@ -821,8 +878,8 @@ flex_compact_dm_timers8(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), M = build_dm_timers_message("01", "09", "01", "02"), B = list_to_binary(M), - Conf = flex_scanner_conf(Config), - case decode_message(megaco_compact_text_encoder, false, + Conf = flex_scanner_conf(Config), + case decode_message(megaco_compact_text_encoder, false, [?EC_V3,Conf], B) of {ok, M1} when is_record(M1,'MegacoMessage') -> t("flex_compact_dm_timers8 -> " @@ -863,7 +920,7 @@ get_dm_timers({transactions, T}) when is_list(T) -> get_dm_timers(Other) -> {error, {invalid_transactions, Other}}. -get_dm_timers1([{transactionRequest,T}|Ts]) +get_dm_timers1([{transactionRequest,T}|Ts]) when is_record(T,'TransactionRequest') -> case get_dm_timers2(T) of {ok, Timers} -> @@ -939,45 +996,45 @@ bin_test_msgs(suite) -> []; bin_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(binary) ++ - msgs5(binary) ++ - msgs6(binary) ++ - msgs7(binary) ++ + Msgs = + msgs1a(binary) ++ + msgs5(binary) ++ + msgs6(binary) ++ + msgs7(binary) ++ msgs8(binary), - %% Msgs = msgs6(binary), + %% Msgs = msgs6(binary), DynamicDecode = false, test_msgs(megaco_binary_encoder, DynamicDecode, ?EC, Msgs). - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ber_test_msgs(suite) -> []; ber_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(binary) ++ - msgs5(binary) ++ - msgs6(binary) ++ - msgs7(binary) ++ + Msgs = + msgs1a(binary) ++ + msgs5(binary) ++ + msgs6(binary) ++ + msgs7(binary) ++ msgs8(binary), %% Msgs = msgs7(binary), DynamicDecode = false, test_msgs(megaco_ber_encoder, DynamicDecode, ?EC, Msgs). - + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% per_test_msgs(suite) -> []; per_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(binary) ++ - msgs5(binary) ++ - msgs6(binary) ++ - msgs7(binary) ++ + Msgs = + msgs1a(binary) ++ + msgs5(binary) ++ + msgs6(binary) ++ + msgs7(binary) ++ msgs8(binary), DynamicDecode = false, test_msgs(megaco_per_encoder, DynamicDecode, ?EC, Msgs). @@ -989,16 +1046,16 @@ erl_dist_m_test_msgs(suite) -> []; erl_dist_m_test_msgs(Config) when is_list(Config) -> ?ACQUIRE_NODES(1, Config), - Msgs = - msgs1a(erlang) ++ - msgs1b(erlang) ++ - msgs3525(erlang) ++ - msgs5(erlang) ++ - msgs6(erlang) ++ - msgs7(erlang) ++ + Msgs = + msgs1a(erlang) ++ + msgs1b(erlang) ++ + msgs3525(erlang) ++ + msgs5(erlang) ++ + msgs6(erlang) ++ + msgs7(erlang) ++ msgs8(erlang), DynamicDecode = false, - Conf = [megaco_compressed], + Conf = [megaco_compressed], test_msgs(megaco_erl_dist_encoder, DynamicDecode, Conf, Msgs). @@ -1041,7 +1098,7 @@ compact_otp4011_msg2(Config) when is_list(Config) -> %% -------------------------------------------------------------- %% Observe that this decode SHALL fail -%% +%% compact_otp4011_msg3(suite) -> []; @@ -1068,7 +1125,7 @@ compact_otp4011(Msg, Conf) -> {error, {unexpected_decode_result, Crap}} end, megaco_codec_test_lib:expect_decode(Msg, Decode, Check). - + compact_otp4011_chk1(R1) -> case lists:keysearch(reason, 1, R1) of {value, {reason, R2}} -> @@ -1076,13 +1133,13 @@ compact_otp4011_chk1(R1) -> false -> {error, {unexpected_result, R1}} end. - -compact_otp4011_chk2({0, ParserMod, {ParserFunc, [A, B]}}) + +compact_otp4011_chk2({0, ParserMod, {ParserFunc, [A, B]}}) when (ParserMod =:= megaco_text_parser_v3) andalso (ParserFunc =:= do_merge_control_streamParms) andalso is_list(A) andalso is_record(B, 'LocalControlDescriptor') -> - SM = B#'LocalControlDescriptor'.streamMode, + SM = B#'LocalControlDescriptor'.streamMode, case lists:keysearch(mode, 1, A) of {value, {mode, _Mode}} when SM /= asn1_NOVALUE -> ok; @@ -1114,7 +1171,7 @@ compact_otp4013_msg1(Config) when is_list(Config) -> compact_otp4013(Msg) -> compact_otp4013(Msg, ?EC). -compact_otp4013(Msg, Conf) -> +compact_otp4013(Msg, Conf) -> Codec = megaco_compact_text_encoder, Decode = fun(B) -> decode_message(Codec, false, Conf, B) end, Check = fun(Reason) when is_list(Reason) -> @@ -1143,8 +1200,8 @@ compact_otp4013_chk1(Reason) -> %% -------------------------------------------------------------- -%% -%% +%% +%% compact_otp4085_msg1(suite) -> []; compact_otp4085_msg1(Config) when is_list(Config) -> @@ -1173,9 +1230,9 @@ compact_otp4085_1(Msg, Conf) -> compact_otp4085_1_chk1(Reason) -> case lists:keysearch(reason, 1, Reason) of - {value, {reason, {Line, Module, Crap}}} when is_integer(Line) and + {value, {reason, {Line, Module, Crap}}} when is_integer(Line) and is_atom(Module) -> - Crap2 = + Crap2 = case (catch lists:flatten(Crap)) of L when is_list(L) -> L; @@ -1187,7 +1244,7 @@ compact_otp4085_1_chk1(Reason) -> "~n Module: ~p" "~n Crap2: ~p", [Line, Module, Crap2]), ok; - {value, BadReason} -> + {value, BadReason} -> e("compact_otp4085_1_chk1 -> error: " "~n BadReason: ~p", [BadReason]), {error, {unexpected_reason, Reason}}; @@ -1228,8 +1285,8 @@ compact_otp4085_2(Msg, Conf) -> %% This message lack the ending parentesis (}). compact_otp4085_erroneous_msg() -> - M = "!/" - ?VERSION_STR + M = "!/" + ?VERSION_STR " ML T=11223342{C=${A=${M{O{MO=SR,RV=OFF,RG=OFF},L{v=0," "c=ATM NSAP $ ," "a=eecid:$ ," @@ -1238,8 +1295,8 @@ compact_otp4085_erroneous_msg() -> M. %% -------------------------------------------------------------- -%% -%% +%% +%% compact_otp4280_msg1(suite) -> []; compact_otp4280_msg1(Config) when is_list(Config) -> @@ -1265,7 +1322,7 @@ compact_otp4280(Msg, Conf) -> {error, {unexpected_decode_result, Crap}} end, megaco_codec_test_lib:expect_decode_only(Msg, Decode, Check). - + compact_otp4280_msg() -> M = "!/" ?VERSION_STR @@ -1278,7 +1335,7 @@ compact_otp4280_msg() -> %% -------------------------------------------------------------- %% This ticket is about comments in a message -%% +%% compact_otp4299_msg1(suite) -> []; compact_otp4299_msg1(Config) when is_list(Config) -> @@ -1323,7 +1380,7 @@ compact_otp4299_msg() -> %% -------------------------------------------------------------- -%% +%% compact_otp4359_msg1(suite) -> []; @@ -1332,8 +1389,8 @@ compact_otp4359_msg1(Config) when is_list(Config) -> %% put(dbg,true), d("compact_otp4359_msg1 -> entry", []), ?ACQUIRE_NODES(1, Config), - Msg = compact_otp4359_msg(), - ok = compact_otp4359(Msg), + Msg = compact_otp4359_msg(), + ok = compact_otp4359(Msg), %% erase(severity), %% erase(dbg), ok. @@ -1354,7 +1411,7 @@ compact_otp4359(Msg, Conf) -> {error, {unexpected_decode_result, Crap}} end, megaco_codec_test_lib:expect_decode_only(Msg, Decode, Check). - + compact_otp4359_chk(#'MegacoMessage'{mess = Mess}) -> case Mess#'Message'.messageBody of {transactions, Trans} -> @@ -1375,7 +1432,7 @@ compact_otp4359_chk(#'MegacoMessage'{mess = Mess}) -> %% -------------------------------------------------------------- -%% +%% compact_otp4920_msg0(suite) -> []; compact_otp4920_msg0(Config) when is_list(Config) -> @@ -1610,7 +1667,7 @@ compact_otp4920_msg25(Config) when is_list(Config) -> %% erase(dbg), ok. - + compact_otp4920(Msg, ExpectedReason) -> compact_otp4920(Msg, ?EC, ExpectedReason). @@ -1631,7 +1688,7 @@ compact_otp4920_chk(Reason, ExpectedReason) -> ExpectedReason -> ok; _ -> - {error, {unexpected_decode_reason, + {error, {unexpected_decode_reason, {ActualReason, ExpectedReason}}} end; {value, {reason, {_Mod, ActualReason}}} -> @@ -1639,7 +1696,7 @@ compact_otp4920_chk(Reason, ExpectedReason) -> ExpectedReason -> ok; _ -> - {error, {unexpected_decode_reason, + {error, {unexpected_decode_reason, {ActualReason, ExpectedReason}}} end; {value, UnknownReason} -> @@ -1732,7 +1789,7 @@ compact_otp4920_msg25() -> %% -------------------------------------------------------------- -%% +%% compact_otp5186_msg01(suite) -> []; @@ -1811,7 +1868,7 @@ compact_otp5186_msg06(Config) when is_list(Config) -> ok. %% -- - + compact_otp5186_msg01() -> "!/" ?VERSION_STR " <mg5>\nP=67111298{C=2699{AV=mg5_ipeph/0x0f0001{}}}". @@ -1959,7 +2016,7 @@ compact_otp5793_msg01(Config) when is_list(Config) -> ok = ticket_compact_encode_decode_ok(pretty_otp5793_msg1()), %% erase(severity), %% erase(dbg), - ok. + ok. %% -------------------------------------------------------------- @@ -1983,8 +2040,8 @@ compact_otp5836_msg1() -> {'Message', ?VERSION, {deviceName,"bs_sbg_4/34"}, - {transactions, - [{transactionReply, + {transactions, + [{transactionReply, {'TransactionReply', 12, asn1_NOVALUE, @@ -2172,6 +2229,393 @@ compact_otp6017_msg(CID) when is_integer(CID) -> "{SC=root{SV{MT=RS,RE=901}}}}". +%% -------------------------------------------------------------- +%% +compact_otp16818_msg01(suite) -> + []; +compact_otp16818_msg01(Config) when is_list(Config) -> + d("compact_otp16818_msg01 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg01() ), + ok. + +compact_otp16818_msg01() -> + compact_otp16818_msg("a"). + + +%% -- + +compact_otp16818_msg02(suite) -> + []; +compact_otp16818_msg02(Config) when is_list(Config) -> + d("compact_otp16818_msg02 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg02() ), + ok. + +compact_otp16818_msg02() -> + compact_otp16818_msg("b"). + + +%% -- + +compact_otp16818_msg03(suite) -> + []; +compact_otp16818_msg03(Config) when is_list(Config) -> + d("compact_otp16818_msg03 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg03() ), + ok. + +compact_otp16818_msg03() -> + compact_otp16818_msg("c"). + + +%% -- + +compact_otp16818_msg04(suite) -> + []; +compact_otp16818_msg04(Config) when is_list(Config) -> + d("compact_otp16818_msg04 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg04() ), + ok. + +compact_otp16818_msg04() -> + compact_otp16818_msg("d"). + + +%% -- + +compact_otp16818_msg05(suite) -> + []; +compact_otp16818_msg05(Config) when is_list(Config) -> + d("compact_otp16818_msg05 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg05() ), + ok. + +compact_otp16818_msg05() -> + compact_otp16818_msg("e"). + + +%% -- + +compact_otp16818_msg06(suite) -> + []; +compact_otp16818_msg06(Config) when is_list(Config) -> + d("compact_otp16818_msg06 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg06() ), + ok. + +compact_otp16818_msg06() -> + compact_otp16818_msg("f"). + + +%% -- + +compact_otp16818_msg11(suite) -> + []; +compact_otp16818_msg11(Config) when is_list(Config) -> + d("compact_otp16818_msg11 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg11() ), + ok. + +compact_otp16818_msg11() -> + compact_otp16818_msg("000a"). + + +%% -- + +compact_otp16818_msg12(suite) -> + []; +compact_otp16818_msg12(Config) when is_list(Config) -> + d("compact_otp16818_msg12 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg12() ), + ok. + +compact_otp16818_msg12() -> + compact_otp16818_msg("000b"). + + +%% -- + +compact_otp16818_msg13(suite) -> + []; +compact_otp16818_msg13(Config) when is_list(Config) -> + d("compact_otp16818_msg13 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg13() ), + ok. + +compact_otp16818_msg13() -> + compact_otp16818_msg("000c"). + + +%% -- + +compact_otp16818_msg14(suite) -> + []; +compact_otp16818_msg14(Config) when is_list(Config) -> + d("compact_otp16818_msg14 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg14() ), + ok. + +compact_otp16818_msg14() -> + compact_otp16818_msg("000d"). + + +%% -- + +compact_otp16818_msg15(suite) -> + []; +compact_otp16818_msg15(Config) when is_list(Config) -> + d("compact_otp16818_msg15 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg15() ), + ok. + +compact_otp16818_msg15() -> + compact_otp16818_msg("000e"). + + +%% -- + +compact_otp16818_msg16(suite) -> + []; +compact_otp16818_msg16(Config) when is_list(Config) -> + d("compact_otp16818_msg16 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg16() ), + ok. + +compact_otp16818_msg16() -> + compact_otp16818_msg("000f"). + + +%% -- + +compact_otp16818_msg21(suite) -> + []; +compact_otp16818_msg21(Config) when is_list(Config) -> + d("compact_otp16818_msg21 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg21() ), + ok. + +compact_otp16818_msg21() -> + compact_otp16818_msg("0a12"). + + +%% -- + +compact_otp16818_msg22(suite) -> + []; +compact_otp16818_msg22(Config) when is_list(Config) -> + d("compact_otp16818_msg22 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg22() ), + ok. + +compact_otp16818_msg22() -> + compact_otp16818_msg("0b12"). + + +%% -- + +compact_otp16818_msg23(suite) -> + []; +compact_otp16818_msg23(Config) when is_list(Config) -> + d("compact_otp16818_msg23 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg23() ), + ok. + +compact_otp16818_msg23() -> + compact_otp16818_msg("0c12"). + + +%% -- + +compact_otp16818_msg24(suite) -> + []; +compact_otp16818_msg24(Config) when is_list(Config) -> + d("compact_otp16818_msg24 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg24() ), + ok. + +compact_otp16818_msg24() -> + compact_otp16818_msg("0d12"). + + +%% -- + +compact_otp16818_msg25(suite) -> + []; +compact_otp16818_msg25(Config) when is_list(Config) -> + d("compact_otp16818_msg25 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg25() ), + ok. + +compact_otp16818_msg25() -> + compact_otp16818_msg("0e12"). + + +%% -- + +compact_otp16818_msg26(suite) -> + []; +compact_otp16818_msg26(Config) when is_list(Config) -> + d("compact_otp16818_msg26 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg26() ), + ok. + +compact_otp16818_msg26() -> + compact_otp16818_msg("0f12"). + + +%% -- + +compact_otp16818_msg31(suite) -> + []; +compact_otp16818_msg31(Config) when is_list(Config) -> + d("compact_otp16818_msg31 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg31() ), + ok. + +compact_otp16818_msg31() -> + compact_otp16818_msg("a123"). + + +%% -- + +compact_otp16818_msg32(suite) -> + []; +compact_otp16818_msg32(Config) when is_list(Config) -> + d("compact_otp16818_msg32 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg32() ), + ok. + +compact_otp16818_msg32() -> + compact_otp16818_msg("b123"). + + +%% -- + +compact_otp16818_msg33(suite) -> + []; +compact_otp16818_msg33(Config) when is_list(Config) -> + d("compact_otp16818_msg33 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg33() ), + ok. + +compact_otp16818_msg33() -> + compact_otp16818_msg("c123"). + + +%% -- + +compact_otp16818_msg34(suite) -> + []; +compact_otp16818_msg34(Config) when is_list(Config) -> + d("compact_otp16818_msg34 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg34() ), + ok. + +compact_otp16818_msg34() -> + compact_otp16818_msg("d123"). + + +%% -- + +compact_otp16818_msg35(suite) -> + []; +compact_otp16818_msg35(Config) when is_list(Config) -> + d("compact_otp16818_msg35 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg35() ), + ok. + +compact_otp16818_msg35() -> + compact_otp16818_msg("e123"). + + +%% -- + +compact_otp16818_msg36(suite) -> + []; +compact_otp16818_msg36(Config) when is_list(Config) -> + d("compact_otp16818_msg36 -> entry", []), + ok = compact_otp16818( compact_otp16818_msg36() ), + ok. + +compact_otp16818_msg36() -> + compact_otp16818_msg("f123"). + + +%% ----- + +compact_otp16818( Msg ) -> + Bin = erlang:list_to_binary(Msg), + try megaco_compact_text_encoder:decode_message([], dynamic, Bin) of + {ok, _} -> + ok; + {error, _} = ERROR -> + ERROR + catch + C:E:S -> + {error, {C, E, S}} + end. + +compact_otp16818_msg(X) when is_list(X) -> + "!/3 [2409:8050:5005:1243:1011::" ++ X ++ + "] T=2523{C=-{SC=ROOT{SV{MT=RS,RE=901,PF=ETSI_BGF/2,V=3}}}}". + + +%% -------------------------------------------------------------- + +compact_erl1405_msg01(suite) -> + []; +compact_erl1405_msg01(Config) when is_list(Config) -> + put(severity,trc), + put(dbg,true), + d("compact_erl1405_msg01 -> entry", []), + ?ACQUIRE_NODES(1, Config), + ok = compact_erl1405(statisticsDescriptor), + erase(severity), + erase(dbg), + ok. + +compact_erl1405_msg02(suite) -> + []; +compact_erl1405_msg02(Config) when is_list(Config) -> + put(severity,trc), + put(dbg,true), + d("compact_erl1405_msg02 -> entry", []), + ?ACQUIRE_NODES(1, Config), + ok = compact_erl1405({statisticsDescriptor, []}), + erase(severity), + erase(dbg), + ok. + +compact_erl1405(Descriptor) -> + ticket_compact_encode_decode_ok( erl1405_msg(Descriptor) ). + +erl1405_msg(Descriptor) -> + #'MegacoMessage'{ + mess = #'Message'{ + version = ?VERSION, + mId = {deviceName, "test"}, + messageBody = {transactions, [ + {transactionRequest, #'TransactionRequest'{ + transactionId = 1, + actions = [ + #'ActionRequest'{ + contextId = ?megaco_choose_context_id, + commandRequests = [ + #'CommandRequest'{ + command = {addReq, #'AmmRequest'{ + terminationID = [#megaco_term_id{id = ["test"]}], + descriptors = [Descriptor] + }} + } + ] + } + ] + }} + ]} + } + }. + + %% ============================================================== %% %% F l e x C o m p a c t T e s t c a s e s @@ -2191,7 +2635,6 @@ flex_compact_otp4299_msg1(Config) when is_list(Config) -> %% erase(dbg), ok. - flex_compact_otp7431_msg01(suite) -> []; flex_compact_otp7431_msg01(Config) when is_list(Config) -> @@ -2394,8 +2837,8 @@ pretty_otp4632_msg4(Config) when is_list(Config) -> %% put(dbg,true), d("pretty_otp4632_msg4 -> entry", []), ?ACQUIRE_NODES(1, Config), - Check = fun(B2, B1) -> pretty_otp4632_msg4_chk(B1, B2) end, - ok = ticket_pretty_decode_encode_only(pretty_otp4632_msg4(), Check), + Check = fun(B2, B1) -> pretty_otp4632_msg4_chk(B1, B2) end, + ok = ticket_pretty_decode_encode_only(pretty_otp4632_msg4(), Check), %% erase(severity), %% erase(dbg), ok. @@ -2412,13 +2855,13 @@ pretty_otp4632_msg4_chk(B1, B2) when is_binary(B1) and is_binary(B2) -> %% "S1: ~s~n" %% "S2: ~s~n", [S1, S2]), pretty_otp4632_msg4_chk(S1, S2); - + pretty_otp4632_msg4_chk([], []) -> - messages_not_eq; + messages_not_eq; pretty_otp4632_msg4_chk([], Rest2) -> - {messages_not_eq2, Rest2}; + {messages_not_eq2, Rest2}; pretty_otp4632_msg4_chk(Rest1, []) -> - {messages_not_eq1, Rest1}; + {messages_not_eq1, Rest1}; pretty_otp4632_msg4_chk([$R,$e,$a,$s,$o,$n,$ ,$=,$ ,$",$9,$0,$1,$"|_Rest1], [$R,$e,$a,$s,$o,$n,$ ,$=,$ ,$9,$0,$1|_Rest2]) -> ok; @@ -2427,7 +2870,7 @@ pretty_otp4632_msg4_chk([_H1|Rest1], [_H2|Rest2]) -> %% -------------------------------------------------------------- -%% +%% pretty_otp4710_msg1(suite) -> []; pretty_otp4710_msg1(Config) when is_list(Config) -> @@ -2451,8 +2894,8 @@ pretty_otp4710_msg2(Config) when is_list(Config) -> %% put(dbg,true), d("pretty_otp4710_msg2 -> entry", []), ?ACQUIRE_NODES(1, Config), - Check = fun(B1, B2) -> pretty_otp4710_msg2_chk(B1, B2) end, - ok = ticket_pretty_decode_encode_only(pretty_otp4710_msg2(), Check), + Check = fun(B1, B2) -> pretty_otp4710_msg2_chk(B1, B2) end, + ok = ticket_pretty_decode_encode_only(pretty_otp4710_msg2(), Check), %% erase(severity), %% erase(dbg), ok. @@ -2461,8 +2904,8 @@ pretty_otp4710_msg2() -> "Authentication = 0xEFCDAB89:0x12345678:0x1234567889ABCDEF76543210\nMEGACO/" ?VERSION_STR " [124.124.124.222]\nTransaction = 9998 {\n\tContext = - {\n\t\tServiceChange = root {\n\t\t\tServices {\n\t\t\t\tMethod = Restart,\n\t\t\t\tServiceChangeAddress = 55555,\n\t\t\t\tProfile = resgw/1,\n\t\t\t\tReason = \"901 mg col boot\"\n\t\t\t}\n\t\t}\n\t}\n}". pretty_otp4710_msg2_chk(B1, B2) when is_binary(B1) and is_binary(B2) -> - S1 = binary_to_list(B1), - S2 = binary_to_list(B2), + S1 = binary_to_list(B1), + S2 = binary_to_list(B2), pretty_otp4710_msg2_chk(S1, S2); pretty_otp4710_msg2_chk(Msg, Msg) -> @@ -2489,7 +2932,7 @@ pretty_otp4710_msg2_chk_ah([C|R], Acc) -> %% -------------------------------------------------------------- -%% +%% pretty_otp4945_msg1(suite) -> []; pretty_otp4945_msg1(Config) when is_list(Config) -> @@ -2509,15 +2952,15 @@ pretty_otp4945_msg1() -> ServiceChange = ROOT { Services { Method = Restart, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". - + pretty_otp4945_msg1_chk(R) when is_list(R) -> - ExpMissing = [serviceChangeReason], + ExpMissing = [serviceChangeReason], Check = fun(Reason) -> pretty_otp4945_chk(Reason, ExpMissing) end, @@ -2543,20 +2986,20 @@ pretty_otp4945_msg2() -> ServiceChange = ROOT { Services { Reason = 901, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". pretty_otp4945_msg2_chk(R) when is_list(R) -> - ExpMissing = [serviceChangeMethod], + ExpMissing = [serviceChangeMethod], Check = fun(Reason) -> pretty_otp4945_chk(Reason, ExpMissing) end, ticket_check_decode_only_error_reason(R, Check). - + pretty_otp4945_msg3(suite) -> []; @@ -2576,21 +3019,21 @@ pretty_otp4945_msg3() -> Context = - { ServiceChange = ROOT { Services { - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". pretty_otp4945_msg3_chk(R) when is_list(R) -> - ExpMissing = [serviceChangeReason, serviceChangeMethod], + ExpMissing = [serviceChangeReason, serviceChangeMethod], Check = fun(Reason) -> pretty_otp4945_chk(Reason, ExpMissing) end, ticket_check_decode_only_error_reason(R, Check). - + pretty_otp4945_msg4(suite) -> []; pretty_otp4945_msg4(Config) when is_list(Config) -> @@ -2610,13 +3053,13 @@ pretty_otp4945_msg4() -> Services { Method = Restart, Reason = 901, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". - + pretty_otp4945_msg5(suite) -> []; @@ -2639,13 +3082,13 @@ pretty_otp4945_msg5() -> Method = Restart, Reason = 901, Profile = ResGW/1, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/2 } } - } + } }". - + pretty_otp4945_msg5_chk(R) when is_list(R) -> Check = fun({at_most_once_serviceChangeParm, {profile, _, _}}) -> ok; @@ -2675,12 +3118,12 @@ pretty_otp4945_msg6() -> Services { Method = Restart, Reason = 901, - ServiceChangeAddress = 55555, - MgcIdToTry = kalle, + ServiceChangeAddress = 55555, + MgcIdToTry = kalle, Profile = ResGW/1 } } - } + } }". pretty_otp4945_msg6_chk(R) when is_list(R) -> @@ -2690,9 +3133,9 @@ pretty_otp4945_msg6_chk(R) when is_list(R) -> {error, {unexpected_reason, Reason}} end, ticket_check_decode_only_error_reason(R, Check). - -pretty_otp4945_chk({missing_required_serviceChangeParm, Missing}, + +pretty_otp4945_chk({missing_required_serviceChangeParm, Missing}, ExpMissing) when is_list(Missing) -> case ExpMissing -- Missing of [] -> @@ -2705,7 +3148,7 @@ pretty_otp4945_chk(Reason, _ExpMissing) -> %% -------------------------------------------------------------- -%% +%% pretty_otp4949_msg1(suite) -> []; pretty_otp4949_msg1(Config) when is_list(Config) -> @@ -2723,13 +3166,13 @@ pretty_otp4949_msg1() -> Context = - { ServiceChange = ROOT { Services { - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". - + pretty_otp4949_msg2(suite) -> []; @@ -2750,13 +3193,13 @@ pretty_otp4949_msg2() -> ServiceChange = ROOT { Services { Profile = ResGW/1, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/2 } } - } + } }". - + pretty_otp4949_msg2_chk(R) when is_list(R) -> Check = fun({at_most_once_servChgReplyParm, {profile, _, _}}) -> ok; @@ -2784,12 +3227,12 @@ pretty_otp4949_msg3() -> Context = - { ServiceChange = ROOT { Services { - ServiceChangeAddress = 55555, - MgcIdToTry = kalle, + ServiceChangeAddress = 55555, + MgcIdToTry = kalle, Profile = ResGW/1 } } - } + } }". pretty_otp4949_msg3_chk(R) when is_list(R) -> @@ -2799,10 +3242,10 @@ pretty_otp4949_msg3_chk(R) when is_list(R) -> {error, {unexpected_reason, Reason}} end, ticket_check_decode_only_error_reason(R, Check). - + %% -------------------------------------------------------------- -%% +%% pretty_otp5042_msg1(suite) -> []; pretty_otp5042_msg1(Config) when is_list(Config) -> @@ -2817,17 +3260,17 @@ pretty_otp5042_msg1(Config) when is_list(Config) -> pretty_otp5042_msg1() -> "MEGACO/" ?VERSION_STR " <CATAPULT>:2944 -Transaction = 102 { -Context = 5 { Notify = MUX/1 { ObservedEvents = 1 { +Transaction = 102 { +Context = 5 { Notify = MUX/1 { ObservedEvents = 1 { h245bh/h245msgin { Stream = 1 , h245enc = 0270020600088175000653401004100403E802E00180018001780680000034301160000700088175010101007A0100020001800001320000C0000219D005027F0070500100040100021080000319D005027F00504001008000041C001250000700088175010000400280010003000880000518AA027F400006850130008011020100000001030002000300040005000006 - } } + } } } } }". - + %% -------------------------------------------------------------- -%% +%% pretty_otp5068_msg1(suite) -> []; pretty_otp5068_msg1(Config) when is_list(Config) -> @@ -2883,11 +3326,11 @@ pretty_otp5068_msg1() -> } } }. - + %% -------------------------------------------------------------- -%% +%% pretty_otp5085_msg1(suite) -> []; pretty_otp5085_msg1(Config) when is_list(Config) -> @@ -2912,7 +3355,7 @@ pretty_otp5085_msg1() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, {'ErrorDescriptor',504,asn1_NOVALUE}, asn1_NOVALUE, @@ -2952,7 +3395,7 @@ pretty_otp5085_msg2() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, asn1_NOVALUE, asn1_NOVALUE, @@ -2992,7 +3435,7 @@ pretty_otp5085_msg3() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, asn1_NOVALUE, #'ContextRequest'{priority = 3}, @@ -3032,11 +3475,11 @@ pretty_otp5085_msg4() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, asn1_NOVALUE, asn1_NOVALUE, - [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, + [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, {notifyReply, cre_NotifyRep([#megaco_term_id{id = ?A5555}])}] } ] @@ -3073,11 +3516,11 @@ pretty_otp5085_msg5() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, asn1_NOVALUE, #'ContextRequest'{priority = 5}, - [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, + [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, {notifyReply, cre_NotifyRep([#megaco_term_id{id = ?A5555}])}] } ] @@ -3114,11 +3557,11 @@ pretty_otp5085_msg6() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, {'ErrorDescriptor',504,asn1_NOVALUE}, #'ContextRequest'{priority = 6}, - [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, + [{addReply, cre_AmmsReply([#megaco_term_id{id = ?A4444}])}, {notifyReply, cre_NotifyRep([#megaco_term_id{id = ?A5555}])}] } ] @@ -3155,7 +3598,7 @@ pretty_otp5085_msg7() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, {'ErrorDescriptor',504,asn1_NOVALUE}, #'ContextRequest'{priority = 7}, @@ -3199,12 +3642,12 @@ pretty_otp5085_msg8() -> 230, asn1_NOVALUE, {actionReplies, - [{'ActionReply', + [{'ActionReply', 400, {'ErrorDescriptor',504,asn1_NOVALUE}, - #'ContextRequest'{priority = 8, + #'ContextRequest'{priority = 8, emergency = true, - topologyReq = + topologyReq = [#'TopologyRequest'{terminationFrom = From1, terminationTo = To1, topologyDirection = bothway}, @@ -3227,7 +3670,7 @@ pretty_otp5085_msg8() -> %% -------------------------------------------------------------- -%% +%% pretty_otp5600_msg1(suite) -> []; pretty_otp5600_msg1(Config) when is_list(Config) -> @@ -3239,17 +3682,17 @@ pretty_otp5600_msg1(Config) when is_list(Config) -> %% erase(severity), %% erase(dbg), ok. - + pretty_otp5600_msg1() -> SRE = #'SecondRequestedEvent'{ pkgdName = "al/on", evParList = [] }, - + SED = #'SecondEventsDescriptor'{ requestID = 2, eventList = [ SRE ] }, - + SIG = { signal, #'Signal'{ signalName = "cg/dt", sigParList = [] } }, - + RA = #'RequestedActions'{ secondEvent = SED, signalsDescriptor = [ SIG ] }, @@ -3288,35 +3731,35 @@ pretty_otp5600_msg2(Config) when is_list(Config) -> %% erase(severity), %% erase(dbg), ok. - + pretty_otp5600_msg2() -> SIG = { signal, #'Signal'{ signalName = "cg/dt", sigParList = [] } }, SRA = #'SecondRequestedActions'{ signalsDescriptor = [ SIG ] }, - + SRE = #'SecondRequestedEvent'{ pkgdName = "al/on", eventAction = SRA, evParList = [] }, - + SED = #'SecondEventsDescriptor'{ requestID = 2, eventList = [ SRE ] }, - + RA = #'RequestedActions'{ secondEvent = SED }, - + RE = #'RequestedEvent'{ pkgdName = "al/of", eventAction = RA, evParList = [] }, - + EV = #'EventsDescriptor'{ requestID = 1, eventList = [ RE ] }, - + TermID = {megaco_term_id, true, [[$*]] }, - + AMMR = #'AmmRequest'{ terminationID = [ TermID ], descriptors = [ { eventsDescriptor, EV } ] }, - + CR = #'CommandRequest'{command = {modReq, AMMR}}, - + AR = #'ActionRequest'{contextId = ?megaco_null_context_id, commandRequests = [CR]}, ARs = [AR], @@ -3329,7 +3772,7 @@ pretty_otp5600_msg2() -> %% -------------------------------------------------------------- -%% +%% pretty_otp5601_msg1(suite) -> []; pretty_otp5601_msg1(Config) when is_list(Config) -> @@ -3382,7 +3825,7 @@ pretty_otp5601_msg1() -> %% -------------------------------------------------------------- -%% +%% pretty_otp5793_msg01(suite) -> []; pretty_otp5793_msg01(Config) when is_list(Config) -> @@ -3443,7 +3886,7 @@ pretty_otp5793_msg1() -> %% -------------------------------------------------------------- -%% +%% pretty_otp5803_msg01(suite) -> []; pretty_otp5803_msg01(Config) when is_list(Config) -> @@ -3548,7 +3991,7 @@ pretty_otp5803_msg2() -> %% -------------------------------------------------------------- -%% +%% pretty_otp5805_msg01(suite) -> []; pretty_otp5805_msg01(Config) when is_list(Config) -> @@ -3573,7 +4016,7 @@ Transaction=1{ %% -------------------------------------------------------------- -%% +%% pretty_otp5836_msg01(suite) -> []; pretty_otp5836_msg01(Config) when is_list(Config) -> @@ -3588,7 +4031,7 @@ pretty_otp5836_msg01(Config) when is_list(Config) -> %% -------------------------------------------------------------- -%% +%% pretty_otp5882_msg01(suite) -> []; pretty_otp5882_msg01(Config) when is_list(Config) -> @@ -3601,7 +4044,7 @@ pretty_otp5882_msg01(Config) when is_list(Config) -> %% erase(severity), %% erase(dbg), ok. - + pretty_otp5882_msg01_chk({message_encode_failed, {error, {Reason, _}}, _}) -> case Reason of {invalid_LocalControlDescriptor, empty} -> @@ -3612,7 +4055,7 @@ pretty_otp5882_msg01_chk({message_encode_failed, {error, {Reason, _}}, _}) -> pretty_otp5882_msg01_chk(Reason) -> {error, {unexpected_reason, Reason}}. - + pretty_otp5882_msg01() -> LCD = #'LocalControlDescriptor'{}, % Create illegal LCD Parms = cre_StreamParms(LCD), @@ -3630,11 +4073,11 @@ pretty_otp5882_msg01() -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - + %% -------------------------------------------------------------- -%% +%% pretty_otp6490_msg01(suite) -> []; pretty_otp6490_msg01(Config) when is_list(Config) -> @@ -3731,7 +4174,7 @@ pretty_otp6490_msg02() -> PkgdName = ?MSG_LIB:cre_PkgdName("foo", "a"), EvName = ?MSG_LIB:cre_EventName(PkgdName), EvSpec = ?MSG_LIB:cre_EventSpec(EvName, [EvPar]), - EvSpecs = [EvSpec], + EvSpecs = [EvSpec], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). @@ -3742,7 +4185,7 @@ pretty_otp6490_msg03() -> PkgdName = ?MSG_LIB:cre_PkgdName("foo", "a"), EvName = ?MSG_LIB:cre_EventName(PkgdName), EvSpec = ?MSG_LIB:cre_EventSpec(EvName, [EvPar1,EvPar2,EvPar3]), - EvSpecs = [EvSpec], + EvSpecs = [EvSpec], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). @@ -3757,7 +4200,7 @@ pretty_otp6490_msg04() -> PkgdName2 = ?MSG_LIB:cre_PkgdName("bar", "b"), EvName2 = ?MSG_LIB:cre_EventName(PkgdName2), EvSpec2 = ?MSG_LIB:cre_EventSpec(EvName2, [EvPar4]), - EvSpecs = [EvSpec1,EvSpec2], + EvSpecs = [EvSpec1,EvSpec2], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). @@ -3766,7 +4209,7 @@ pretty_otp6490_msg05() -> PkgdName = ?MSG_LIB:cre_PkgdName("foo", root), EvName = ?MSG_LIB:cre_EventName(PkgdName), EvSpec = ?MSG_LIB:cre_EventSpec(EvName, [EvPar]), - EvSpecs = [EvSpec], + EvSpecs = [EvSpec], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). @@ -3775,7 +4218,7 @@ pretty_otp6490_msg06() -> PkgdName = ?MSG_LIB:cre_PkgdName(root, root), EvName = ?MSG_LIB:cre_EventName(PkgdName), EvSpec = ?MSG_LIB:cre_EventSpec(EvName, [EvPar]), - EvSpecs = [EvSpec], + EvSpecs = [EvSpec], EBD = ?MSG_LIB:cre_EventBufferDescriptor(EvSpecs), pretty_otp6490_msg(EBD). @@ -3858,7 +4301,7 @@ pretty_otp7671(Msg, Conf, ExpectedEncode, ExpectedDecode, Check) -> ExpectedEncode, ExpectedDecode, Check). otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode) -> - Check = fun(M1, M2) -> + Check = fun(M1, M2) -> exit({unexpected_decode_result, M1, M2}) end, otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode, Check). @@ -3935,9 +4378,9 @@ pretty_otp7671_msg05() -> asn1_NOVALUE}}}]}}, asn1_NOVALUE,asn1_NOVALUE}]}]}}]}}}. -cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE, - mess = M1}, - #'MegacoMessage'{authHeader = asn1_NOVALUE, +cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE, + mess = M1}, + #'MegacoMessage'{authHeader = asn1_NOVALUE, mess = M2}) -> #'Message'{messageBody = Body1} = M1, #'Message'{messageBody = Body2} = M2, @@ -3953,11 +4396,11 @@ cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE, [#'CommandRequest'{command = Cmd2}] = CR2, {modReq, #'AmmRequest'{descriptors = Descs1}} = Cmd1, {modReq, #'AmmRequest'{descriptors = Descs2}} = Cmd2, - [{digitMapDescriptor, - #'DigitMapDescriptor'{digitMapName = Name, + [{digitMapDescriptor, + #'DigitMapDescriptor'{digitMapName = Name, digitMapValue = Value1}}] = Descs1, - [{digitMapDescriptor, - #'DigitMapDescriptor'{digitMapName = Name, + [{digitMapDescriptor, + #'DigitMapDescriptor'{digitMapName = Name, digitMapValue = Value2}}] = Descs2, #'DigitMapValue'{startTimer = asn1_NOVALUE, shortTimer = asn1_NOVALUE, @@ -3966,12 +4409,11 @@ cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE, durationTimer = asn1_NOVALUE} = Value1, asn1_NOVALUE = Value2, ok. - + %% -------------------------------------------------------------- %% - pretty_otp8114_msg01(suite) -> []; pretty_otp8114_msg01(Config) when is_list(Config) -> @@ -3990,12 +4432,12 @@ pretty_otp8114_msg01() -> otp8114(InitialMessage, Codec, Conf) -> Decode = fun(M) -> Codec:decode_message(Conf, M) end, Encode = fun(B) -> Codec:encode_message(Conf, B) end, - InitialData = InitialMessage, - Instructions = + InitialData = InitialMessage, + Instructions = [ %% List to binary megaco_codec_test_lib:expect_instruction( - "Convert (initial) message to a binary", + "Convert (initial) message to a binary", fun(Msg) when is_list(Msg) -> %% io:format("~s~n", [Msg]), {ok, list_to_binary(Msg)}; @@ -4007,7 +4449,7 @@ otp8114(InitialMessage, Codec, Conf) -> (Bad, _Msg) -> {error, {failed_to_binary, Bad}} end), - + %% Initial decode megaco_codec_test_lib:expect_instruction( "Decode (initial) message", @@ -4037,7 +4479,7 @@ otp8114(InitialMessage, Codec, Conf) -> (Bad, _) -> {error, {encode_failed, Bad}} end), - + %% Decode megaco_codec_test_lib:expect_instruction( "(final) Decode message", @@ -4056,6 +4498,38 @@ otp8114(InitialMessage, Codec, Conf) -> megaco_codec_test_lib:expect_exec(Instructions, InitialData). + +%% -------------------------------------------------------------- +%% + +pretty_erl1405_msg01(suite) -> + []; +pretty_erl1405_msg01(Config) when is_list(Config) -> + put(severity,trc), + put(dbg,true), + d("pretty_erl1405_msg01 -> entry", []), + ?ACQUIRE_NODES(1, Config), + ok = pretty_erl1405(statisticsDescriptor), + erase(severity), + erase(dbg), + ok. + +pretty_erl1405_msg02(suite) -> + []; +pretty_erl1405_msg02(Config) when is_list(Config) -> + put(severity,trc), + put(dbg,true), + d("pretty_erl1405_msg02 -> entry", []), + ?ACQUIRE_NODES(1, Config), + ok = pretty_erl1405({statisticsDescriptor, []}), + erase(severity), + erase(dbg), + ok. + +pretty_erl1405(Descriptor) -> + ticket_pretty_encode_decode_ok( erl1405_msg(Descriptor) ). + + %% ============================================================== %% %% F l e x P r e t t y T e s t c a s e s @@ -4075,7 +4549,7 @@ flex_pretty_otp5042_msg1(Config) when is_list(Config) -> %% -------------------------------------------------------------- -%% +%% flex_pretty_otp5085_msg1(suite) -> []; flex_pretty_otp5085_msg1(Config) when is_list(Config) -> @@ -4182,7 +4656,7 @@ flex_pretty_otp5085_msg8(Config) when is_list(Config) -> %% -------------------------------------------------------------- -%% +%% flex_pretty_otp5600_msg1(suite) -> []; flex_pretty_otp5600_msg1(Config) when is_list(Config) -> @@ -4211,7 +4685,7 @@ flex_pretty_otp5600_msg2(Config) when is_list(Config) -> %% -------------------------------------------------------------- -%% +%% flex_pretty_otp5601_msg1(suite) -> []; flex_pretty_otp5601_msg1(Config) when is_list(Config) -> @@ -4227,7 +4701,7 @@ flex_pretty_otp5601_msg1(Config) when is_list(Config) -> %% -------------------------------------------------------------- -%% +%% flex_pretty_otp5793_msg01(suite) -> []; flex_pretty_otp5793_msg01(Config) when is_list(Config) -> @@ -4243,7 +4717,7 @@ flex_pretty_otp5793_msg01(Config) when is_list(Config) -> %% -------------------------------------------------------------- -%% +%% flex_pretty_otp5803_msg01(suite) -> []; flex_pretty_otp5803_msg01(Config) when is_list(Config) -> @@ -4272,7 +4746,7 @@ flex_pretty_otp5803_msg02(Config) when is_list(Config) -> %% -------------------------------------------------------------- -%% +%% flex_pretty_otp5805_msg01(suite) -> []; flex_pretty_otp5805_msg01(Config) when is_list(Config) -> @@ -4288,7 +4762,7 @@ flex_pretty_otp5805_msg01(Config) when is_list(Config) -> %% -------------------------------------------------------------- -%% +%% flex_pretty_otp5836_msg01(suite) -> []; flex_pretty_otp5836_msg01(Config) when is_list(Config) -> @@ -4368,11 +4842,11 @@ flex_pretty_otp7431(Expected, Msg, Conf) -> otp7431(Expected, Codec, Msg0, Conf0) -> Bin0 = list_to_binary(Msg0), - Conf = [?EC_V3|Conf0], + Conf = [?EC_V3|Conf0], case decode_message(Codec, false, Conf, Bin0) of {ok, _Msg1} when Expected =:= ok -> io:format(" decoded", []); - {error, {bad_property_parm, Reason}} when (Expected =:= error) andalso + {error, {bad_property_parm, Reason}} when (Expected =:= error) andalso is_list(Reason) -> io:format("expected result: ~s", [Reason]), ok; @@ -4389,20 +4863,20 @@ flex_pretty_otp7431_msg1() -> Add = A4445 { Media { Stream = 1 { - Local { - v=0 - o=- 2890844526 2890842807 IN IP4 124.124.124.222 - s=- - t= 0 0 - c=IN IP4 124.124.124.222 - m=audio 2222 RTP/AVP 4 - a=ptime:30 - a=recvonly + Local { + v=0 + o=- 2890844526 2890842807 IN IP4 124.124.124.222 + s=- + t= 0 0 + c=IN IP4 124.124.124.222 + m=audio 2222 RTP/AVP 4 + a=ptime:30 + a=recvonly } ; RTP profile for G.723.1 is 4 } } } - } + } }". flex_pretty_otp7431_msg2() -> @@ -4412,19 +4886,19 @@ flex_pretty_otp7431_msg2() -> Add = A4445 { Media { Stream = 1 { - Local { - v=0 - o=- 2890844526 2890842807 IN IP4 124.124.124.222 - s=- - t= 0 0 - c=IN IP4 124.124.124.222 - m=audio 2222 RTP/AVP 4 - a=ptime:30 + Local { + v=0 + o=- 2890844526 2890842807 IN IP4 124.124.124.222 + s=- + t= 0 0 + c=IN IP4 124.124.124.222 + m=audio 2222 RTP/AVP 4 + a=ptime:30 a= } } } } - } + } }". flex_pretty_otp7431_msg3() -> @@ -4434,19 +4908,19 @@ flex_pretty_otp7431_msg3() -> Add = A4445 { Media { Stream = 1 { - Local { - v=0 - o=- 2890844526 2890842807 IN IP4 124.124.124.222 - s=- - t= 0 0 - c=IN IP4 124.124.124.222 - m=audio 2222 RTP/AVP 4 - a=ptime:30 + Local { + v=0 + o=- 2890844526 2890842807 IN IP4 124.124.124.222 + s=- + t= 0 0 + c=IN IP4 124.124.124.222 + m=audio 2222 RTP/AVP 4 + a=ptime:30 a } } } } - } + } }". flex_pretty_otp7431_msg4() -> @@ -4456,19 +4930,19 @@ flex_pretty_otp7431_msg4() -> Add = A4445 { Media { Stream = 1 { - Local { - v=0 - o=- 2890844526 2890842807 IN IP4 124.124.124.222 - s=- - t= 0 0 - c=IN IP4 124.124.124.222 - m=audio 2222 RTP/AVP 4 - a=ptime:30 + Local { + v=0 + o=- 2890844526 2890842807 IN IP4 124.124.124.222 + s=- + t= 0 0 + c=IN IP4 124.124.124.222 + m=audio 2222 RTP/AVP 4 + a=ptime:30 a} } } } - } + } }". flex_pretty_otp7431_msg5() -> @@ -4478,12 +4952,12 @@ flex_pretty_otp7431_msg5() -> Add = A4445 { Media { Stream = 1 { - Local { + Local { v= } } } } - } + } }". flex_pretty_otp7431_msg6() -> @@ -4493,12 +4967,12 @@ flex_pretty_otp7431_msg6() -> Add = A4445 { Media { Stream = 1 { - Local { + Local { v } } } } - } + } }". flex_pretty_otp7431_msg7() -> @@ -4508,12 +4982,12 @@ flex_pretty_otp7431_msg7() -> Add = A4445 { Media { Stream = 1 { - Local { + Local { v} } } } - } + } }". @@ -4523,92 +4997,92 @@ msgs() -> [M || {_, M, _, _} <- msgs(text)]. msgs(Encoding) -> - msgs1a(Encoding) ++ - msgs1b(Encoding) ++ - msgs3525(Encoding) ++ - msgs5(Encoding) ++ - msgs6(Encoding) ++ - msgs7(Encoding) ++ + msgs1a(Encoding) ++ + msgs1b(Encoding) ++ + msgs3525(Encoding) ++ + msgs5(Encoding) ++ + msgs6(Encoding) ++ + msgs7(Encoding) ++ msgs8(Encoding). msgs1a(_) -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, - EC, M) + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + EC, M) end, [ - {msg01a, msg1a(), Plain, [{dbg,false}]}, + {msg01a, msg1a(), Plain, [{dbg,false}]}, {msg01b, msg1b(), Plain, [{dbg,false}]}, - {msg02, msg2(), Plain, [{dbg,false}]}, - {msg03, msg3(), Plain, [{dbg,false}]}, - {msg04, msg4(), Plain, [{dbg,false}]}, - {msg05, msg5(), Plain, [{dbg,false}]}, - {msg06a, msg6a(), Plain, [{dbg,false}]}, - {msg06b, msg6b(), Plain, [{dbg,false}]}, - {msg07, msg7(), Plain, [{dbg,false}]}, - {msg08a, msg8a(), Plain, [{dbg,false}]}, - {msg08b, msg8b(), Plain, [{dbg,false}]}, - {msg09, msg9(), Plain, [{dbg,false}]}, - {msg10, msg10(), Plain, [{dbg,false}]}, - {msg11, msg11(), Plain, [{dbg,false}]}, - {msg12, msg12(), Plain, [{dbg,false}]}, - {msg13, msg13(), Plain, [{dbg,false}]}, - {msg14, msg14(), Plain, [{dbg,false}]}, - {msg15, msg15(), Plain, [{dbg,false}]}, - {msg16, msg16(), Plain, [{dbg,false}]}, - {msg17, msg17(), Plain, [{dbg,false}]}, - {msg18, msg18(), Plain, [{dbg,false}]}, - {msg19, msg19(), Plain, [{dbg,false}]}, - {msg20, msg20(), Plain, [{dbg,false}]}, + {msg02, msg2(), Plain, [{dbg,false}]}, + {msg03, msg3(), Plain, [{dbg,false}]}, + {msg04, msg4(), Plain, [{dbg,false}]}, + {msg05, msg5(), Plain, [{dbg,false}]}, + {msg06a, msg6a(), Plain, [{dbg,false}]}, + {msg06b, msg6b(), Plain, [{dbg,false}]}, + {msg07, msg7(), Plain, [{dbg,false}]}, + {msg08a, msg8a(), Plain, [{dbg,false}]}, + {msg08b, msg8b(), Plain, [{dbg,false}]}, + {msg09, msg9(), Plain, [{dbg,false}]}, + {msg10, msg10(), Plain, [{dbg,false}]}, + {msg11, msg11(), Plain, [{dbg,false}]}, + {msg12, msg12(), Plain, [{dbg,false}]}, + {msg13, msg13(), Plain, [{dbg,false}]}, + {msg14, msg14(), Plain, [{dbg,false}]}, + {msg15, msg15(), Plain, [{dbg,false}]}, + {msg16, msg16(), Plain, [{dbg,false}]}, + {msg17, msg17(), Plain, [{dbg,false}]}, + {msg18, msg18(), Plain, [{dbg,false}]}, + {msg19, msg19(), Plain, [{dbg,false}]}, + {msg20, msg20(), Plain, [{dbg,false}]}, {msg21, msg21(), Plain, [{dbg,false}]}, - {msg22a, msg22a(), Plain, [{dbg,false}]}, - {msg22b, msg22b(), Plain, [{dbg,false}]}, - {msg22c, msg22c(), Plain, [{dbg,false}]}, - {msg22d, msg22d(), Plain, [{dbg,false}]}, - {msg22e, msg22e(), Plain, [{dbg,false}]}, - {msg22f, msg22f(), Plain, [{dbg,false}]}, - {msg23a, msg23a(), Plain, [{dbg,false}]}, - {msg23b, msg23b(), Plain, [{dbg,false}]}, - {msg23c, msg23c(), Plain, [{dbg,false}]}, - {msg23d, msg23d(), Plain, [{dbg,false}]}, - {msg24, msg24(), Plain, [{dbg,false}]}, - {msg25, msg25(), Plain, [{dbg,false}]}, - {msg30a, msg30a(), Plain, [{dbg,false}]}, - {msg30b, msg30b(), Plain, [{dbg,false}]}, - {msg30c, msg30c(), Plain, [{dbg,false}]}, + {msg22a, msg22a(), Plain, [{dbg,false}]}, + {msg22b, msg22b(), Plain, [{dbg,false}]}, + {msg22c, msg22c(), Plain, [{dbg,false}]}, + {msg22d, msg22d(), Plain, [{dbg,false}]}, + {msg22e, msg22e(), Plain, [{dbg,false}]}, + {msg22f, msg22f(), Plain, [{dbg,false}]}, + {msg23a, msg23a(), Plain, [{dbg,false}]}, + {msg23b, msg23b(), Plain, [{dbg,false}]}, + {msg23c, msg23c(), Plain, [{dbg,false}]}, + {msg23d, msg23d(), Plain, [{dbg,false}]}, + {msg24, msg24(), Plain, [{dbg,false}]}, + {msg25, msg25(), Plain, [{dbg,false}]}, + {msg30a, msg30a(), Plain, [{dbg,false}]}, + {msg30b, msg30b(), Plain, [{dbg,false}]}, + {msg30c, msg30c(), Plain, [{dbg,false}]}, {msg30d, msg30d(), Plain, [{dbg,false}]} ]. msgs1b(_) -> - TransFirst = + TransFirst = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:trans_first_encode_decode(Codec, DD, - Ver, EC, M) + megaco_codec_test_lib:trans_first_encode_decode(Codec, DD, + Ver, EC, M) end, - ActionsFirst = + ActionsFirst = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:actions_first_encode_decode(Codec, DD, - Ver, EC, M) + megaco_codec_test_lib:actions_first_encode_decode(Codec, DD, + Ver, EC, M) end, - ActionFirst = + ActionFirst = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:action_first_encode_decode(Codec, DD, - Ver, EC, M) + megaco_codec_test_lib:action_first_encode_decode(Codec, DD, + Ver, EC, M) end, [ - {msg01a_tf, msg1a(), TransFirst, [{dbg,false}]}, - {msg02_tf, msg2(), TransFirst, [{dbg,false}]}, - {msg10_tf, msg10(), TransFirst, [{dbg,false}]}, - {msg11_tf, msg11(), TransFirst, [{dbg,false}]}, - {msg23d_tf, msg23d(), TransFirst, [{dbg,false}]}, - {msg30b_tf, msg30b(), TransFirst, [{dbg,false}]}, - {msg30c_tf, msg30c(), TransFirst, [{dbg,false}]}, - {msg01a_asf, msg1a(), ActionsFirst, [{dbg,false}]}, - {msg02_asf, msg2(), ActionsFirst, [{dbg,false}]}, - {msg10_asf, msg10(), ActionsFirst, [{dbg,false}]}, - {msg23d_asf, msg23d(), ActionsFirst, [{dbg,false}]}, + {msg01a_tf, msg1a(), TransFirst, [{dbg,false}]}, + {msg02_tf, msg2(), TransFirst, [{dbg,false}]}, + {msg10_tf, msg10(), TransFirst, [{dbg,false}]}, + {msg11_tf, msg11(), TransFirst, [{dbg,false}]}, + {msg23d_tf, msg23d(), TransFirst, [{dbg,false}]}, + {msg30b_tf, msg30b(), TransFirst, [{dbg,false}]}, + {msg30c_tf, msg30c(), TransFirst, [{dbg,false}]}, + {msg01a_asf, msg1a(), ActionsFirst, [{dbg,false}]}, + {msg02_asf, msg2(), ActionsFirst, [{dbg,false}]}, + {msg10_asf, msg10(), ActionsFirst, [{dbg,false}]}, + {msg23d_asf, msg23d(), ActionsFirst, [{dbg,false}]}, {msg01a_af, msg1a(), ActionFirst, [{dbg,false}]}, {msg02_af, msg2(), ActionFirst, [{dbg,false}]}, {msg10_af, msg10(), ActionFirst, [{dbg,false}]}, @@ -4617,10 +5091,10 @@ msgs1b(_) -> msgs3525(_) -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, - EC, M) + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + EC, M) end, [{msgs3_name(Name), rfc3525_decode(M), Plain, [{dbg, false}]} || {Name, M} <- rfc3525_msgs()]. @@ -4640,10 +5114,10 @@ rfc3525_decode(M) when is_binary(M) -> msgs5(_) -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, - EC, M) + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + EC, M) end, [ {msg51a, msg51a(), Plain, [{dbg, false}]}, @@ -4666,19 +5140,19 @@ msgs5(_) -> {msg58a, msg58a(), Plain, [{dbg, false}]}, {msg58b, msg58b(), Plain, [{dbg, false}]} ]. - - + + msgs6(Encoding) -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, EC, M) - end, + end, - PlainEDFail = + PlainEDFail = fun(Codec, DD, Ver, EC, M) -> - Res = - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + Res = + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, EC, M), case Res of {error, {message_encode_failed, Reason, _M}} -> @@ -4692,11 +5166,11 @@ msgs6(Encoding) -> Res end end, - - PlainDE = + + PlainDE = fun(Codec, _DD, Ver, EC, B) -> - Res = - megaco_codec_test_lib:decode_message(Codec, false, Ver, + Res = + megaco_codec_test_lib:decode_message(Codec, false, Ver, EC, B), case Res of {ok, M} -> @@ -4716,7 +5190,7 @@ msgs6(Encoding) -> end end, - Msgs = + Msgs = [ {msg61a, msg61a(), Plain, [{dbg,false}],[text,binary,erlang]}, {msg61b, msg61b(), Plain, [{dbg,false}],[text,binary,erlang]}, @@ -4725,16 +5199,16 @@ msgs6(Encoding) -> {msg62b, msg62b(), PlainDE, [{dbg,false}],[text]} ], [{N,M,F,C}||{N,M,F,C,E} <- Msgs,lists:member(Encoding,E)]. - + msgs7(Encoding) -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, EC, M) - end, + end, - Msgs = + Msgs = [ {msg71a, msg71a(), Plain, [{dbg,false}],[text,binary,erlang]}, {msg71b01, msg71b01(), Plain, [{dbg,false}],[text,binary,erlang]}, @@ -4816,19 +5290,19 @@ msgs7(Encoding) -> {msg78a07, msg78a07(), Plain, [{dbg,false}],[text,binary,erlang]}, {msg78a08, msg78a08(), Plain, [{dbg,false}],[text,binary,erlang]}, {msg78a09, msg78a09(), Plain, [{dbg,false}],[text,binary,erlang]}, - {msg79a01, msg79a01(), Plain, [{dbg,false}],[text,binary,erlang]} + {msg79a01, msg79a01(), Plain, [{dbg,true}],[text,binary,erlang]} ], [{N,M,F,C}||{N,M,F,C,E} <- Msgs,lists:member(Encoding,E)]. - - + + msgs8(Encoding) -> - Plain = + Plain = fun(Codec, DD, Ver, EC, M) -> - megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, + megaco_codec_test_lib:plain_encode_decode(Codec, DD, Ver, EC, M) - end, + end, - Msgs = + Msgs = [ {msg80a01, msg80a01(), Plain, [{dbg,false}],[text,binary,erlang]}, {msg80a02, msg80a02(), Plain, [{dbg,false}],[text,binary,erlang]}, @@ -4844,9 +5318,9 @@ msgs8(Encoding) -> {msg81b03, msg81b03(), Plain, [{dbg,false}],[text,binary,erlang]} ], [{N,M,F,C}||{N,M,F,C,E} <- Msgs,lists:member(Encoding,E)]. - - - + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% msg_actions([], Actions) -> @@ -4860,7 +5334,7 @@ megaco_trans_req([], Transactions) -> megaco_trans_req([{TransId, ActionInfo}|TransInfo], Transactions) -> Actions = msg_actions(ActionInfo, []), TR = ?MSG_LIB:cre_TransactionRequest(TransId, Actions), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), megaco_trans_req(TransInfo, [Trans|Transactions]). megaco_message(Version, Mid, Body) -> @@ -4875,7 +5349,7 @@ msg_request(Mid, TransId, ContextId, CmdReq) -> Action = ?MSG_LIB:cre_ActionRequest(ContextId, CmdReq), Actions = [Action], TR = ?MSG_LIB:cre_TransactionRequest(TransId, Actions), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, Mid, [Trans]), cre_MegacoMessage(Mess). @@ -4883,19 +5357,19 @@ msg_request(Auth, Mid, TransId, ContextId, CmdReq) -> Action = ?MSG_LIB:cre_ActionRequest(ContextId, CmdReq), Actions = [Action], TR = ?MSG_LIB:cre_TransactionRequest(TransId, Actions), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, Mid, [Trans]), cre_MegacoMessage(Auth, Mess). msg_reply(Mid, TransId, Actions) -> TR = cre_TransRep(TransId, Actions), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, Mid, [Trans]), cre_MegacoMessage(Mess). msg_reply(Mid, TransId, ContextId, CmdReply) -> Action = cre_ActRep(ContextId, CmdReply), - Actions = [Action], + Actions = [Action], msg_reply(Mid, TransId, Actions). msg_ack(Mid, [Range|_] = Ranges) when is_tuple(Range) -> @@ -4921,7 +5395,7 @@ make_tra(Ranges) -> msg1(Mid, Tid) -> Gain = cre_PropParm("tdmc/gain", "2"), - Ec = cre_PropParm("tdmc/ec", "g165"), + Ec = cre_PropParm("tdmc/ec", "g165"), LCD = cre_LocalControlDesc(sendRecv,[Gain, Ec]), V = cre_PropParm("v", "0"), %% C = cre_PropParm("c", "IN IP4 $ "), @@ -4961,7 +5435,7 @@ msg2(Mid) -> msg2(Mid, ?A4444). msg2(Mid, Tid) -> Gain = cre_PropParm("tdmc/gain", "2"), - Ec = cre_PropParm("tdmc/ec", "g165"), + Ec = cre_PropParm("tdmc/ec", "g165"), LCD = cre_LocalControlDesc(sendRecv,[Gain, Ec]), V = cre_PropParm("v", "0"), %% C = cre_PropParm("c", "IN IP4 $ "), @@ -5198,7 +5672,7 @@ msg13(Mid) -> msg14() -> msg14(?MGC_MID). msg14(Mid) -> - Signal = cre_Sig("cg/rt"), + Signal = cre_Sig("cg/rt"), AmmReq1 = cre_AmmReq([#megaco_term_id{id = ?A4444}], [{signalsDescriptor, [{signal, Signal}]}]), CmdReq1 = cre_CmdReq({modReq, AmmReq1}), @@ -5363,11 +5837,11 @@ msg22(Mid, N) -> Audits = [{mediaDescriptor, Media}, {packagesDescriptor, [PackagesItem, PackagesItem2]}, {statisticsDescriptor, Statistics}], - Reply = {auditResult, + Reply = {auditResult, cre_AuditRes(#megaco_term_id{id = ?A5556},Audits)}, - msg_reply(Mid, 50007, ?megaco_null_context_id, + msg_reply(Mid, 50007, ?megaco_null_context_id, lists:duplicate(N,{auditValueReply, Reply})). -%% msg_reply(Mid, 50007, ?megaco_null_context_id, +%% msg_reply(Mid, 50007, ?megaco_null_context_id, %% lists.duplicate([{auditValueReply, Reply}]). @@ -5468,7 +5942,7 @@ msg25(Mid) -> Stats2 = [Stat21, Stat22, Stat23, Stat24, Stat25, Stat26, Stat27], Reply2 = cre_AmmsReply([#megaco_term_id{id = ?A5556}], [{statisticsDescriptor, Stats2}]), - msg_reply(Mid, 50009, 5000, + msg_reply(Mid, 50009, 5000, [{subtractReply, Reply1}, {subtractReply, Reply2}]). @@ -5479,7 +5953,7 @@ msg30b() -> msg_ack(?MG2_MID, [{9,13}]). msg30c() -> - msg_ack(?MG2_MID, + msg_ack(?MG2_MID, [{9,13}, {15,15}, {33,40}, {50,60}, {70,80}, {85,90}, {101,105},{109,119},{121,130},{140,160},{170,175},{180,189}, {201,205},{209,219},{221,230},{240,260},{270,275},{280,289}, @@ -5491,7 +5965,7 @@ msg30c() -> %% Don't think this will be used by the megaco stack, but since it %% seem's to be a valid construction... msg30d() -> - msg_ack(?MG2_MID, + msg_ack(?MG2_MID, [[{9,13}, {15,15}, {33,40}, {50,60}, {70,80}, {85,90}], [{101,105},{109,119},{121,130},{140,160},{170,175},{180,189}], [{201,205},{209,219},{221,230},{240,260},{270,275},{280,289}], @@ -5501,7 +5975,7 @@ msg30d() -> ]). - + msg40() -> msg40(?MG1_MID_NO_PORT, "901 mg col boot"). msg40(Mid, Reason) when is_list(Reason) -> @@ -5519,14 +5993,14 @@ msg50(Mid, APT) -> Req = cre_AuditReq(#megaco_term_id{id = ?A5556},AD), CmdReq = cre_CmdReq({auditValueRequest, Req}), msg_request(Mid, 50007, ?megaco_null_context_id, [CmdReq]). - + %% IndAudMediaDescriptor: msg51(Mid, IATSDorStream) -> IAMD = cre_IndAudMediaDesc(IATSDorStream), IAP = cre_IndAudParam(IAMD), APT = [IAP], msg50(Mid, APT). - + msg51a() -> msg51a(?MG2_MID). msg51a(Mid) -> @@ -5558,7 +6032,7 @@ msg51d(Mid) -> msg51e() -> msg51e(?MG2_MID). msg51e(Mid) -> - IALCD = cre_IndAudLocalControlDesc('NULL', asn1_NOVALUE, + IALCD = cre_IndAudLocalControlDesc('NULL', asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE), IASP = cre_IndAudStreamParms(IALCD), msg51(Mid, IASP). @@ -5566,7 +6040,7 @@ msg51e(Mid) -> msg51f() -> msg51f(?MG2_MID). msg51f(Mid) -> - IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, 'NULL', + IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, 'NULL', asn1_NOVALUE, asn1_NOVALUE), IASP = cre_IndAudStreamParms(IALCD), msg51(Mid, IASP). @@ -5574,7 +6048,7 @@ msg51f(Mid) -> msg51g() -> msg51g(?MG2_MID). msg51g(Mid) -> - IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, asn1_NOVALUE, + IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, asn1_NOVALUE, 'NULL', asn1_NOVALUE), IASP = cre_IndAudStreamParms(IALCD), msg51(Mid, IASP). @@ -5584,7 +6058,7 @@ msg51h() -> msg51h(Mid) -> Name = "nt/jit", IAPP = cre_IndAudPropertyParm(Name), - IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, asn1_NOVALUE, + IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, [IAPP]), IASP = cre_IndAudStreamParms(IALCD), SID = 123, @@ -5599,7 +6073,7 @@ msg51i(Mid) -> Name2 = "tdmc/ec", IAPP = cre_IndAudPropertyParm(Name), IAPP2 = cre_IndAudPropertyParm(Name2), - IALCD = cre_IndAudLocalControlDesc('NULL', 'NULL', 'NULL', + IALCD = cre_IndAudLocalControlDesc('NULL', 'NULL', 'NULL', [IAPP, IAPP2]), IASP = cre_IndAudStreamParms(IALCD), SID = 123, @@ -5635,7 +6109,7 @@ msg54(Mid, Sig) -> IAP = cre_IndAudParam(IASD), APT = [IAP], msg50(Mid, APT). - + msg54a() -> msg54a(?MG2_MID). msg54a(Mid) -> @@ -5677,7 +6151,7 @@ msg56(Mid) -> IASD = cre_IndAudStatsDesc(SN), IAP = cre_IndAudParam(IASD), APT = [IAP], - msg50(Mid, APT). + msg50(Mid, APT). %% IndAudPackagesDescriptor: msg57() -> @@ -5688,30 +6162,30 @@ msg57(Mid) -> IAPD = cre_IndAudPkgsDesc(PN, PV), IAP = cre_IndAudParam(IAPD), APT = [IAP], - msg50(Mid, APT). - + msg50(Mid, APT). + %% Sum it up: msg58_iaMediaDesc_iap(IATSD) -> IAMD = cre_IndAudMediaDesc(IATSD), cre_IndAudParam(IAMD). - + msg58_iaMediaDesc_iap_a() -> PP = cre_IndAudPropertyParm("tdmc/gain"), PPs = [PP], IATSD = cre_IndAudTermStateDesc(PPs), msg58_iaMediaDesc_iap(IATSD). - + msg58_iaMediaDesc_iap_b() -> IATSD = cre_IndAudTermStateDesc([], 'NULL', asn1_NOVALUE), msg58_iaMediaDesc_iap(IATSD). - + msg58_iaEvsDesc_iap() -> RequestID = 1235, PkgdName = "tonedet/std", IAED = cre_IndAudEvsDesc(RequestID, PkgdName), cre_IndAudParam(IAED). -msg58_iaEvBufDesc_iap() -> +msg58_iaEvBufDesc_iap() -> EN = "tonedet/std", SID = 1, IAEBD = cre_IndAudEvBufDesc(EN, SID), @@ -5725,7 +6199,7 @@ msg58_iaSigsDesc_iap_a() -> SN = "tonegen/pt", Sig = cre_IndAudSig(SN), msg58_iaSigsDesc_iap(Sig). - + msg58_iaSigsDesc_iap_b() -> SN = "ct/ct", Sig = cre_IndAudSig(SN), @@ -5737,7 +6211,7 @@ msg58_iaDigMapDesc_iap() -> DMN = "dialplan00", IADMD = cre_IndAudDigitMapDesc(DMN), cre_IndAudParam(IADMD). - + msg58_iaStatsDesc_iap() -> SN = "nt/dur", IASD = cre_IndAudStatsDesc(SN), @@ -5776,7 +6250,7 @@ msg58b(Mid) -> msg50(Mid, APT). -%% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +%% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %% Tests some of the changes in the v2 corr 1 (EmergencyOff and ModemDesc) %% Emergency On/Off (optional) tests @@ -5791,7 +6265,7 @@ msg61(EM) -> ActReq = ?MSG_LIB:cre_ActionRequest(1, CtxReq, [CmdReq]), Acts = [ActReq], TR = ?MSG_LIB:cre_TransactionRequest(9898, Acts), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, ?MG1_MID, [Trans]), cre_MegacoMessage(Mess). @@ -5817,12 +6291,12 @@ msg62a() -> ActReq = ?MSG_LIB:cre_ActionRequest(2, [CmdReq]), Acts = [ActReq], TR = ?MSG_LIB:cre_TransactionRequest(9898, Acts), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, ?MG1_MID, [Trans]), cre_MegacoMessage(Mess). msg62b() -> - MP = + MP = "MEGACO/" ?VERSION_STR " [124.124.124.222]:55555 Transaction = 9898 { Context = 2 { @@ -5833,7 +6307,7 @@ Transaction = 9898 { } } }", -% MC = +% MC = % "!/" ?VERSION_STR " [124.124.124.222]:55555\nT=9898{C=2{A=11111111/00000000/00000000{MD[V18]{tdmc/gain=2}}}}", list_to_binary(MP). @@ -5855,31 +6329,31 @@ msg71(CR, CAAR) -> ActReq = ?MSG_LIB:cre_ActionRequest(1, CR, CAAR, [CR1, CR2]), Acts = [ActReq], TR = ?MSG_LIB:cre_TransactionRequest(9898, Acts), - Trans = ?MSG_LIB:cre_Transaction(TR), + Trans = ?MSG_LIB:cre_Transaction(TR), Mess = ?MSG_LIB:cre_Message(?VERSION, ?MG1_MID, [Trans]), cre_MegacoMessage(Mess). - + msg71a() -> CR = cre_CtxReq(), CAAR = cre_CtxAttrAuditReq(), msg71(CR, CAAR). -msg71b(CR) -> +msg71b(CR) -> CAAR = asn1_NOVALUE, msg71(CR, CAAR). msg71b01() -> CR = cre_CtxReq(15), msg71b(CR). - + msg71b02() -> CR = cre_CtxReq(true), msg71b(CR). - + msg71b03() -> CR = cre_CtxReq(false), msg71b(CR). - + msg71b04() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -5892,15 +6366,15 @@ msg71b04() -> Top = [Top1, Top2], CR = cre_CtxReq(Top), msg71b(CR). - + msg71b05() -> CR = cre_CtxReq(15, true), msg71b(CR). - + msg71b06() -> CR = cre_CtxReq(15, false), msg71b(CR). - + msg71b07() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -5913,7 +6387,7 @@ msg71b07() -> Top = [Top1, Top2], CR = cre_CtxReq(15, Top), msg71b(CR). - + msg71b08() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -5926,7 +6400,7 @@ msg71b08() -> Top = [Top1, Top2], CR = cre_CtxReq(15, true, Top), msg71b(CR). - + msg71b09() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -5939,7 +6413,7 @@ msg71b09() -> Top = [Top1, Top2], CR = cre_CtxReq(15, false, Top), msg71b(CR). - + msg71b10() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -5952,7 +6426,7 @@ msg71b10() -> Top = [Top1, Top2], CR = cre_CtxReq(15, false, Top), msg71b(CR). - + msg71b11() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -5965,7 +6439,7 @@ msg71b11() -> Top = [Top1, Top2], CR = cre_CtxReq(15, false, Top), msg71b(CR). - + msg71b12() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -5978,7 +6452,7 @@ msg71b12() -> Top = [Top1, Top2], CR = cre_CtxReq(15, true, Top, true), msg71b(CR). - + msg71b13() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -5991,7 +6465,7 @@ msg71b13() -> Top = [Top1, Top2], CR = cre_CtxReq(15, true, Top, false), msg71b(CR). - + msg71b14() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6006,7 +6480,7 @@ msg71b14() -> Props = [PP], CR = cre_CtxReq(15, true, Top, Props), msg71b(CR). - + msg71b15() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6021,7 +6495,7 @@ msg71b15() -> Props = [PP], CR = cre_CtxReq(15, true, Top, Props), msg71b(CR). - + msg71b16() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6032,11 +6506,11 @@ msg71b16() -> Dir2 = bothway, Top2 = cre_TopologyRequest(From2, To2, Dir2), Top = [Top1, Top2], - PP = cre_PropParm("tdmc/gain", ["2","10"], range, true), + PP = cre_PropParm("tdmc/gain", ["2","10"], range, true), Props = [PP], CR = cre_CtxReq(15, true, Top, Props), msg71b(CR). - + msg71b17() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6051,7 +6525,7 @@ msg71b17() -> Props = [PP], CR = cre_CtxReq(15, true, Top, Props), msg71b(CR). - + msg71b18() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6062,11 +6536,11 @@ msg71b18() -> Dir2 = isolate, Top2 = cre_TopologyRequest(From2, To2, Dir2), Top = [Top1, Top2], - PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), + PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), Props = [PP], CR = cre_CtxReq(15, true, Top, true, Props), msg71b(CR). - + msg71b19() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6079,7 +6553,7 @@ msg71b19() -> Top = [Top1, Top2], CR = cre_CtxReq(15, true, Top, false), msg71b(CR). - + msg71b20() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6090,11 +6564,11 @@ msg71b20() -> Dir2 = isolate, Top2 = cre_TopologyRequest(From2, To2, Dir2), Top = [Top1, Top2], - PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), + PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), Props = [PP], CR = cre_CtxReq(15, true, Top, false, Props), msg71b(CR). - + msg71b21() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6110,7 +6584,7 @@ msg71b21() -> CIDs = [CID1, CID2], CR = cre_CtxReq(15, true, Top, false, CIDs), msg71b(CR). - + msg71b22() -> From1 = #megaco_term_id{id = ["11111111", "00000000", "00000000"]}, To1 = #megaco_term_id{id = ["11111111", "00000000", "00001111"]}, @@ -6121,18 +6595,18 @@ msg71b22() -> Dir2 = isolate, Top2 = cre_TopologyRequest(From2, To2, Dir2), Top = [Top1, Top2], - PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), + PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), Props = [PP], CID1 = cre_CtxID(10191), CID2 = cre_CtxID(10192), CIDs = [CID1, CID2], CR = cre_CtxReq(15, true, Top, false, Props, CIDs), msg71b(CR). - + msg71c(CAAR) -> CR = asn1_NOVALUE, msg71(CR, CAAR). - + msg71c01() -> CAAR = cre_CtxAttrAuditReq('NULL', 'NULL', 'NULL'), msg71c(CAAR). @@ -6198,7 +6672,7 @@ msg71c11() -> CPA = [IAPP1, IAPP2], SPrio = 10, SEm = true, - CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, + CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, SPrio, SEm, asn1_NOVALUE, asn1_NOVALUE), msg71c(CAAR). @@ -6213,7 +6687,7 @@ msg71c12() -> SPrio = 10, SEm = true, SIeps = false, - CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, + CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, SPrio, SEm, SIeps), msg71c(CAAR). @@ -6229,7 +6703,7 @@ msg71c13() -> SEm = false, SIeps = true, SLog = cre_SelectLogic(andAUDITSelect), - CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, + CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, SPrio, SEm, SIeps, SLog), msg71c(CAAR). @@ -6245,7 +6719,7 @@ msg71c14() -> SEm = true, SIeps = true, SLog = cre_SelectLogic(orAUDITSelect), - CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, + CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, SPrio, SEm, SIeps, SLog), msg71c(CAAR). @@ -6259,7 +6733,7 @@ msg71c15() -> CPA = [IAPP1, IAPP2], SPrio = 10, SLog = cre_SelectLogic(orAUDITSelect), - CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, + CAAR = cre_CtxAttrAuditReq(Top, Em, Prio, Ieps, CPA, SPrio, SLog), msg71c(CAAR). @@ -6290,7 +6764,7 @@ msg71d02() -> IAPP2 = cre_IndAudPropertyParm("nt/jit"), CPA = [IAPP1, IAPP2], CAAR = cre_CtxAttrAuditReq(CAAR_Top, Em, Prio, Ieps, CPA), - + msg71(CR, CAAR). msg71d03() -> @@ -6315,7 +6789,7 @@ msg71d03() -> IAPP2 = cre_IndAudPropertyParm("nt/jit"), CPA = [IAPP1, IAPP2], CAAR = cre_CtxAttrAuditReq(CAAR_Top, Em, Prio, Ieps, CPA), - + msg71(CR, CAAR). msg71d04() -> @@ -6335,7 +6809,7 @@ msg71d04() -> CIDs = [CID1, CID2], CR = cre_CtxReq(15, true, Top, false, Props, CIDs), - CAAR_Top = 'NULL', + CAAR_Top = 'NULL', Em = 'NULL', Prio = 'NULL', Ieps = 'NULL', @@ -6346,7 +6820,7 @@ msg71d04() -> SEm = true, SIeps = true, SLog = cre_SelectLogic(orAUDITSelect), - CAAR = cre_CtxAttrAuditReq(CAAR_Top, Em, Prio, Ieps, CPA, + CAAR = cre_CtxAttrAuditReq(CAAR_Top, Em, Prio, Ieps, CPA, SPrio, SEm, SIeps, SLog), msg71(CR, CAAR). @@ -6484,7 +6958,7 @@ msg72c03() -> Dir2 = isolate, Top2 = cre_TopologyRequest(From2, To2, Dir2), Top = [Top1, Top2], - PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), + PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), Props = [PP], CR = cre_CtxReq(15, true, Top, true, Props), msg72c(CR). @@ -6499,7 +6973,7 @@ msg72c04() -> Dir2 = isolate, Top2 = cre_TopologyRequest(From2, To2, Dir2), Top = [Top1, Top2], - PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), + PP = cre_PropParm("tdmc/gain", ["2","4","8"], sublist, false), Props = [PP], CR = cre_CtxReq(15, true, Top, false, Props), msg72c(CR). @@ -6533,7 +7007,7 @@ msg73a() -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - + %% StatisticsDescriptor in IndAudStreamParms msg73b1() -> @@ -6556,19 +7030,19 @@ msg73b2(IAMD) -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - + msg73b01() -> IASP = msg73b1(), IAMD = cre_IndAudMediaDesc(IASP), msg73b2(IAMD). - + msg73b02() -> IASP = msg73b1(), SID = cre_StreamID(303), IASD = cre_IndAudStreamDesc(SID, IASP), IAMD = cre_IndAudMediaDesc([IASD]), msg73b2(IAMD). - + %% StatisticsDescriptor in StreamParms msg73c1() -> StatDesc = msg73(), @@ -6626,7 +7100,7 @@ msg74a4(Sig) -> SR = cre_SigReq(Sig), SD = cre_SigsDesc([SR]), AD = cre_AmmDesc(SD), - TermIDs = [#megaco_term_id{id = ?A4444}], + TermIDs = [#megaco_term_id{id = ?A4444}], AR = cre_AmmReq(TermIDs, [AD]), Cmd = cre_Cmd(modReq, AR), cre_CmdReq(Cmd). @@ -6643,7 +7117,7 @@ msg74a01() -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - + msg74a02() -> Sig = msg74a1(both), CR = msg74a4(Sig), @@ -6656,7 +7130,7 @@ msg74a02() -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - + msg74a03() -> RID = cre_ReqID(7433), Sig = msg74a2(external, RID), @@ -6670,7 +7144,7 @@ msg74a03() -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - + msg74a04() -> RID = cre_ReqID(7434), Sig = msg74a2(both, RID), @@ -6684,7 +7158,7 @@ msg74a04() -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - + msg74a05() -> RID = cre_ReqID(7435), Sig = msg74a3(both, RID), @@ -6698,7 +7172,7 @@ msg74a05() -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - + msg74a06() -> RID = cre_ReqID(7436), Sig = msg74a3(internal, RID), @@ -6712,8 +7186,8 @@ msg74a06() -> Mid = ?MG1_MID, Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). - - + + %% New ServiceChangeParm (serviceChangeIncompleteFlag); msg75 msg75a(IncFlag) -> @@ -6722,7 +7196,7 @@ msg75a(IncFlag) -> Reason = "901 mg col boot", Profile = cre_SvcChProf("resgw",1), Parm = cre_SvcChParm(Method, Address, [Reason], Profile, IncFlag), - TermIDs = [?megaco_root_termination_id], + TermIDs = [?megaco_root_termination_id], Req = cre_SvcChReq(TermIDs, Parm), Cmd = cre_Cmd(serviceChangeReq, Req), CR = cre_CmdReq(Cmd), @@ -6764,22 +7238,22 @@ msg76a01() -> Name2 = "tdmc/ec", IAPP2 = cre_IndAudPropertyParm(Name2), SMS = cre_StreamMode(recvOnly), - IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, 'NULL', 'NULL', + IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, 'NULL', 'NULL', [IAPP1, IAPP2], SMS), msg76a(IALCD). - + msg76a02() -> Name1 = "tdmc/gain", - PP1 = cre_PropParm("tdmc/gain", "2"), + PP1 = cre_PropParm("tdmc/gain", "2"), IAPP1 = cre_IndAudPropertyParm(Name1, PP1), Name2 = "tdmc/gain", - PP2 = cre_PropParm("tdmc/gain", "3"), + PP2 = cre_PropParm("tdmc/gain", "3"), IAPP2 = cre_IndAudPropertyParm(Name2, PP2), SMS = cre_StreamMode(recvOnly), - IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, 'NULL', 'NULL', + IALCD = cre_IndAudLocalControlDesc(asn1_NOVALUE, 'NULL', 'NULL', [IAPP1, IAPP2], SMS), msg76a(IALCD). - + %% IndAudTerminationStateDescription + ServiceState msg76b(IATSD) -> IAMD = cre_IndAudMediaDesc(IATSD), @@ -6802,9 +7276,9 @@ msg77a01() -> SN = "tonegen/pt", Sig = cre_IndAudSig(SN, 7701), msg54(?MG2_MID, Sig). - -msg78a(Events) -> + +msg78a(Events) -> EventsDesc = cre_EvsDesc(2223, Events), Signal = cre_Sig("cg/rt"), Name = "dialplan00", @@ -6817,7 +7291,7 @@ msg78a(Events) -> {digitMapDescriptor, DigMapDesc}]), CmdReq = cre_CmdReq({modReq, AmmReq}), msg_request(?MG2_MID, 10001, ?megaco_null_context_id, [CmdReq]). - + msg78a01() -> Name1 = "al/on", Strict = cre_EvParm("strict", ["state"]), @@ -6828,9 +7302,9 @@ msg78a01() -> KA2 = true, EDM2 = cre_EvDM("dialplan00"), NB2 = cre_NotifBehav(notifyImmediate, 'NULL'), - RED2 = asn1_NOVALUE, + RED2 = asn1_NOVALUE, RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB2, RED2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, SID2, RA2, EPL2), msg78a([RE1, RE2]). @@ -6844,9 +7318,9 @@ msg78a02() -> KA2 = true, EDM2 = cre_EvDM("dialplan00"), NB2 = cre_NotifBehav(neverNotify, 'NULL'), - RED2 = asn1_NOVALUE, + RED2 = asn1_NOVALUE, RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB2, RED2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, SID2, RA2, EPL2), msg78a([RE1, RE2]). @@ -6861,9 +7335,9 @@ msg78a03() -> EDM2 = cre_EvDM("dialplan00"), RED2 = cre_RegEmbedDesc(), NB2 = cre_NotifBehav(notifyRegulated, RED2), - REvD2 = asn1_NOVALUE, + REvD2 = asn1_NOVALUE, RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB2, REvD2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, SID2, RA2, EPL2), msg78a([RE1, RE2]). @@ -6879,9 +7353,9 @@ msg78a04() -> SED2 = cre_SecEvsDesc(7814, [SRE2]), RED2 = cre_RegEmbedDesc(SED2), NB2 = cre_NotifBehav(notifyRegulated, RED2), - REvD2 = asn1_NOVALUE, + REvD2 = asn1_NOVALUE, RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB2, REvD2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, 7824, RA2, EPL2), msg78a([RE1, RE2]). @@ -6897,9 +7371,9 @@ msg78a05() -> SD2 = cre_SigsDesc(), RED2 = cre_RegEmbedDesc(SD2), NB2 = cre_NotifBehav(notifyRegulated, RED2), - REvD2 = asn1_NOVALUE, + REvD2 = asn1_NOVALUE, RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB2, REvD2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, SID2, RA2, EPL2), msg78a([RE1, RE2]). @@ -6913,15 +7387,15 @@ msg78a06() -> EDM2 = cre_EvDM("dialplan00"), SRE2 = cre_SecReqEv("al/on"), SED2 = cre_SecEvsDesc(7816, [SRE2]), - Sig2 = cre_Sig("cg/rt", external, asn1_NOVALUE), - SR2 = cre_SigReq(Sig2), + Sig2 = cre_Sig("cg/rt", external, asn1_NOVALUE), + SR2 = cre_SigReq(Sig2), SRs2 = [SR2], SD2 = cre_SigsDesc(SRs2), RED2 = cre_RegEmbedDesc(SED2, SD2), NB2 = cre_NotifBehav(notifyRegulated, RED2), - REvD2 = asn1_NOVALUE, + REvD2 = asn1_NOVALUE, RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB2, REvD2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, 7826, RA2, EPL2), msg78a([RE1, RE2]). @@ -6935,15 +7409,15 @@ msg78a07() -> EDM2 = cre_EvDM("dialplan00"), SRE2 = cre_SecReqEv("al/on"), SED2 = cre_SecEvsDesc(7817, [SRE2]), - Sig2 = cre_Sig("cg/rt", external, asn1_NOVALUE), - SR2 = cre_SigReq(Sig2), + Sig2 = cre_Sig("cg/rt", external, asn1_NOVALUE), + SR2 = cre_SigReq(Sig2), SRs2 = [SR2], SD2 = cre_SigsDesc(SRs2), RED2 = cre_RegEmbedDesc(SED2, SD2), NB2 = cre_NotifBehav(notifyRegulated, RED2), - REvD2 = 'NULL', + REvD2 = 'NULL', RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB2, REvD2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, 7827, RA2, EPL2), msg78a([RE1, RE2]). @@ -6957,8 +7431,8 @@ msg78a08() -> KA2 = true, EDM2 = cre_EvDM("dialplan00"), - Sig21 = cre_Sig("al/ri", both, asn1_NOVALUE), - SR21 = cre_SigReq(Sig21), + Sig21 = cre_Sig("al/ri", both, asn1_NOVALUE), + SR21 = cre_SigReq(Sig21), SRs21 = [SR21], SD21 = cre_SigsDesc(SRs21), RED21 = cre_RegEmbedDesc(SD21), @@ -6966,17 +7440,17 @@ msg78a08() -> SRA2 = cre_SecReqActs(KA2, EDM2, asn1_NOVALUE, NB21, 'NULL'), SRE2 = cre_SecReqEv("al/of", 7816, SRA2), SED2 = cre_SecEvsDesc(7826, [SRE2]), - - Sig22 = cre_Sig("cg/rt", external, asn1_NOVALUE), - SR22 = cre_SigReq(Sig22), + + Sig22 = cre_Sig("cg/rt", external, asn1_NOVALUE), + SR22 = cre_SigReq(Sig22), SRs22 = [SR22], SD22 = cre_SigsDesc(SRs22), RED22 = cre_RegEmbedDesc(SED2, SD22), NB22 = cre_NotifBehav(notifyRegulated, RED22), - REvD2 = 'NULL', + REvD2 = 'NULL', RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB22, REvD2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, 7836, RA2, EPL2), msg78a([RE1, RE2]). @@ -6999,9 +7473,9 @@ msg78a09() -> Dir21 = cre_SigDir(both), RID21 = cre_ReqID(7829), - Sig21 = cre_Sig("cg/rt", SID21, ST21, Dur21, NC21, KA21, SPL21, Dir21, + Sig21 = cre_Sig("cg/rt", SID21, ST21, Dur21, NC21, KA21, SPL21, Dir21, RID21, 7839), - SR21 = cre_SigReq(Sig21), + SR21 = cre_SigReq(Sig21), SRs21 = [SR21], SD21 = cre_SigsDesc(SRs21), RED21 = cre_RegEmbedDesc(SD21), @@ -7010,7 +7484,7 @@ msg78a09() -> SRA2 = cre_SecReqActs(KA2, EDM2, asn1_NOVALUE, NB21, 'NULL'), SRE2 = cre_SecReqEv("al/of", 7849, SRA2), SED2 = cre_SecEvsDesc(7859, [SRE2]), - + SID22 = cre_StreamID(7869), ST22 = cre_SigType(brief), Dur22 = 17809, @@ -7020,18 +7494,18 @@ msg78a09() -> Dir22 = cre_SigDir(external), RID22 = cre_ReqID(7879), - Sig22 = cre_Sig("cg/rt", SID22, ST22, Dur22, NC22, KA22, SPL22, Dir22, + Sig22 = cre_Sig("cg/rt", SID22, ST22, Dur22, NC22, KA22, SPL22, Dir22, RID22, 7889), - SR22 = cre_SigReq(Sig22), + SR22 = cre_SigReq(Sig22), SRs22 = [SR22], SD22 = cre_SigsDesc(SRs22), RED22 = cre_RegEmbedDesc(SED2, SD22), NB22 = cre_NotifBehav(notifyRegulated, RED22), - REvD2 = 'NULL', + REvD2 = 'NULL', RA2 = cre_ReqActs(KA2, EDM2, asn1_NOVALUE, asn1_NOVALUE, NB22, REvD2), - EPL2 = EPL1, + EPL2 = EPL1, RE2 = cre_ReqEv(Name2, 7899, RA2, EPL2), msg78a([RE1, RE2]). @@ -7039,7 +7513,7 @@ msg78a09() -> msg79a01() -> TID1 = #megaco_term_id{id = ?A4444}, TID2 = #megaco_term_id{id = ?A4445}, - TID3 = #megaco_term_id{id = ?A5555}, + TID3 = #megaco_term_id{id = ?A5555}, TIDs = cre_TermIDList([TID1, TID2, TID3]), ErC = cre_ErrCode(?megaco_not_ready), ErD = cre_ErrDesc(ErC), @@ -7069,7 +7543,7 @@ msg80() -> {serviceChangeResParms, Parm}), CmdRep = cre_CmdRep(serviceChangeReply, Reply), cre_ActRep(80, [CmdRep]). - + msg80a(Mid, SN) -> TransId = 8000, ActRep = msg80(), @@ -7106,7 +7580,7 @@ msg80b03() -> msg81a(Mid, SN) -> TransId = 8101, - SegReply = cre_SegRep(TransId, SN), + SegReply = cre_SegRep(TransId, SN), Trans = cre_Trans(SegReply), Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). @@ -7122,7 +7596,7 @@ msg81a03() -> msg81b(Mid, SN) -> TransId = 8102, - SegReply = cre_SegRep(TransId, SN, 'NULL'), + SegReply = cre_SegRep(TransId, SN, 'NULL'), Trans = cre_Trans(SegReply), Mess = cre_Msg(Mid, [Trans]), cre_MegacoMessage(Mess). @@ -7136,8 +7610,8 @@ msg81b02() -> msg81b03() -> msg81b(?MG3_MID, 65535). - -%% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +%% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %% Pretty RFC 3525 messages: %% Added Reason @@ -7148,11 +7622,11 @@ rfc3525_msg1() -> Services { Method = Restart, Reason = 901, - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 } } - } + } }". rfc3525_msg2() -> @@ -7160,11 +7634,11 @@ rfc3525_msg2() -> Context = - { ServiceChange = ROOT { Services { - ServiceChangeAddress = 55555, + ServiceChangeAddress = 55555, Profile = ResGW/1 - } - } - } + } + } + } }". @@ -7173,7 +7647,7 @@ rfc3525_msg3() -> "MEGACO/" ?VERSION_STR " [123.123.123.4]:55555 Transaction = 9999 { Context = - { Modify = A4444 { - Media { + Media { Stream = 1 { LocalControl { Mode = SendReceive, @@ -7205,15 +7679,15 @@ rfc3525_msg6() -> 19990729T22000000:al/of{init=false} } } - } + } }". - + rfc3525_msg7() -> "MEGACO/" ?VERSION_STR " [123.123.123.4]:55555 Reply = 10000 { Context = - { Notify = A4444 - } + } }". rfc3525_msg8() -> @@ -7221,11 +7695,11 @@ rfc3525_msg8() -> Context = - { Modify = A4444 { Events = 2223 { - al/on {strict=state}, + al/on {strict=state}, dd/ce {DigitMap=Dialplan0} }, Signals {cg/dt}, - DigitMap = Dialplan0 { + DigitMap = Dialplan0 { (0| 00|[1-7]xxx|8xxxxxxx|fxxxxxxx|exx|91xxxxxxxxxx|9011x.) } } @@ -7250,7 +7724,7 @@ rfc3525_msg10() -> } } } - } + } }". @@ -7273,13 +7747,13 @@ rfc3525_msg12() -> Mode = ReceiveOnly, nt/jit=40 ; in ms }, - Local { + Local { v=0 c=IN IP4 $ m=audio $ RTP/AVP 4 a=ptime:30 v=0 c=IN IP4 $ m=audio $ RTP/AVP 0 } } } } - } + } }". %% Added ? @@ -7290,28 +7764,28 @@ rfc3525_msg13() -> Add = A4445 { Media { Stream = 1 { - Local { -v=0 -o=- 2890844526 2890842807 IN IP4 124.124.124.222 -s=- -t= 0 0 -c=IN IP4 124.124.124.222 -m=audio 2222 RTP/AVP 4 -a=ptime:30 -a=recvonly + Local { +v=0 +o=- 2890844526 2890842807 IN IP4 124.124.124.222 +s=- +t= 0 0 +c=IN IP4 124.124.124.222 +m=audio 2222 RTP/AVP 4 +a=ptime:30 +a=recvonly } ; RTP profile for G.723.1 is 4 } } } - } + } }". -%% +%% %% Added ? rfc3525_msg14() -> "MEGACO/" ?VERSION_STR " [123.123.123.4]:55555 Transaction = 50003 { Context = $ { - Add = A5555 { + Add = A5555 { Media { Stream = 1 { LocalControl { @@ -7331,16 +7805,16 @@ rfc3525_msg14() -> Mode = SendReceive, nt/jit=40 ; in ms }, - Local { + Local { v=0 c=IN IP4 $ m=audio $ RTP/AVP 4 a=ptime:30 }, - Remote { + Remote { v=0 c=IN IP4 124.124.124.222 m=audio 2222 RTP/AVP 4 a=ptime:30 } ; RTP profile for G.723.1 is 4 } } } - } + } }". %% Added ? @@ -7351,10 +7825,10 @@ rfc3525_msg15() -> Add = A5556 { Media { Stream = 1 { - Local { - v=0 o=- 7736844526 7736842807 IN IP4 125.125.125.111 s=- t= 0 0 c=IN IP4 125.125.125.111 m=audio 1111 RTP/AVP 4 + Local { + v=0 o=- 7736844526 7736842807 IN IP4 125.125.125.111 s=- t= 0 0 c=IN IP4 125.125.125.111 m=audio 1111 RTP/AVP 4 } ; RTP profile for G723.1 is 4 - } + } } } } @@ -7370,10 +7844,10 @@ rfc3525_msg16a() -> Modify = A4445 { Media { Stream = 1 { - Remote { + Remote { v=0 o=- 7736844526 7736842807 IN IP4 125.125.125.111 s=- t= 0 0 c=IN IP4 125.125.125.111 m=audio 1111 RTP/AVP 4 } ; RTP profile for G723.1 is 4 - } + } } } } @@ -7382,7 +7856,7 @@ rfc3525_msg16a() -> rfc3525_msg16b() -> "MEGACO/" ?VERSION_STR " [124.124.124.222]:55555 Reply = 10005 { Context = 2000 { - Modify = A4444, + Modify = A4444, Modify = A4445 } }". @@ -7439,7 +7913,7 @@ rfc3525_msg18a() -> } }, Modify = A4444 { - Signals + Signals } } }". @@ -7447,7 +7921,7 @@ rfc3525_msg18a() -> rfc3525_msg18b() -> "MEGACO/" ?VERSION_STR " [124.124.124.222]:55555 Reply = 10006 { Context = 2000 { - Modify = A4445, + Modify = A4445, Modify = A4444 } }". @@ -7466,22 +7940,22 @@ rfc3525_msg19() -> %% Added ? rfc3525_msg20() -> "MEGACO/" ?VERSION_STR " [125.125.125.111]:55555 Reply = 50007 { - Context = - { + Context = - { AuditValue = A5556 { Media { - TerminationState { + TerminationState { ServiceStates = InService, - Buffer = OFF + Buffer = OFF }, Stream = 1 { - LocalControl { + LocalControl { Mode = SendReceive, - nt/jit=40 + nt/jit=40 }, - Local { + Local { v=0 o=- 7736844526 7736842807 IN IP4 125.125.125.111 s=- t= 0 0 c=IN IP4 125.125.125.111 m=audio 1111 RTP/AVP 4 a=ptime:30 }, - Remote { + Remote { v=0 o=- 2890844526 2890842807 IN IP4 124.124.124.222 s=- t= 0 0 c=IN IP4 124.124.124.222 m=audio 2222 RTP/AVP 4 a=ptime:30 } } @@ -7490,7 +7964,7 @@ rfc3525_msg20() -> Signals, DigitMap, Packages {nt-1, rtp-1}, - Statistics { + Statistics { rtp/ps=1200, ; packets sent nt/os=62300, ; octets sent rtp/pr=700, ; packets received @@ -7498,7 +7972,7 @@ rfc3525_msg20() -> rtp/pl=0.2, ; % packet loss rtp/jit=20, rtp/delay=40 ; avg latency - } + } } } }". @@ -7657,14 +8131,14 @@ ticket_compact_encode_decode_ok(Msg) -> ticket_compact_encode_decode_ok(Msg, []). ticket_compact_encode_decode_ok(Msg, Conf) -> - Codec = megaco_compact_text_encoder, + Codec = megaco_compact_text_encoder, ticket_encode_decode_ok(Msg, Codec, Conf). ticket_pretty_encode_decode_ok(Msg) -> ticket_pretty_encode_decode_ok(Msg, []). ticket_pretty_encode_decode_ok(Msg, Conf) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_encode_decode_ok(Msg, Codec, Conf). ticket_encode_decode_ok(Msg, Codec, Conf0) -> @@ -7674,26 +8148,26 @@ ticket_encode_decode_ok(Msg, Codec, Conf0) -> Check = fun(M1, M2) -> chk_MegacoMessage(M1, M2) end, megaco_codec_test_lib:expect_encode_decode(Msg, Encode, Decode, Check). -%% -- +%% -- %% ticket_compact_encode_error(Msg) -> %% ticket_compact_encode_error(Msg, []). %% ticket_compact_encode_error(Msg, Conf) -> -%% Codec = megaco_compact_text_encoder, +%% Codec = megaco_compact_text_encoder, %% ticket_encode_error(Msg, Codec, Conf). %% ticket_pretty_encode_error(Msg) -> %% ticket_pretty_encode_error(Msg, []). ticket_pretty_encode_error(Msg, Conf) when is_list(Conf) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_encode_error(Msg, Codec, Conf); ticket_pretty_encode_error(Msg, Check) when is_function(Check) -> ticket_pretty_encode_error(Msg, [], Check). ticket_pretty_encode_error(Msg, Conf, Check) when is_function(Check) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_encode_error(Msg, Codec, Conf, Check). ticket_encode_error(Msg, Codec, Conf) when is_list(Conf) -> @@ -7711,14 +8185,14 @@ ticket_compact_decode_encode_ok(Msg) -> ticket_compact_decode_encode_ok(Msg, []). ticket_compact_decode_encode_ok(Msg, Conf) -> - Codec = megaco_compact_text_encoder, + Codec = megaco_compact_text_encoder, ticket_decode_encode_ok(Msg, Codec, Conf). ticket_pretty_decode_encode_ok(Msg) -> ticket_pretty_decode_encode_ok(Msg, []). ticket_pretty_decode_encode_ok(Msg, Conf) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_decode_encode_ok(Msg, Codec, Conf). ticket_decode_encode_ok(Msg, Codec, Conf0) -> @@ -7728,59 +8202,59 @@ ticket_decode_encode_ok(Msg, Codec, Conf0) -> Check = fun(M1, M2) -> chk_MegacoMessage(M1, M2) end, megaco_codec_test_lib:expect_decode_encode(Msg, Decode, Encode, Check). -%% -- +%% -- ticket_pretty_decode_encode_only(Msg, Check) -> ticket_pretty_decode_encode_only(Msg, Check, []). ticket_pretty_decode_encode_only(Msg, Check, Conf) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_decode_encode_only(Msg, Codec, Check, Conf). ticket_decode_encode_only(Msg, Codec, Check, Conf0) -> Conf = [?EC_V3|Conf0], Decode = fun(B) -> decode_message(Codec, false, Conf, B) end, Encode = fun(M) -> encode_message(Codec, Conf, M) end, - megaco_codec_test_lib:expect_decode_encode_only(Msg, Decode, Encode, + megaco_codec_test_lib:expect_decode_encode_only(Msg, Decode, Encode, Check). -%% -- +%% -- ticket_pretty_encode_decode_only(Msg) -> ticket_pretty_encode_decode_only(Msg, []). ticket_pretty_encode_decode_only(Msg, Conf) when is_list(Conf) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_encode_decode_only(Msg, Codec, Conf); ticket_pretty_encode_decode_only(Msg, Check) when is_function(Check) -> ticket_pretty_encode_decode_only(Msg, Check, []). ticket_pretty_encode_decode_only(Msg, Check, Conf) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_encode_decode_only(Msg, Codec, Check, Conf). ticket_encode_decode_only(Msg, Codec, Conf) -> - Check = fun(_) -> ok end, + Check = fun(_) -> ok end, ticket_encode_decode_only(Msg, Codec, Check, Conf). ticket_encode_decode_only(Msg, Codec, Check, Conf0) -> Conf = [?EC_V3|Conf0], Encode = fun(M) -> encode_message(Codec, Conf, M) end, Decode = fun(B) -> decode_message(Codec, false, Conf, B) end, - megaco_codec_test_lib:expect_encode_decode_only(Msg, Encode, Decode, + megaco_codec_test_lib:expect_encode_decode_only(Msg, Encode, Decode, Check). -%% -- +%% -- ticket_pretty_decode_only(Msg) -> ticket_pretty_decode_only(Msg, []). ticket_pretty_decode_only(Msg, Conf) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_decode_only(Msg, Codec, Conf). ticket_decode_only(Msg, Codec, Conf) -> - Check = fun(_) -> ok end, + Check = fun(_) -> ok end, ticket_decode_only(Msg, Codec, Check, Conf). ticket_decode_only(Msg, Codec, Check, Conf0) -> @@ -7788,7 +8262,7 @@ ticket_decode_only(Msg, Codec, Check, Conf0) -> Decode = fun(B) -> decode_message(Codec, false, Conf, B) end, megaco_codec_test_lib:expect_decode_only(Msg, Decode, Check). -ticket_check_decode_only_error_reason(R, Check) +ticket_check_decode_only_error_reason(R, Check) when is_list(R) and is_function(Check) -> case lists:keysearch(reason, 1, R) of {value, {reason, Reason}} -> @@ -7798,32 +8272,32 @@ ticket_check_decode_only_error_reason(R, Check) end. -%% -- +%% -- ticket_compact_decode_error(Msg) -> ticket_compact_decode_error(Msg, []). ticket_compact_decode_error(Msg, Conf) -> - Codec = megaco_compact_text_encoder, + Codec = megaco_compact_text_encoder, ticket_decode_error(Msg, Codec, Conf). ticket_pretty_decode_error(Msg) -> ticket_pretty_decode_error(Msg, []). ticket_pretty_decode_error(Msg, Conf) when is_list(Conf) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_decode_error(Msg, Codec, Conf); ticket_pretty_decode_error(Msg, Check) when is_function(Check) -> ticket_pretty_decode_error(Msg, [], Check). ticket_pretty_decode_error(Msg, Conf, Check) -> - Codec = megaco_pretty_text_encoder, + Codec = megaco_pretty_text_encoder, ticket_decode_error(Msg, Codec, Conf, Check). ticket_decode_error(Msg, Codec, Conf) -> - Check = fun(X) -> + Check = fun(X) -> d("decode error reason: ~n~p~n", [X]), - ok + ok end, % Only called when decode failes ticket_decode_error(Msg, Codec, Conf, Check). @@ -7832,7 +8306,7 @@ ticket_decode_error(Msg, Codec, Conf0, Check) -> Decode = fun(B) -> decode_message(Codec, false, Conf, B) end, megaco_codec_test_lib:expect_decode(Msg, Decode, Check). -%% -- +%% -- %% ticket_expect_exec(Instructions, Msg) -> %% megaco_codec_test_lib:expect_exec(Instructions, Msg). @@ -7850,7 +8324,7 @@ ticket_decode_error(Msg, Codec, Conf0, Check) -> %% decode_message(megaco_compact_text_encoder, DynamicDecode, Conf, Bin). decode_message(Codec, DynamicDecode, Conf, Bin) -> - megaco_codec_test_lib:decode_message(Codec, DynamicDecode, ?VERSION, + megaco_codec_test_lib:decode_message(Codec, DynamicDecode, ?VERSION, Conf, Bin). %% pretty_encode_message(Conf, Msg) -> @@ -7863,7 +8337,7 @@ encode_message(Codec, Conf, Msg) -> megaco_codec_test_lib:encode_message(Codec, ?VERSION, Conf, Msg). test_msgs(Codec, DynamicDecode, Conf, Msgs) -> - megaco_codec_test_lib:test_msgs(Codec, DynamicDecode, ?VERSION, Conf, + megaco_codec_test_lib:test_msgs(Codec, DynamicDecode, ?VERSION, Conf, fun chk_MegacoMessage/2, Msgs). @@ -7886,8 +8360,8 @@ cre_MegacoMessage(V, Mid, Body) -> cre_MegacoMessage(Mess). cre_AuthHeader() -> - SecParmIdx = [239, 205, 171, 137], - SeqNum = [18, 52, 86, 120], + SecParmIdx = [239, 205, 171, 137], + SeqNum = [18, 52, 86, 120], AD = [18, 52, 86, 120, 137, 171, 205, 239, 118, 84, 50, 16], cre_AuthHeader(SecParmIdx, SeqNum, AD). @@ -7926,7 +8400,7 @@ cre_SegRep(TransId, SN, SC) -> cre_TransAck(First, Last) -> ?MSG_LIB:cre_TransactionAck(First, Last). - + cre_ActReq(CtxId, CmdReqs) -> ?MSG_LIB:cre_ActionRequest(CtxId, CmdReqs). @@ -8027,7 +8501,7 @@ cre_IndAudTermStateDesc(PP, EBC, SS) -> cre_IndAudTermStateDesc(PP, EBC, SS, SSS) -> ?MSG_LIB:cre_IndAudTerminationStateDescriptor(PP, EBC, SS, SSS). -cre_IndAudEvsDesc(RID, PN) +cre_IndAudEvsDesc(RID, PN) when is_integer(RID) -> ?MSG_LIB:cre_IndAudEventsDescriptor(RID, PN). @@ -8074,7 +8548,7 @@ cre_StatsParm(Name, Val) -> ?MSG_LIB:cre_StatisticsParameter(Name, [Val]). -% Event related +% Event related cre_EvParm(Name, Val) -> ?MSG_LIB:cre_EventParameter(Name, Val). @@ -8103,7 +8577,7 @@ cre_SvcChParm(M, A, R, P) -> ?MSG_LIB:cre_ServiceChangeParm(M, A, P, R). cre_SvcChParm(M, A, R, P, IF) -> - ?MSG_LIB:cre_ServiceChangeParm(M, A, asn1_NOVALUE, P, R, asn1_NOVALUE, + ?MSG_LIB:cre_ServiceChangeParm(M, A, asn1_NOVALUE, P, R, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, IF). cre_SvcChResParm(A, P) -> @@ -8277,8 +8751,8 @@ cre_SecReqEv(N) -> cre_SecReqEv(N, EPL) -> ?MSG_LIB:cre_SecondRequestedEvent(N, EPL). -cre_SecReqEv(N, SID, EA) when is_list(N) and - is_integer(SID) and +cre_SecReqEv(N, SID, EA) when is_list(N) and + is_integer(SID) and is_record(EA, 'SecondRequestedActions') -> cre_SecReqEv(N, SID, EA, []); cre_SecReqEv(A, B, C) -> @@ -8307,7 +8781,7 @@ cre_Sig(Name, Dir, RID) -> cre_Sig(Name, [], Dir, RID). cre_Sig(Name, SPL, Dir, RID) -> - cre_Sig(Name, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, + cre_Sig(Name, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE, SPL, Dir, RID). cre_Sig(Name, SID, ST, Dur, NC, KA, SPL, Dir, RID) -> @@ -8325,7 +8799,7 @@ cre_NotifBehav(Tag, Val) -> cre_NotifCompl(NC) -> ?MSG_LIB:cre_NotifyCompletion(NC). -cre_SigType(ST) -> +cre_SigType(ST) -> ?MSG_LIB:cre_SignalType(ST). @@ -8433,6 +8907,5 @@ p(_,_,_,_) -> p(F, A) -> io:format("*** [~s] ***" - "~n " ++ F ++ "~n", + "~n " ++ F ++ "~n", [?FTS() | A]). - diff --git a/lib/megaco/test/megaco_config_SUITE.erl b/lib/megaco/test/megaco_config_SUITE.erl index 4d34e09d0d..557406f8c4 100644 --- a/lib/megaco/test/megaco_config_SUITE.erl +++ b/lib/megaco/test/megaco_config_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2019. All Rights Reserved. +%% Copyright Ericsson AB 2000-2021. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -600,7 +600,7 @@ transaction_id_counter_mg(Config) when is_list(Config) -> %% Await the counter worker procs termination i("await the counter working procs completion"), - await_completion_counter_working_procs(Pids), + ok = await_completion_counter_working_procs(Pids), %% Verify result i("verify counter result"), @@ -656,15 +656,52 @@ start_counter_working_procs([Pid | Pids]) -> Pid ! start, start_counter_working_procs(Pids). -await_completion_counter_working_procs([]) -> - ok; await_completion_counter_working_procs(Pids) -> + await_completion_counter_working_procs(Pids, [], []). + +await_completion_counter_working_procs([], _OKs, [] = _ERRs) -> + ok; +await_completion_counter_working_procs([], _OKs, ERRs) -> + {error, ERRs}; +await_completion_counter_working_procs(Pids, OKs, ERRs) -> receive {'EXIT', Pid, normal} -> + %% i("counter working process completion[~w, ~w, ~w] -> " + %% "Expected exit from counter process: " + %% "~n Pid: ~p", + %% [length(Pids), length(OKs), length(ERRs), Pid]), + Pids2 = lists:delete(Pid, Pids), + await_completion_counter_working_procs(Pids2, [Pid | OKs], ERRs); + {'EXIT', Pid, Reason} -> + e("counter working process completion[~w, ~w, ~w] -> " + "Unexpected exit from counter process: " + "~n Pid: ~p" + "~n Reason: ~p", + [length(Pids), length(OKs), length(ERRs), Pid, Reason]), Pids2 = lists:delete(Pid, Pids), - await_completion_counter_working_procs(Pids2); - _Any -> + await_completion_counter_working_procs(Pids2, OKs, [Pid | ERRs]); + + Any -> + e("counter working process completion[~w, ~w, ~w] -> " + "Unexpected message: " + "~n ~p", [length(Pids), length(OKs), length(ERRs), Any]), await_completion_counter_working_procs(Pids) + + after 10000 -> + %% If nothing has happened for this long, something is wrong: + %% Check system events + case megaco_test_global_sys_monitor:events() of + [] -> + i("counter working process completion[~w, ~w, ~w] -> " + "idle", [length(Pids), length(OKs), length(ERRs)]), + await_completion_counter_working_procs(Pids); + SysEvs -> + e("counter working process completion[~w, ~w, ~w] -> " + "system event(s): " + "~n ~p", + [length(Pids), length(OKs), length(ERRs), SysEvs]), + ?SKIP("TC idle with system events") + end end. @@ -677,119 +714,123 @@ transaction_id_counter_mgc(doc) -> "transaction counter handling of the application " "in with several connections (MGC). "]; transaction_id_counter_mgc(Config) when is_list(Config) -> - put(verbosity, ?TEST_VERBOSITY), - put(sname, "TEST"), - put(tc, transaction_id_counter_mgc), - process_flag(trap_exit, true), - - i("starting"), - - {ok, _ConfigPid} = megaco_config:start_link(), - - %% Basic user data - UserMid = {deviceName, "mgc"}, - UserConfig = [ - {min_trans_id, 1} - ], - - %% Basic connection data - RemoteMids = - [ - {deviceName, "mg01"}, - {deviceName, "mg02"}, - {deviceName, "mg03"}, - {deviceName, "mg04"}, - {deviceName, "mg05"}, - {deviceName, "mg06"}, - {deviceName, "mg07"}, - {deviceName, "mg08"}, - {deviceName, "mg09"}, - {deviceName, "mg10"} - ], - RecvHandles = - [ - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE}, - #megaco_receive_handle{local_mid = UserMid, - encoding_mod = ?MODULE, - encoding_config = [], - send_mod = ?MODULE} - ], - SendHandle = dummy_send_handle, - ControlPid = self(), + Name = transaction_id_counter_mgc, + Pre = fun() -> + i("starting config server"), + {ok, _ConfigPid} = megaco_config:start_link(), + + %% Basic user data + UserMid = {deviceName, "mgc"}, + UserConfig = [ + {min_trans_id, 1} + ], + + %% Basic connection data + RemoteMids = + [ + {deviceName, "mg01"}, + {deviceName, "mg02"}, + {deviceName, "mg03"}, + {deviceName, "mg04"}, + {deviceName, "mg05"}, + {deviceName, "mg06"}, + {deviceName, "mg07"}, + {deviceName, "mg08"}, + {deviceName, "mg09"}, + {deviceName, "mg10"} + ], + RecvHandles = + [ + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE}, + #megaco_receive_handle{local_mid = UserMid, + encoding_mod = ?MODULE, + encoding_config = [], + send_mod = ?MODULE} + ], + SendHandle = dummy_send_handle, + ControlPid = self(), - %% Start user - i("start user"), - ok = megaco_config:start_user(UserMid, UserConfig), + %% Start user + i("start user"), + ok = megaco_config:start_user(UserMid, UserConfig), + + %% Create connection + i("create connection(s)"), + CDs = create_connections(RecvHandles, + RemoteMids, + SendHandle, + ControlPid), + + %% Set counter limits + i("set counter max limit(s)"), + set_counter_max_limits(CDs, 1000), + + {UserMid, CDs} + end, + Case = fun({_, CDs}) -> + %% Create the counter worker procs + i("create counter working procs"), + Pids = create_counter_working_procs(CDs, ?NUM_CNT_PROCS), + + %% Start the counter worker procs + i("release the counter working procs"), + start_counter_working_procs(Pids), + + %% Await the counter worker procs termination + i("await the counter working procs completion"), + ok = await_completion_counter_working_procs(Pids), + + %% Verify result + i("verify counter result"), + verify_counter_results(CDs) + end, + + Post = fun({UserMid, CDs}) -> + %% Stop test + i("disconnect"), + delete_connections(CDs), + i("stop user"), + ok = megaco_config:stop_user(UserMid), + i("stop megaco_config"), + ok = megaco_config:stop() + end, + try_tc(Name, Pre, Case, Post). - %% Create connection - i("create connection(s)"), - CDs = create_connections(RecvHandles, RemoteMids, SendHandle, ControlPid), - - %% Set counter limits - i("set counter max limit(s)"), - set_counter_max_limits(CDs, 1000), - - %% Create the counter worker procs - i("create counter working procs"), - Pids = create_counter_working_procs(CDs, ?NUM_CNT_PROCS), - - %% Start the counter worker procs - i("release the counter working procs"), - start_counter_working_procs(Pids), - - %% Await the counter worker procs termination - i("await the counter working procs completion"), - await_completion_counter_working_procs(Pids), - - %% Verify result - i("verify counter result"), - verify_counter_results(CDs), - - %% Stop test - i("disconnect"), - delete_connections(CDs), - i("stop user"), - ok = megaco_config:stop_user(UserMid), - i("stop megaco_config"), - ok = megaco_config:stop(), - - i("done"), - ok. create_connections(RecvHandles, RemoteMids, SendHandle, ControlPid) -> create_connections(RecvHandles, RemoteMids, SendHandle, ControlPid, []). @@ -1218,6 +1259,15 @@ otp_8183(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +try_tc(TCName, Pre, Case, Post) -> + try_tc(TCName, "TEST", ?TEST_VERBOSITY, Pre, Case, Post). + +try_tc(TCName, Name, Verbosity, Pre, Case, Post) -> + ?TRY_TC(TCName, Name, Verbosity, Pre, Case, Post). + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + p(F) -> p(F, []). @@ -1234,7 +1284,10 @@ i(F) -> i(F, []). i(F, A) -> - print(info, get(verbosity), get(tc), "INF", F, A). + print(info, get(verbosity), get(tc), "INFO", F, A). + +e(F, A) -> + print(info, get(verbosity), get(tc), "ERROR", F, A). printable(_, debug) -> true; printable(info, info) -> true; diff --git a/lib/megaco/test/megaco_mess_SUITE.erl b/lib/megaco/test/megaco_mess_SUITE.erl index f3dfc053c6..be523f42a2 100644 --- a/lib/megaco/test/megaco_mess_SUITE.erl +++ b/lib/megaco/test/megaco_mess_SUITE.erl @@ -266,6 +266,7 @@ ]). -endif. +-include_lib("common_test/include/ct.hrl"). -include_lib("megaco/include/megaco.hrl"). -include_lib("megaco/include/megaco_message_v1.hrl"). -include("megaco_test_lib.hrl"). @@ -511,18 +512,19 @@ init_per_testcase(Case, Config) -> init_per_testcase2(otp_7189 = Case, Config) -> C = lists:keydelete(tc_timeout, 1, Config), - init_per_testcase3(Case, [{tc_timeout, min(2)} |C]); + init_per_testcase3(Case, [{tc_timeout, min(tfactor(2, Config))} |C]); init_per_testcase2(request_and_no_reply = Case, Config) -> C = lists:keydelete(tc_timeout, 1, Config), - init_per_testcase3(Case, [{tc_timeout, min(2)} |C]); + init_per_testcase3(Case, [{tc_timeout, min(tfactor(2, Config))} |C]); init_per_testcase2(Case, Config) -> C = lists:keydelete(tc_timeout, 1, Config), - init_per_testcase3(Case, [{tc_timeout, min(1)} |C]). + init_per_testcase3(Case, [{tc_timeout, min(tfactor(1, Config))} |C]). init_per_testcase3(Case, Config) -> megaco_test_global_sys_monitor:reset_events(), megaco_test_lib:init_per_testcase(Case, Config). - + + end_per_testcase(Case, Config) -> @@ -539,6 +541,13 @@ end_per_testcase(Case, Config) -> min(M) -> ?MINS(M). +tfactor(T, Config) -> + case ?config(megaco_factor, Config) of + Factor when is_integer(Factor) andalso (Factor > 1) -> + T * Factor; + _ -> + T + end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -10560,6 +10569,7 @@ otp_6442_resend_request2_mg_notify_request_ar(Rid, Tid, Cid) -> otp_6442_resend_reply1(suite) -> []; otp_6442_resend_reply1(Config) when is_list(Config) -> + Factor = ?config(megaco_factor, Config), Pre = fun() -> MgNode = make_node_name(mg), d("start (MG) node: ~p", [MgNode]), @@ -10567,14 +10577,14 @@ otp_6442_resend_reply1(Config) when is_list(Config) -> ok = ?START_NODES(Nodes, true), Nodes end, - Case = fun do_otp_6442_resend_reply1/1, + Case = fun(Nodes) -> do_otp_6442_resend_reply1(Nodes, Factor) end, Post = fun(Nodes) -> d("stop nodes"), ?STOP_NODES(lists:reverse(Nodes)) end, try_tc(request_and_no_reply, Pre, Case, Post). -do_otp_6442_resend_reply1([MgNode]) -> +do_otp_6442_resend_reply1([MgNode], Factor) -> d("[MG] start the simulator "), {ok, Mg} = megaco_test_megaco_generator:start_link("MG", MgNode), @@ -10591,7 +10601,7 @@ do_otp_6442_resend_reply1([MgNode]) -> {ok, MgId} = megaco_test_megaco_generator:exec(Mg, MgEvSeq), i("await the transport module service change send_message event"), - Pid = otp_6442_expect(fun otp_6442_rsrp1_verify_scr_msg/1, 5000), + Pid = otp_6442_expect(fun otp_6442_rsrp1_verify_scr_msg/1, Factor * 5000), i("wait some before issuing the service change reply"), sleep(500), @@ -10610,7 +10620,7 @@ do_otp_6442_resend_reply1([MgNode]) -> i("await the transport module first notify-reply send_message event from MG: " "ignore"), - otp_6442_expect(fun otp_6442_rsrp1_verify_first_nr_msg/1, 5000), + otp_6442_expect(fun otp_6442_rsrp1_verify_first_nr_msg/1, Factor * 5000), i("await the transport module second notify-reply send_message event from MG: " "ack"), @@ -10955,6 +10965,7 @@ otp_6442_resend_reply1_err_desc(T) -> otp_6442_resend_reply2(suite) -> []; otp_6442_resend_reply2(Config) when is_list(Config) -> + Factor = ?config(megaco_factor, Config), Pre = fun() -> MgNode = make_node_name(mg), d("start (MG) node: ~p", [MgNode]), @@ -10962,14 +10973,14 @@ otp_6442_resend_reply2(Config) when is_list(Config) -> ok = ?START_NODES(Nodes, true), Nodes end, - Case = fun do_otp_6442_resend_reply2/1, + Case = fun(Nodes) -> do_otp_6442_resend_reply2(Nodes, Factor) end, Post = fun(Nodes) -> d("stop nodes"), ?STOP_NODES(lists:reverse(Nodes)) end, try_tc(otp6442rrep2, Pre, Case, Post). -do_otp_6442_resend_reply2([MgNode]) -> +do_otp_6442_resend_reply2([MgNode], Factor) -> d("[MG] start the simulator "), {ok, Mg} = megaco_test_megaco_generator:start_link("MG", MgNode), @@ -10986,7 +10997,7 @@ do_otp_6442_resend_reply2([MgNode]) -> {ok, MgId} = megaco_test_megaco_generator:exec(Mg, MgEvSeq), i("await the transport module service change send_message event"), - Pid = otp_6442_expect(fun otp_6442_rsrp2_verify_scr_msg/1, 5000), + Pid = otp_6442_expect(fun otp_6442_rsrp2_verify_scr_msg/1, Factor * 5000), i("wait some before issuing the service change reply"), sleep(500), @@ -11004,7 +11015,7 @@ do_otp_6442_resend_reply2([MgNode]) -> megaco_test_generic_transport:incomming_message(Pid, NotifyRequest), i("await the transport module notify-reply send_message event from MG: ignore"), - otp_6442_expect(otp_6442_rsrp2_verify_first_nr_msg_fun(), 5000), + otp_6442_expect(otp_6442_rsrp2_verify_first_nr_msg_fun(), Factor * 5000), i("await the transport module notify-reply resend_message event from MG: ack"), {TransId, _, _} = @@ -13474,8 +13485,8 @@ otp_8183_r1_mgc_reply_msg(Mid, TransId, CR, Cid) -> {?MODULE, otp_8183_r1_mg_verify_handle_connect, []}). -define(otp_8183_r1_mg_verify_service_change_rep_fun(), {?MODULE, otp_8183_r1_mg_verify_service_change_rep, []}). --define(otp_8183_r1_mg_verify_notify_rep_fun(Nr - {?MODULE, otp_8183_r1_mg_verify_notify_rep, [Nr). +-define(otp_8183_r1_mg_verify_notify_rep_fun(Nr), + {?MODULE, otp_8183_r1_mg_verify_notify_rep, [Nr]}). -else. -define(otp_8183_r1_mg_verify_handle_connect_fun(), otp_8183_r1_mg_verify_handle_connect_fun()). diff --git a/lib/megaco/test/megaco_segment_SUITE.erl b/lib/megaco/test/megaco_segment_SUITE.erl index 08b86606de..3763a20954 100644 --- a/lib/megaco/test/megaco_segment_SUITE.erl +++ b/lib/megaco/test/megaco_segment_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2020. All Rights Reserved. +%% Copyright Ericsson AB 2006-2021. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -165,7 +165,7 @@ end_per_group(_Group, Config) -> init_per_testcase(Case, Config) -> process_flag(trap_exit, true), - p("init_per_suite -> entry with" + p("init_per_testcase -> entry with" "~n Config: ~p" "~n Nodes: ~p", [Config, erlang:nodes()]), @@ -175,7 +175,7 @@ init_per_testcase(Case, Config) -> end_per_testcase(Case, Config) -> process_flag(trap_exit, false), - p("end_per_suite -> entry with" + p("end_per_testcase -> entry with" "~n Config: ~p" "~n Nodes: ~p", [Config, erlang:nodes()]), @@ -806,17 +806,9 @@ send_segmented_msg_plain2(doc) -> "Second plain test that it is possible to send segmented messages. " "Send window = infinity. "; send_segmented_msg_plain2(Config) when is_list(Config) -> + Factor = ?config(megaco_factor, Config), + ct:timetrap(?MINS(1) + Factor * ?MINS(1)), Pre = fun() -> - %% We leave it commented out as test - %% All the other changes to the framework - %% may have "solved" the issues... - - %% <CONDITIONAL-SKIP> - %% Skippable = [{unix, [linux]}], - %% Condition = fun() -> ?OS_BASED_SKIP(Skippable) end, - %% ?NON_PC_TC_MAYBE_SKIP(Config, Condition), - %% </CONDITIONAL-SKIP> - MgcNode = make_node_name(mgc), MgNode = make_node_name(mg), d("start nodes: " @@ -827,20 +819,20 @@ send_segmented_msg_plain2(Config) when is_list(Config) -> ok = ?START_NODES(Nodes), Nodes end, - Case = fun do_send_segmented_msg_plain2/1, + Case = fun(X) -> do_send_segmented_msg_plain2(Factor, X) end, Post = fun(Nodes) -> d("stop nodes"), ?STOP_NODES(lists:reverse(Nodes)) end, try_tc(ssmp2, Pre, Case, Post). -do_send_segmented_msg_plain2([MgcNode, MgNode]) -> +do_send_segmented_msg_plain2(Factor, [MgcNode, MgNode]) -> d("[MGC] start the simulator "), {ok, Mgc} = megaco_test_tcp_generator:start_link("MGC", MgcNode), d("[MGC] create the event sequence"), - MgcEvSeq = ssmp2_mgc_event_sequence(text, tcp), + MgcEvSeq = ssmp2_mgc_event_sequence(Factor, text, tcp), i("wait some time before starting the MGC simulation"), sleep(1000), @@ -855,7 +847,7 @@ do_send_segmented_msg_plain2([MgcNode, MgNode]) -> {ok, Mg} = megaco_test_megaco_generator:start_link("MG", MgNode), d("[MG] create the event sequence"), - MgEvSeq = ssmp2_mg_event_sequence(text, tcp), + MgEvSeq = ssmp2_mg_event_sequence(Factor, text, tcp), i("wait some time before starting the MG simulation"), sleep(1000), @@ -883,7 +875,7 @@ do_send_segmented_msg_plain2([MgcNode, MgNode]) -> %% MGC generator stuff %% -ssmp2_mgc_event_sequence(text, tcp) -> +ssmp2_mgc_event_sequence(Factor, text, tcp) -> DecodeFun = ssmp2_mgc_decode_msg_fun(megaco_pretty_text_encoder, []), EncodeFun = ssmp2_mgc_encode_msg_fun(megaco_pretty_text_encoder, []), Mid = {deviceName,"mgc"}, @@ -908,6 +900,7 @@ ssmp2_mgc_event_sequence(text, tcp) -> SegmentRep1 = ssmp2_mgc_segment_reply_msg(Mid, TransId, 1, false), SegmentRep2 = ssmp2_mgc_segment_reply_msg(Mid, TransId, 2, true), TransAck = ssmp2_mgc_trans_ack_msg(Mid, TransId), + TO = fun(T) -> Factor * T end, EvSeq = [{debug, true}, {decode, DecodeFun}, {encode, EncodeFun}, @@ -915,15 +908,17 @@ ssmp2_mgc_event_sequence(text, tcp) -> {expect_accept, any}, {expect_receive, "service-change-request", {ScrVerifyFun, 5000}}, {send, "service-change-reply", ServiceChangeRep}, - {expect_nothing, timer:seconds(1)}, + {expect_nothing, ?SECS(1)}, {send, "notify request", NotifyReq}, - {expect_receive, "notify reply: segment 1", {NrVerifyFun1, 2000}}, + {expect_receive, "notify reply: segment 1", + {NrVerifyFun1, TO(?SECS(2))}}, {send, "segment reply 1", SegmentRep1}, - {expect_receive, "notify reply: segment 2", {NrVerifyFun2, 1000}}, + {expect_receive, "notify reply: segment 2", + {NrVerifyFun2, TO(?SECS(1))}}, {send, "segment reply 2", SegmentRep2}, {sleep, 100}, % {expect_nothing, 500}, {send, "transaction-ack", TransAck}, - {expect_closed, timer:seconds(5)}, + {expect_closed, TO(?SECS(5))}, disconnect ], EvSeq. @@ -1036,14 +1031,13 @@ ssmp2_mgc_verify_notify_reply_segment_msg_fun(SN, Last, ssmp2_mgc_verify_notify_reply_segment(#'MegacoMessage'{mess = Mess} = M, SN, Last, TransId, TermId, Cid) -> - io:format("ssmp2_mgc_verify_notify_reply_segment -> entry with" - "~n M: ~p" - "~n SN: ~p" - "~n Last: ~p" - "~n TransId: ~p" - "~n TermId: ~p" - "~n Cid: ~p" - "~n", [M, SN, Last, TransId, TermId, Cid]), + p("ssmp2_mgc_verify_notify_reply_segment -> entry with" + "~n M: ~p" + "~n SN: ~p" + "~n Last: ~p" + "~n TransId: ~p" + "~n TermId: ~p" + "~n Cid: ~p", [M, SN, Last, TransId, TermId, Cid]), Body = case Mess of #'Message'{version = ?VERSION, @@ -1173,7 +1167,7 @@ ssmp2_mgc_trans_ack_msg(Mid, TransId) -> %% %% MG generator stuff %% -ssmp2_mg_event_sequence(text, tcp) -> +ssmp2_mg_event_sequence(Factor, text, tcp) -> Mid = {deviceName,"mg"}, RI = [ {port, 2944}, @@ -1187,7 +1181,8 @@ ssmp2_mg_event_sequence(text, tcp) -> Tid1 = #megaco_term_id{id = ["00000000","00000000","00000001"]}, Tid2 = #megaco_term_id{id = ["00000000","00000000","00000002"]}, NotifyReqVerify = ssmp2_mg_verify_notify_request_fun(Tid1, Tid2), - AckVerify = ssmp2_mg_verify_ack_fun(), + AckVerify = ssmp2_mg_verify_ack_fun(), + SECS = fun(T) -> ?SECS(Factor * T) end, EvSeq = [ {debug, true}, {megaco_trace, disable}, @@ -1206,12 +1201,12 @@ ssmp2_mg_event_sequence(text, tcp) -> {megaco_update_conn_info, protocol_version, ?VERSION}, {megaco_update_conn_info, segment_send, infinity}, {megaco_update_conn_info, max_pdu_size, 128}, - {sleep, 1000}, + {sleep, ?SECS(1)}, {megaco_callback, handle_trans_request, NotifyReqVerify}, - {megaco_callback, handle_trans_ack, AckVerify, 5000}, + {megaco_callback, handle_trans_ack, AckVerify, SECS(5)}, megaco_stop_user, megaco_stop, - {sleep, 1000} + {sleep, ?SECS(1)} ], EvSeq. @@ -1220,12 +1215,12 @@ ssmp2_mg_verify_handle_connect_fun() -> fun(Ev) -> ssmp2_mg_verify_handle_connect(Ev) end. ssmp2_mg_verify_handle_connect({handle_connect, CH, 1}) -> - io:format("ssmp2_mg_verify_handle_connect -> ok" - "~n CH: ~p~n", [CH]), + p("ssmp2_mg_verify_handle_connect -> ok" + "~n CH: ~p", [CH]), {ok, CH, ok}; ssmp2_mg_verify_handle_connect(Else) -> - io:format("ssmp2_mg_verify_handle_connect -> unknown" - "~n Else: ~p~n", [Else]), + p("ssmp2_mg_verify_handle_connect -> unknown" + "~n Else: ~p", [Else]), {error, Else, ok}. @@ -1235,14 +1230,13 @@ ssmp2_mg_verify_service_change_reply_fun() -> ssmp2_mg_verify_scr({handle_trans_reply, _CH, 1, {ok, [AR]}, _}) -> (catch ssmp2_mg_do_verify_scr(AR)); ssmp2_mg_verify_scr(Crap) -> - io:format("ssmp2_mg_verify_scr -> error: " - "~n Crap: ~p" - "~n", [Crap]), + p("ssmp2_mg_verify_scr -> error: " + "~n Crap: ~p", [Crap]), {error, Crap, ok}. ssmp2_mg_do_verify_scr(AR) -> - io:format("ssmp2_mg_do_verify_scr -> ok: " - "~n AR: ~p~n", [AR]), + p("ssmp2_mg_do_verify_scr -> ok: " + "~n AR: ~p", [AR]), CR = case AR of #'ActionReply'{commandReply = [CmdRep]} -> @@ -1304,30 +1298,27 @@ ssmp2_mg_verify_notify_request( {handle_trans_request, CH, V, ARs}, _Tid1, _Tid2) -> {error, {invalid_trans_request, {CH, V, ARs}}, ok}; ssmp2_mg_verify_notify_request(Crap, _Tid1, _Tid2) -> - io:format("ssmp2_mg_verify_notify_request -> unknown request" - "~n Tid1: ~p" - "~n Tid2: ~p" - "~n Crap: ~p" - "~n", [_Tid1, _Tid2, Crap]), + p("ssmp2_mg_verify_notify_request -> unknown request" + "~n Tid1: ~p" + "~n Tid2: ~p" + "~n Crap: ~p", [_Tid1, _Tid2, Crap]), {error, {unexpected_event, Crap}, ok}. ssmp2_mg_do_verify_notify_request(Tid1, Tid2, AR1, AR2) -> - io:format("ssmp2_mg_do_verify_notify_request -> ok" - "~n Tid1: ~p" - "~n Tid2: ~p" - "~n AR1: ~p" - "~n AR2: ~p" - "~n", [Tid1, Tid2, AR1, AR2]), + p("ssmp2_mg_do_verify_notify_request -> ok" + "~n Tid1: ~p" + "~n Tid2: ~p" + "~n AR1: ~p" + "~n AR2: ~p", [Tid1, Tid2, AR1, AR2]), ActionReply1 = ssmp2_mg_do_verify_notify_request(Tid1, AR1), ActionReply2 = ssmp2_mg_do_verify_notify_request(Tid2, AR2), Reply = {{handle_ack, ssmp2}, [ActionReply1, ActionReply2]}, {ok, [AR1, AR2], Reply}. ssmp2_mg_do_verify_notify_request(Tid, AR) -> - io:format("ssmp2_mg_do_verify_notify_request -> ok" - "~n Tid: ~p" - "~n AR: ~p" - "~n", [Tid, AR]), + p("ssmp2_mg_do_verify_notify_request -> ok" + "~n Tid: ~p" + "~n AR: ~p", [Tid, AR]), {Cid, CR} = case AR of #'ActionRequest'{contextId = CtxId, @@ -1375,9 +1366,8 @@ ssmp2_mg_verify_ack_fun() -> fun(Event) -> ssmp2_mg_verify_ack(Event) end. ssmp2_mg_verify_ack({handle_trans_ack, CH, ?VERSION, ok, ssmp2}) -> - io:format("ssmp2_mg_verify_ack -> ok" - "~n CH: ~p" - "~n", [CH]), + p("ssmp2_mg_verify_ack -> ok" + "~n CH: ~p", [CH]), {ok, CH, ok}; ssmp2_mg_verify_ack({handle_trans_ack, CH, ?VERSION, ok, CrapAckData}) -> {error, {unknown_ack_data, CrapAckData, CH}, ok}; @@ -1412,6 +1402,8 @@ send_segmented_msg_plain3(doc) -> "Third plain test that it is possible to send segmented messages. " "Send window = 1. "; send_segmented_msg_plain3(Config) when is_list(Config) -> + Factor = ?config(megaco_factor, Config), + ct:timetrap(?MINS(1) + Factor * ?MINS(1)), Pre = fun() -> MgcNode = make_node_name(mgc), MgNode = make_node_name(mg), @@ -1612,9 +1604,8 @@ ssmp3_mgc_verify_service_change_req_msg_fun() -> end. ssmp3_mgc_verify_service_change_req(#'MegacoMessage'{mess = Mess} = M) -> - io:format("ssmp3_mgc_verify_service_change_req -> entry with" - "~n M: ~p" - "~n", [M]), + p("ssmp3_mgc_verify_service_change_req -> entry with" + "~n M: ~p", [M]), Body = case Mess of #'Message'{version = 1, @@ -1704,14 +1695,13 @@ ssmp3_mgc_verify_notify_reply_segment_msg_fun(SN, Last, ssmp3_mgc_verify_notify_reply_segment(#'MegacoMessage'{mess = Mess} = M, SN, Last, TransId, TermId, Cid) -> - io:format("ssmp3_mgc_verify_notify_reply_segment -> entry with" - "~n M: ~p" - "~n SN: ~p" - "~n Last: ~p" - "~n TransId: ~p" - "~n TermId: ~p" - "~n Cid: ~p" - "~n", [M, SN, Last, TransId, TermId, Cid]), + p("ssmp3_mgc_verify_notify_reply_segment -> entry with" + "~n M: ~p" + "~n SN: ~p" + "~n Last: ~p" + "~n TransId: ~p" + "~n TermId: ~p" + "~n Cid: ~p", [M, SN, Last, TransId, TermId, Cid]), Body = case Mess of #'Message'{version = ?VERSION, @@ -1903,12 +1893,12 @@ ssmp3_mg_verify_handle_connect_fun() -> fun(Ev) -> ssmp3_mg_verify_handle_connect(Ev) end. ssmp3_mg_verify_handle_connect({handle_connect, CH, 1}) -> - io:format("ssmp3_mg_verify_handle_connect -> ok" - "~n CH: ~p~n", [CH]), + p("ssmp3_mg_verify_handle_connect -> ok" + "~n CH: ~p", [CH]), {ok, CH, ok}; ssmp3_mg_verify_handle_connect(Else) -> - io:format("ssmp3_mg_verify_handle_connect -> unknown" - "~n Else: ~p~n", [Else]), + p("ssmp3_mg_verify_handle_connect -> unknown" + "~n Else: ~p", [Else]), {error, Else, ok}. @@ -1918,14 +1908,13 @@ ssmp3_mg_verify_service_change_reply_fun() -> ssmp3_mg_verify_scr({handle_trans_reply, _CH, 1, {ok, [AR]}, _}) -> (catch ssmp3_mg_do_verify_scr(AR)); ssmp3_mg_verify_scr(Crap) -> - io:format("ssmp3_mg_verify_scr -> error: " - "~n Crap: ~p" - "~n", [Crap]), + p("ssmp3_mg_verify_scr -> error: " + "~n Crap: ~p", [Crap]), {error, Crap, ok}. ssmp3_mg_do_verify_scr(AR) -> - io:format("ssmp3_mg_do_verify_scr -> ok: " - "~n AR: ~p~n", [AR]), + p("ssmp3_mg_do_verify_scr -> ok: " + "~n AR: ~p", [AR]), CR = case AR of #'ActionReply'{commandReply = [CmdRep]} -> @@ -1988,21 +1977,18 @@ ssmp3_mg_verify_notify_request( {handle_trans_request, CH, V, ARs}, _Tids) -> {error, {invalid_trans_request, {CH, V, ARs}}, ok}; ssmp3_mg_verify_notify_request(Crap, _Tids) -> - io:format("ssmp3_mg_verify_notify_request -> unknown request" - "~n Crap: ~p" - "~n Tids: ~p" - "~n", [Crap, _Tids]), + p("ssmp3_mg_verify_notify_request -> unknown request" + "~n Crap: ~p" + "~n Tids: ~p", [Crap, _Tids]), {error, {unexpected_event, Crap}, ok}. ssmp3_mg_do_verify_notify_request(Tids, ARs) -> - io:format("ssmp3_mg_do_verify_notify_request -> ok" - "~n Tids: ~p" - "~n ARs: ~p" - "~n", [Tids, ARs]), + p("ssmp3_mg_do_verify_notify_request -> ok" + "~n Tids: ~p" + "~n ARs: ~p", [Tids, ARs]), ActionReplies = ssmp3_mg_do_verify_notify_request_ars(Tids, ARs), - io:format("ssmp3_mg_do_verify_notify_request -> ok" - "~n ActionReplies: ~p" - "~n", [ActionReplies]), + p("ssmp3_mg_do_verify_notify_request -> ok" + "~n ActionReplies: ~p", [ActionReplies]), Reply = {{handle_ack, ssmp3}, ActionReplies}, {ok, ARs, Reply}. @@ -2016,10 +2002,9 @@ ssmp3_mg_do_verify_notify_request_ars([Tid|Tids], [AR|ARs], Acc) -> ssmp3_mg_do_verify_notify_request_ars(Tids, ARs, [ActionReply|Acc]). ssmp3_mg_do_verify_notify_request_ar(Tid, AR) -> - io:format("ssmp3_mg_do_verify_notify_request_ar -> ok" - "~n Tid: ~p" - "~n AR: ~p" - "~n", [Tid, AR]), + p("ssmp3_mg_do_verify_notify_request_ar -> ok" + "~n Tid: ~p" + "~n AR: ~p", [Tid, AR]), {Cid, CR} = case AR of #'ActionRequest'{contextId = CtxId, @@ -2067,9 +2052,8 @@ ssmp3_mg_verify_ack_fun() -> fun(Event) -> ssmp3_mg_verify_ack(Event) end. ssmp3_mg_verify_ack({handle_trans_ack, CH, ?VERSION, ok, ssmp3}) -> - io:format("ssmp3_mg_verify_ack -> ok" - "~n CH: ~p" - "~n", [CH]), + p("ssmp3_mg_verify_ack -> ok" + "~n CH: ~p", [CH]), {ok, CH, ok}; ssmp3_mg_verify_ack({handle_trans_ack, CH, ?VERSION, ok, CrapAckData}) -> {error, {unknown_ack_data, CrapAckData, CH}, ok}; @@ -2105,7 +2089,7 @@ send_segmented_msg_plain4(doc) -> "Send window = 3. "; send_segmented_msg_plain4(Config) when is_list(Config) -> Factor = ?config(megaco_factor, Config), - ct:timetrap(Factor * ?SECS(60)), + ct:timetrap(Factor * ?MINS(1)), Pre = fun() -> MgcNode = make_node_name(mgc), MgNode = make_node_name(mg), @@ -2302,9 +2286,8 @@ ssmp4_mgc_verify_service_change_req_msg_fun() -> end. ssmp4_mgc_verify_service_change_req(#'MegacoMessage'{mess = Mess} = M) -> - io:format("ssmp4_mgc_verify_service_change_req -> entry with" - "~n M: ~p" - "~n", [M]), + p("ssmp4_mgc_verify_service_change_req -> entry with" + "~n M: ~p", [M]), Body = case Mess of #'Message'{version = 1, @@ -2394,14 +2377,13 @@ ssmp4_mgc_verify_notify_reply_segment_msg_fun(SN, Last, ssmp4_mgc_verify_notify_reply_segment(#'MegacoMessage'{mess = Mess} = M, SN, Last, TransId, TermId, Cid) -> - io:format("ssmp4_mgc_verify_notify_reply_segment -> entry with" - "~n M: ~p" - "~n SN: ~p" - "~n Last: ~p" - "~n TransId: ~p" - "~n TermId: ~p" - "~n Cid: ~p" - "~n", [M, SN, Last, TransId, TermId, Cid]), + p("ssmp4_mgc_verify_notify_reply_segment -> entry with" + "~n M: ~p" + "~n SN: ~p" + "~n Last: ~p" + "~n TransId: ~p" + "~n TermId: ~p" + "~n Cid: ~p", [M, SN, Last, TransId, TermId, Cid]), Body = case Mess of #'Message'{version = ?VERSION, @@ -2582,7 +2564,7 @@ ssmp4_mg_event_sequence(Factor, text, tcp) -> {megaco_update_conn_info, max_pdu_size, 128}, {sleep, 1000}, {megaco_callback, handle_trans_request, NotifyReqVerify}, - {megaco_callback, handle_trans_ack, AckVerify, TO(15000)}, + {megaco_callback, handle_trans_ack, AckVerify, TO(?SECS(15))}, megaco_stop_user, megaco_stop, {sleep, 1000} @@ -2594,12 +2576,12 @@ ssmp4_mg_verify_handle_connect_fun() -> fun(Ev) -> ssmp4_mg_verify_handle_connect(Ev) end. ssmp4_mg_verify_handle_connect({handle_connect, CH, 1}) -> - io:format("ssmp4_mg_verify_handle_connect -> ok" - "~n CH: ~p~n", [CH]), + p("ssmp4_mg_verify_handle_connect -> ok" + "~n CH: ~p", [CH]), {ok, CH, ok}; ssmp4_mg_verify_handle_connect(Else) -> - io:format("ssmp4_mg_verify_handle_connect -> unknown" - "~n Else: ~p~n", [Else]), + p("ssmp4_mg_verify_handle_connect -> unknown" + "~n Else: ~p", [Else]), {error, Else, ok}. @@ -2609,14 +2591,13 @@ ssmp4_mg_verify_service_change_reply_fun() -> ssmp4_mg_verify_scr({handle_trans_reply, _CH, 1, {ok, [AR]}, _}) -> (catch ssmp4_mg_do_verify_scr(AR)); ssmp4_mg_verify_scr(Crap) -> - io:format("ssmp4_mg_verify_scr -> error: " - "~n Crap: ~p" - "~n", [Crap]), + p("ssmp4_mg_verify_scr -> error: " + "~n Crap: ~p", [Crap]), {error, Crap, ok}. ssmp4_mg_do_verify_scr(AR) -> - io:format("ssmp4_mg_do_verify_scr -> ok: " - "~n AR: ~p~n", [AR]), + p("ssmp4_mg_do_verify_scr -> ok: " + "~n AR: ~p", [AR]), CR = case AR of #'ActionReply'{commandReply = [CmdRep]} -> @@ -2761,9 +2742,8 @@ ssmp4_mg_verify_ack_fun() -> fun(Event) -> ssmp4_mg_verify_ack(Event) end. ssmp4_mg_verify_ack({handle_trans_ack, CH, ?VERSION, ok, ssmp4}) -> - io:format("ssmp4_mg_verify_ack -> ok" - "~n CH: ~p" - "~n", [CH]), + p("ssmp4_mg_verify_ack -> ok" + "~n CH: ~p", [CH]), {ok, CH, ok}; ssmp4_mg_verify_ack({handle_trans_ack, CH, ?VERSION, ok, CrapAckData}) -> {error, {unknown_ack_data, CrapAckData, CH}, ok}; @@ -2847,6 +2827,42 @@ do_send_segmented_msg_ooo1([MgcNode, MgNode]) -> d("[MG] start the simulation"), {ok, MgId} = megaco_test_megaco_generator:exec(Mg, MgEvSeq), + %% Await MGC ready for segments + d("await MGC trigger event"), + MgcPid = + receive + {ready_for_segmented_msg, mgc, Pid1} -> + d("received MGC trigger event"), + Pid1 + after 5000 -> + d("timeout waiting for MGC trigger event: ~p", + [megaco_test_lib:flush()]), + ?ERROR(timeout_MGC_trigger_event) + end, + + %% Await MG ready for segments + d("await MG trigger event"), + MgPid = + receive + {ready_for_segmented_msg, mg, Pid2} -> + d("received MG trigger event"), + Pid2 + after 5000 -> + d("timeout waiting for MG trigger event: ~p", + [megaco_test_lib:flush()]), + ?ERROR(timeout_MG_trigger_event) + end, + + %% Instruct the MG to continue + d("send continue to MG"), + MgPid ! {continue_with_segmented_msg, self()}, + + sleep(500), + + %% Instruct the MGC to continue + d("send continue to MGC"), + MgcPid ! {continue_with_segmented_msg, self()}, + d("await the generator reply(s)"), await_completion([MgcId, MgId]), @@ -2873,6 +2889,8 @@ ssmo1_mgc_event_sequence(text, tcp) -> Mid = {deviceName,"mgc"}, ScrVerifyFun = ssmo1_mgc_verify_service_change_req_msg_fun(), ServiceChangeRep = ssmo1_mgc_service_change_reply_msg(Mid, 1), + AnnounceReadySegs = ssmo1_mgc_announce_ready_for_segmented_msg_fun(), + AwaitContinueSegs = ssmo1_mgc_continue_with_segmented_msg_fun(), TermId1 = #megaco_term_id{id = ["00000000","00000000","00000001"]}, CtxId1 = 1, @@ -2943,7 +2961,13 @@ ssmo1_mgc_event_sequence(text, tcp) -> {expect_accept, any}, {expect_receive, "service-change-request", {ScrVerifyFun, 5000}}, {send, "service-change-reply", ServiceChangeRep}, - {expect_nothing, 1000}, + + {trigger, "announce ready for segmented message", + AnnounceReadySegs}, + {trigger, "await continue for segmented message", + AwaitContinueSegs}, + + %% {expect_nothing, 1000}, {send, "notify request", NotifyReq}, {expect_receive, "notify reply: segment 1", {NrVerifyFun1, 1000}}, {expect_receive, "notify reply: segment 2", {NrVerifyFun2, 1000}}, @@ -2992,9 +3016,8 @@ ssmo1_mgc_verify_service_change_req_msg_fun() -> end. ssmo1_mgc_verify_service_change_req(#'MegacoMessage'{mess = Mess} = M) -> - io:format("ssmo1_mgc_verify_service_change_req -> entry with" - "~n M: ~p" - "~n", [M]), + p("ssmo1_mgc_verify_service_change_req -> entry with" + "~n M: ~p", [M]), Body = case Mess of #'Message'{version = 1, @@ -3074,6 +3097,23 @@ ssmo1_mgc_verify_service_change_req(#'MegacoMessage'{mess = Mess} = M) -> {error, {invalid_serviceChangeParms, Parms}} end. +ssmo1_mgc_announce_ready_for_segmented_msg_fun() -> + TC = self(), + fun() -> + TC ! {ready_for_segmented_msg, mgc, self()} + end. + +ssmo1_mgc_continue_with_segmented_msg_fun() -> + TC = self(), + fun() -> + p("[MGC] await continue with segmented message"), + receive + {continue_with_segmented_msg, TC} -> + p("[MGC] received continue with segmented message"), + ok + end + end. + ssmo1_mgc_verify_notify_reply_segment_msg_fun(SN, Last, TransId, TermId, Cid) -> fun(Msg) -> @@ -3240,6 +3280,8 @@ ssmo1_mg_event_sequence(text, tcp) -> ConnectVerify = ssmo1_mg_verify_handle_connect_fun(), ServiceChangeReq = ssmo1_mg_service_change_request_ar(Mid, 1), ServiceChangeReplyVerify = ssmo1_mg_verify_service_change_reply_fun(), + AnnounceReadySegs = ssmo1_mg_announce_ready_for_segmented_msg_fun(), + AwaitContinueSegs = ssmo1_mg_continue_with_segmented_msg_fun(), Tid1 = #megaco_term_id{id = ["00000000","00000000","00000001"]}, Tid2 = #megaco_term_id{id = ["00000000","00000000","00000002"]}, Tid3 = #megaco_term_id{id = ["00000000","00000000","00000003"]}, @@ -3268,8 +3310,13 @@ ssmo1_mg_event_sequence(text, tcp) -> {megaco_callback, handle_trans_reply, ServiceChangeReplyVerify}, {megaco_update_conn_info, protocol_version, ?VERSION}, {megaco_update_conn_info, segment_send, 3}, - {megaco_update_conn_info, max_pdu_size, 128}, - {sleep, 1000}, + {megaco_update_conn_info, max_pdu_size, 128}, + + {trigger, "announce ready for segmented message", + AnnounceReadySegs}, + {trigger, "await continue for segmented message", + AwaitContinueSegs}, + {megaco_callback, handle_trans_request, NotifyReqVerify}, {megaco_callback, handle_trans_ack, AckVerify, 15000}, megaco_stop_user, @@ -3278,7 +3325,6 @@ ssmo1_mg_event_sequence(text, tcp) -> ], EvSeq. - ssmo1_mg_verify_handle_connect_fun() -> fun(Ev) -> ssmo1_mg_verify_handle_connect(Ev) end. @@ -3354,6 +3400,23 @@ ssmo1_mg_do_verify_scr(AR) -> {error, Reason6, ok} end. +ssmo1_mg_announce_ready_for_segmented_msg_fun() -> + TC = self(), + fun() -> + TC ! {ready_for_segmented_msg, mg, self()} + end. + +ssmo1_mg_continue_with_segmented_msg_fun() -> + TC = self(), + fun() -> + p("[MG] await continue with segmented message"), + receive + {continue_with_segmented_msg, TC} -> + p("[MG] received continue with segmented message"), + ok + end + end. + ssmo1_mg_verify_notify_request_fun(Tids) -> fun(Req) -> ssmo1_mg_verify_notify_request(Req, Tids) end. @@ -7896,12 +7959,12 @@ await_completion(Ids) -> ok; {error, {OK, ERROR}} -> d("ERROR => " - "~n OK: ~p" - "~n ERROR: ~p", [OK, ERROR]), + "~n OK: ~p" + "~n ERROR: ~p", [OK, ERROR]), ?ERROR({failed, ERROR}); {error, Reply} -> d("ERROR => " - "~n Reply: ~p", [Reply]), + "~n Reply: ~p", [Reply]), ?ERROR({failed, Reply}) end. @@ -7934,6 +7997,9 @@ try_tc(TCName, Name, Verbosity, Pre, Case, Post) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +p(F) -> + p(F, []). + p(F, A) -> io:format("*** [~s] ~p ***" "~n " ++ F ++ "~n", diff --git a/lib/megaco/test/megaco_test_lib.erl b/lib/megaco/test/megaco_test_lib.erl index 1e4b7841ee..a04b27a061 100644 --- a/lib/megaco/test/megaco_test_lib.erl +++ b/lib/megaco/test/megaco_test_lib.erl @@ -28,7 +28,10 @@ %% -compile(export_all). +-compile({no_auto_import, [error/3]}). + -export([ + proxy_call/3, log/4, error/3, @@ -71,6 +74,31 @@ %% ---------------------------------------------------------------- +%% Proxy Call +%% This is used when we need to assign a timeout to a call, but the +%% call itself does not provide such an argument. +%% +%% This has nothing to to with the proxy_start and proxy_init +%% functions below. + +proxy_call(F, Timeout, Default) + when is_function(F, 0) andalso + is_integer(Timeout) andalso (Timeout > 0) andalso + is_function(Default, 0) -> + {P, M} = erlang:spawn_monitor(fun() -> exit(F()) end), + receive + {'DOWN', M, process, P, Reply} -> + Reply + after Timeout -> + erlang:demonitor(M, [flush]), + exit(P, kill), + Default() + end; +proxy_call(F, Timeout, Default) -> + proxy_call(F, Timeout, fun() -> Default end). + + +%% ---------------------------------------------------------------- %% Time related function %% @@ -164,6 +192,10 @@ os_base_skip(Skippable, OsFam, OsName) -> case lists:keysearch(OsFam, 1, Skippable) of {value, {OsFam, OsName}} -> true; + {value, {OsFam, Check}} when is_function(Check, 0) -> + Check(); + {value, {OsFam, Check}} when is_function(Check, 1) -> + Check(os:version()); {value, {OsFam, OsNames}} when is_list(OsNames) -> %% OsNames is a list of: %% [atom()|{atom(), function/0 | function/1}] @@ -443,11 +475,31 @@ pprint(F, A) -> init_per_suite(Config) -> + ct:timetrap(minutes(3)), + + try analyze_and_print_host_info() of + {Factor, HostInfo} when is_integer(Factor) -> + try maybe_skip(HostInfo) of + true -> + {skip, "Unstable host and/or os (or combo thererof)"}; + false -> + maybe_start_global_sys_monitor(Config), + [{megaco_factor, Factor} | Config] + catch + throw:{skip, _} = SKIP -> + SKIP + end + catch + throw:{skip, _} = SKIP -> + SKIP + end. + +maybe_skip(_HostInfo) -> + %% We have some crap machines that causes random test case failures %% for no obvious reason. So, attempt to identify those without actually %% checking for the host name... - %% We have two "machines" we are checking for. Both are old installations - %% running on really slow VMs (the host machines are old and tired). + LinuxVersionVerify = fun(V) when (V > {3,6,11}) -> false; % OK - No skip @@ -458,6 +510,28 @@ init_per_suite(Config) -> _ -> false end; + (V) when (V =:= {3,4,20}) -> + case string:trim(os:cmd("cat /etc/issue")) of + "Wind River Linux 5.0.1.0" ++ _ -> % *Old* Wind River => skip + true; + _ -> + false + end; + (V) when (V =:= {2,6,32}) -> + case string:trim(os:cmd("cat /etc/issue")) of + "Debian GNU/Linux 6.0 " ++ _ -> % Stone age Debian => Skip + true; + _ -> + false + end; + (V) when (V =:= {2,6,10}) -> + case string:trim(os:cmd("cat /etc/issue")) of + "MontaVista" ++ _ -> % Stone age MontaVista => Skip + %% The real problem is that the machine is *very* slow + true; + _ -> + false + end; (V) when (V > {2,6,24}) -> false; % OK - No skip (_) -> @@ -478,37 +552,27 @@ init_per_suite(Config) -> %% This version is *not* ok: Skip true end, - %% We are "looking" for a specific machine (a VM) - %% which are *old and crappy" and slow, because it - %% causes a bunch of test cases to fail randomly. - %% But we don not want to test for the host name... - WinVersionVerify = - fun(V) when (V =:= {6,2,9200}) -> - try erlang:system_info(schedulers) of - 2 -> - true; - _ -> - false - catch - _:_:_ -> - true - end; - (_) -> + SkipWindowsOnVirtual = + %% fun() -> + %% SysMan = win_sys_info_lookup(system_manufacturer, HostInfo), + %% case string:to_lower(SysMan) of + %% "vmware" ++ _ -> + %% true; + %% _ -> + %% false + %% end + %% end, + fun() -> + %% The host has been replaced and the VM has been reinstalled + %% so for now we give it a chance... false - end, + end, COND = [ {unix, [{linux, LinuxVersionVerify}, - {darwin, DarwinVersionVerify}]}%% , - %% {win32, [{nt, WinVersionVerify}]} + {darwin, DarwinVersionVerify}]}, + {win32, SkipWindowsOnVirtual} ], - case os_based_skip(COND) of - true -> - {skip, "Unstable host and/or os (or combo thererof)"}; - false -> - Factor = analyze_and_print_host_info(), - maybe_start_global_sys_monitor(Config), - [{megaco_factor, Factor} | Config] - end. + os_based_skip(COND). %% We start the global system monitor unless explicitly disabled maybe_start_global_sys_monitor(Config) -> @@ -569,10 +633,6 @@ end_per_testcase(_Case, Config) -> %% the load for some test cases. Such as run time or number of %% iteraions. This only works for some OSes. %% -%% We make some calculations on Linux, OpenBSD and FreeBSD. -%% On SunOS we always set the factor to 2 (just to be on the safe side) -%% On all other os:es (mostly windows) we check the number of schedulers, -%% but at least the factor will be 2. analyze_and_print_host_info() -> {OsFam, OsName} = os:type(), Version = @@ -589,138 +649,309 @@ analyze_and_print_host_info() -> analyze_and_print_openbsd_host_info(Version); {unix, freebsd} -> analyze_and_print_freebsd_host_info(Version); + {unix, netbsd} -> + analyze_and_print_netbsd_host_info(Version); + {unix, darwin} -> + analyze_and_print_darwin_host_info(Version); {unix, sunos} -> analyze_and_print_solaris_host_info(Version); {win32, nt} -> analyze_and_print_win_host_info(Version); _ -> io:format("OS Family: ~p" - "~n OS Type: ~p" - "~n Version: ~p" - "~n Num Schedulers: ~s" + "~n OS Type: ~p" + "~n Version: ~p" + "~n Num Online Schedulers: ~s" "~n", [OsFam, OsName, Version, str_num_schedulers()]), - try erlang:system_info(schedulers) of - 1 -> - 10; - 2 -> - 5; - N when (N =< 6) -> - 2; - _ -> - 1 - catch - _:_:_ -> - 10 - end + {num_schedulers_to_factor(), []} end. str_num_schedulers() -> - try erlang:system_info(schedulers) of + try erlang:system_info(schedulers_online) of N -> f("~w", [N]) catch _:_:_ -> "-" end. +num_schedulers_to_factor() -> + try erlang:system_info(schedulers_online) of + 1 -> + 10; + 2 -> + 5; + N when (N =< 6) -> + 2; + _ -> + 1 + catch + _:_:_ -> + 10 + end. -analyze_and_print_linux_host_info(Version) -> + + +linux_which_distro(Version) -> case file:read_file_info("/etc/issue") of {ok, _} -> - io:format("Linux: ~s" - "~n ~s" - "~n", - [Version, string:trim(os:cmd("cat /etc/issue"))]); + case [string:trim(S) || + S <- string:tokens(os:cmd("cat /etc/issue"), [$\n])] of + [DistroStr|_] -> + io:format("Linux: ~s" + "~n ~s" + "~n", + [Version, DistroStr]), + case DistroStr of + "Wind River Linux" ++ _ -> + wind_river; + "MontaVista" ++ _ -> + montavista; + "Yellow Dog" ++ _ -> + yellow_dog; + _ -> + other + end; + X -> + io:format("Linux: ~s" + "~n ~p" + "~n", + [Version, X]), + other + end; _ -> io:format("Linux: ~s" - "~n", [Version]) - end, + "~n", [Version]), + other + end. + + +analyze_and_print_linux_host_info(Version) -> + Distro = linux_which_distro(Version), Factor = - case (catch linux_which_cpuinfo()) of + case (catch linux_which_cpuinfo(Distro)) of {ok, {CPU, BogoMIPS}} -> io:format("CPU: " - "~n Model: ~s" - "~n BogoMIPS: ~s" - "~n Num Schedulers: ~s" + "~n Model: ~s" + "~n BogoMIPS: ~w" + "~n Num Online Schedulers: ~s" "~n", [CPU, BogoMIPS, str_num_schedulers()]), - %% We first assume its a float, and if not try integer - try list_to_float(string:trim(BogoMIPS)) of - F when F > 4000 -> + if + (BogoMIPS > 20000) -> 1; - F when F > 1000 -> + (BogoMIPS > 10000) -> 2; - F when F > 500 -> + (BogoMIPS > 5000) -> 3; - _ -> - 5 - catch - _:_:_ -> - try list_to_integer(string:trim(BogoMIPS)) of - I when I > 4000 -> - 1; - I when I > 1000 -> - 2; - I when I > 500 -> - 3; - _ -> - 5 - catch - _:_:_ -> - 5 % Be a "bit" conservative... - end + (BogoMIPS > 2000) -> + 5; + (BogoMIPS > 1000) -> + 8; + true -> + 10 end; {ok, CPU} -> io:format("CPU: " - "~n Model: ~s" - "~n Num Schedulers: ~s" + "~n Model: ~s" + "~n Num Online Schedulers: ~s" "~n", [CPU, str_num_schedulers()]), - 2; % Be a "bit" conservative... + num_schedulers_to_factor(); _ -> - 5 % Be a "bit" (more) conservative... + 5 end, %% Check if we need to adjust the factor because of the memory try linux_which_meminfo() of AddFactor -> - Factor + AddFactor + {Factor + AddFactor, []} catch _:_:_ -> - Factor + {Factor, []} + end. + + +linux_cpuinfo_lookup(Key) when is_list(Key) -> + linux_info_lookup(Key, "/proc/cpuinfo"). + +linux_cpuinfo_cpu() -> + case linux_cpuinfo_lookup("cpu") of + [Model] -> + Model; + _ -> + "-" + end. + +linux_cpuinfo_motherboard() -> + case linux_cpuinfo_lookup("motherboard") of + [MB] -> + MB; + _ -> + "-" + end. + +linux_cpuinfo_bogomips() -> + case linux_cpuinfo_lookup("bogomips") of + BMips when is_list(BMips) -> + try lists:sum([bogomips_to_int(BM) || BM <- BMips]) + catch + _:_:_ -> + "-" + end; + _ -> + "-" + end. + +linux_cpuinfo_total_bogomips() -> + case linux_cpuinfo_lookup("total bogomips") of + [TBM] -> + try bogomips_to_int(TBM) + catch + _:_:_ -> + "-" + end; + _ -> + "-" + end. + +bogomips_to_int(BM) -> + try list_to_float(BM) of + F -> + floor(F) + catch + _:_:_ -> + try list_to_integer(BM) of + I -> + I + catch + _:_:_ -> + throw(noinfo) + end + end. + +linux_cpuinfo_model() -> + case linux_cpuinfo_lookup("model") of + [M] -> + M; + _ -> + "-" + end. + +linux_cpuinfo_platform() -> + case linux_cpuinfo_lookup("platform") of + [P] -> + P; + _ -> + "-" + end. + +linux_cpuinfo_model_name() -> + case linux_cpuinfo_lookup("model name") of + [P|_] -> + P; + _X -> + "-" + end. + +linux_cpuinfo_processor() -> + case linux_cpuinfo_lookup("Processor") of + [P] -> + P; + _ -> + "-" end. -linux_which_cpuinfo() -> +linux_which_cpuinfo(montavista) -> + CPU = + case linux_cpuinfo_cpu() of + "-" -> + throw(noinfo); + Model -> + case linux_cpuinfo_motherboard() of + "-" -> + Model; + MB -> + Model ++ " (" ++ MB ++ ")" + end + end, + case linux_cpuinfo_bogomips() of + "-" -> + {ok, CPU}; + BMips -> + {ok, {CPU, BMips}} + end; + +linux_which_cpuinfo(yellow_dog) -> + CPU = + case linux_cpuinfo_cpu() of + "-" -> + throw(noinfo); + Model -> + case linux_cpuinfo_motherboard() of + "-" -> + Model; + MB -> + Model ++ " (" ++ MB ++ ")" + end + end, + {ok, CPU}; + +linux_which_cpuinfo(wind_river) -> + CPU = + case linux_cpuinfo_model() of + "-" -> + throw(noinfo); + Model -> + case linux_cpuinfo_platform() of + "-" -> + Model; + Platform -> + Model ++ " (" ++ Platform ++ ")" + end + end, + case linux_cpuinfo_total_bogomips() of + "-" -> + {ok, CPU}; + BMips -> + {ok, {CPU, BMips}} + end; + +linux_which_cpuinfo(other) -> %% Check for x86 (Intel or AMD) CPU = - try [string:trim(S) || S <- string:tokens(os:cmd("grep \"model name\" /proc/cpuinfo"), [$:,$\n])] of - ["model name", ModelName | _] -> - ModelName; - _ -> + case linux_cpuinfo_model_name() of + "-" -> %% ARM (at least some distros...) - try [string:trim(S) || S <- string:tokens(os:cmd("grep \"Processor\" /proc/cpuinfo"), [$:,$\n])] of - ["Processor", Proc | _] -> - Proc; - _ -> + case linux_cpuinfo_processor() of + "-" -> %% Ok, we give up - throw(noinfo) - catch - _:_:_ -> - throw(noinfo) - end - catch - _:_:_ -> - throw(noinfo) + throw(noinfo); + Proc -> + Proc + end; + ModelName -> + ModelName end, - try [string:trim(S) || S <- string:tokens(os:cmd("grep -i \"bogomips\" /proc/cpuinfo"), [$:,$\n])] of - [_, BMips | _] -> - {ok, {CPU, BMips}}; + case linux_cpuinfo_bogomips() of + "-" -> + {ok, CPU}; + BMips -> + {ok, {CPU, BMips}} + end. + +linux_meminfo_lookup(Key) when is_list(Key) -> + linux_info_lookup(Key, "/proc/meminfo"). + +linux_meminfo_memtotal() -> + case linux_meminfo_lookup("MemTotal") of + [X] -> + X; _ -> - {ok, CPU} - catch - _:_:_ -> - {ok, CPU} + "-" end. %% We *add* the value this return to the Factor. linux_which_meminfo() -> - try [string:trim(S) || S <- string:tokens(os:cmd("grep MemTotal /proc/meminfo"), [$:])] of - [_, MemTotal] -> + case linux_meminfo_memtotal() of + "-" -> + 0; + MemTotal -> io:format("Memory:" "~n ~s" "~n", [MemTotal]), @@ -750,12 +981,7 @@ linux_which_meminfo() -> end; _X -> 0 - end; - _ -> - 0 - catch - _:_:_ -> - 0 + end end. @@ -841,11 +1067,11 @@ analyze_and_print_openbsd_host_info(Version) -> true -> 3 end, - CPUFactor + MemAddFactor + {CPUFactor + MemAddFactor, []} end catch _:_:_ -> - 1 + {5, []} end. @@ -928,21 +1154,22 @@ analyze_and_print_freebsd_host_info(Version) -> true -> 3 end, - CPUFactor + MemAddFactor + {CPUFactor + MemAddFactor, []} end catch _:_:_ -> io:format("CPU:" "~n Num Schedulers: ~w" "~n", [erlang:system_info(schedulers)]), - case erlang:system_info(schedulers) of - 1 -> - 10; - 2 -> - 5; - _ -> - 2 - end + Factor = case erlang:system_info(schedulers) of + 1 -> + 10; + 2 -> + 5; + _ -> + 2 + end, + {Factor, []} end. analyze_freebsd_cpu(Extract) -> @@ -982,6 +1209,426 @@ analyze_freebsd_item(Extract, Key, Process, Default) -> end. +analyze_and_print_netbsd_host_info(Version) -> + io:format("NetBSD:" + "~n Version: ~p" + "~n", [Version]), + %% This test require that the program 'sysctl' is in the path. + %% First test with 'which sysctl', if that does not work + %% try with 'which /sbin/sysctl'. If that does not work either, + %% we skip the test... + try + begin + SysCtl = + case string:trim(os:cmd("which sysctl")) of + [] -> + case string:trim(os:cmd("which /sbin/sysctl")) of + [] -> + throw(sysctl); + SC2 -> + SC2 + end; + SC1 -> + SC1 + end, + Extract = + fun(Key) -> + [string:trim(S) || + S <- + string:tokens(string:trim(os:cmd(SysCtl ++ " " ++ Key)), + [$=])] + end, + CPU = analyze_netbsd_cpu(Extract), + Machine = analyze_netbsd_machine(Extract), + Arch = analyze_netbsd_machine_arch(Extract), + CPUSpeed = analyze_netbsd_cpu_speed(Extract), + NCPU = analyze_netbsd_ncpu(Extract), + Memory = analyze_netbsd_memory(Extract), + io:format("CPU:" + "~n Model: ~s (~s, ~s)" + "~n Speed: ~w MHz" + "~n N: ~w" + "~n Num Schedulers: ~w" + "~nMemory:" + "~n ~w KB" + "~n", + [CPU, Machine, Arch, CPUSpeed, NCPU, + erlang:system_info(schedulers), Memory]), + CPUFactor = + if + (CPUSpeed =:= -1) -> + 1; + (CPUSpeed >= 2000) -> + if + (NCPU >= 4) -> + 1; + (NCPU >= 2) -> + 2; + true -> + 3 + end; + true -> + if + (NCPU =:= -1) -> + 1; + (NCPU >= 4) -> + 2; + (NCPU >= 2) -> + 3; + true -> + 4 + end + end, + MemAddFactor = + if + (Memory =:= -1) -> + 0; + (Memory >= 8388608) -> + 0; + (Memory >= 4194304) -> + 1; + (Memory >= 2097152) -> + 2; + true -> + 3 + end, + {CPUFactor + MemAddFactor, []} + end + catch + _:_:_ -> + io:format("CPU:" + "~n Num Schedulers: ~w" + "~n", [erlang:system_info(schedulers)]), + Factor = case erlang:system_info(schedulers) of + 1 -> + 10; + 2 -> + 5; + _ -> + 2 + end, + {Factor, []} + end. + +analyze_netbsd_cpu(Extract) -> + analyze_netbsd_item(Extract, "hw.model", fun(X) -> X end, "-"). + +analyze_netbsd_machine(Extract) -> + analyze_netbsd_item(Extract, "hw.machine", fun(X) -> X end, "-"). + +analyze_netbsd_machine_arch(Extract) -> + analyze_netbsd_item(Extract, "hw.machine_arch", fun(X) -> X end, "-"). + +analyze_netbsd_cpu_speed(Extract) -> + analyze_netbsd_item(Extract, "machdep.dmi.processor-frequency", + fun(X) -> case string:tokens(X, [$\ ]) of + [MHz, "MHz"] -> + list_to_integer(MHz); + _ -> + -1 + end + end, "-"). + +analyze_netbsd_ncpu(Extract) -> + analyze_netbsd_item(Extract, + "hw.ncpu", + fun(X) -> list_to_integer(X) end, + -1). + +analyze_netbsd_memory(Extract) -> + analyze_netbsd_item(Extract, + "hw.physmem64", + fun(X) -> list_to_integer(X) div 1024 end, + -1). + +analyze_netbsd_item(Extract, Key, Process, Default) -> + analyze_freebsd_item(Extract, Key, Process, Default). + + + +%% Model Identifier: Macmini7,1 +%% Processor Name: Intel Core i5 +%% Processor Speed: 2,6 GHz +%% Number of Processors: 1 +%% Total Number of Cores: 2 +%% L2 Cache (per Core): 256 KB +%% L3 Cache: 3 MB +%% Hyper-Threading Technology: Enabled +%% Memory: 16 GB + +analyze_and_print_darwin_host_info(Version) -> + %% This stuff is for macOS. + %% If we ever tested on a pure darwin machine, + %% we need to find some other way to find some info... + %% Also, I suppose its possible that we for some other + %% reason *fail* to get the info... + case analyze_darwin_software_info() of + [] -> + io:format("Darwin:" + "~n Version: ~s" + "~n Num Online Schedulers: ~s" + "~n", [Version, str_num_schedulers()]), + {num_schedulers_to_factor(), []}; + SwInfo when is_list(SwInfo) -> + SystemVersion = analyze_darwin_sw_system_version(SwInfo), + KernelVersion = analyze_darwin_sw_kernel_version(SwInfo), + HwInfo = analyze_darwin_hardware_info(), + ModelName = analyze_darwin_hw_model_name(HwInfo), + ModelId = analyze_darwin_hw_model_identifier(HwInfo), + ProcName = analyze_darwin_hw_processor_name(HwInfo), + ProcSpeed = analyze_darwin_hw_processor_speed(HwInfo), + NumProc = analyze_darwin_hw_number_of_processors(HwInfo), + NumCores = analyze_darwin_hw_total_number_of_cores(HwInfo), + Memory = analyze_darwin_hw_memory(HwInfo), + io:format("Darwin:" + "~n System Version: ~s" + "~n Kernel Version: ~s" + "~n Model: ~s (~s)" + "~n Processor: ~s (~s, ~s, ~s)" + "~n Memory: ~s" + "~n Num Online Schedulers: ~s" + "~n", [SystemVersion, KernelVersion, + ModelName, ModelId, + ProcName, ProcSpeed, NumProc, NumCores, + Memory, + str_num_schedulers()]), + CPUFactor = analyze_darwin_cpu_to_factor(ProcName, + ProcSpeed, + NumProc, + NumCores), + MemFactor = analyze_darwin_memory_to_factor(Memory), + if (MemFactor =:= 1) -> + {CPUFactor, []}; + true -> + {CPUFactor + MemFactor, []} + end + end. + +analyze_darwin_sw_system_version(SwInfo) -> + proplists:get_value("system version", SwInfo, "-"). + +analyze_darwin_sw_kernel_version(SwInfo) -> + proplists:get_value("kernel version", SwInfo, "-"). + +analyze_darwin_software_info() -> + analyze_darwin_system_profiler("SPSoftwareDataType"). + +analyze_darwin_hw_model_name(HwInfo) -> + proplists:get_value("model name", HwInfo, "-"). + +analyze_darwin_hw_model_identifier(HwInfo) -> + proplists:get_value("model identifier", HwInfo, "-"). + +analyze_darwin_hw_processor_name(HwInfo) -> + proplists:get_value("processor name", HwInfo, "-"). + +analyze_darwin_hw_processor_speed(HwInfo) -> + proplists:get_value("processor speed", HwInfo, "-"). + +analyze_darwin_hw_number_of_processors(HwInfo) -> + proplists:get_value("number of processors", HwInfo, "-"). + +analyze_darwin_hw_total_number_of_cores(HwInfo) -> + proplists:get_value("total number of cores", HwInfo, "-"). + +analyze_darwin_hw_memory(HwInfo) -> + proplists:get_value("memory", HwInfo, "-"). + +analyze_darwin_hardware_info() -> + analyze_darwin_system_profiler("SPHardwareDataType"). + +%% This basically has the structure: "Key: Value" +%% But could also be (for example): +%% "Something:" (which we ignore) +%% "Key: Value1:Value2" +analyze_darwin_system_profiler(DataType) -> + %% First, make sure the program actually exist: + case os:cmd("which system_profiler") of + [] -> + []; + _ -> + D0 = os:cmd("system_profiler " ++ DataType), + D1 = string:tokens(D0, [$\n]), + D2 = [string:trim(S1) || S1 <- D1], + D3 = [string:tokens(S2, [$:]) || S2 <- D2], + analyze_darwin_system_profiler2(D3) + end. + +analyze_darwin_system_profiler2(L) -> + analyze_darwin_system_profiler2(L, []). + +analyze_darwin_system_profiler2([], Acc) -> + [{string:to_lower(K), V} || {K, V} <- lists:reverse(Acc)]; +analyze_darwin_system_profiler2([[_]|T], Acc) -> + analyze_darwin_system_profiler2(T, Acc); +analyze_darwin_system_profiler2([[H1,H2]|T], Acc) -> + analyze_darwin_system_profiler2(T, [{H1, string:trim(H2)}|Acc]); +analyze_darwin_system_profiler2([[H|TH0]|T], Acc) -> + %% Some value parts has ':' in them, so put them together + TH1 = colonize(TH0), + analyze_darwin_system_profiler2(T, [{H, string:trim(TH1)}|Acc]). + +%% This is only called if the length is at least 2 +colonize([L1, L2]) -> + L1 ++ ":" ++ L2; +colonize([H|T]) -> + H ++ ":" ++ colonize(T). + + +%% The memory looks like this "<size> <unit>". Example: "2 GB" +analyze_darwin_memory_to_factor(Mem) -> + case [string:to_lower(S) || S <- string:tokens(Mem, [$\ ])] of + [_SzStr, "tb"] -> + 1; + [SzStr, "gb"] -> + try list_to_integer(SzStr) of + Sz when Sz < 2 -> + 20; + Sz when Sz < 4 -> + 10; + Sz when Sz < 8 -> + 5; + Sz when Sz < 16 -> + 2; + _ -> + 1 + catch + _:_:_ -> + 20 + end; + [_SzStr, "mb"] -> + 20; + _ -> + 20 + end. + + +%% The speed is a string: "<speed> <unit>" +%% the speed may be a float, which we transforms into an integer of MHz. +%% To calculate a factor based on processor speed, number of procs +%% and number of cores is ... not an exact ... science ... +analyze_darwin_cpu_to_factor(_ProcName, + ProcSpeedStr, NumProcStr, NumCoresStr) -> + Speed = + case [string:to_lower(S) || S <- string:tokens(ProcSpeedStr, [$\ ])] of + [SpeedStr, "mhz"] -> + try list_to_integer(SpeedStr) of + SpeedI -> + SpeedI + catch + _:_:_ -> + try list_to_float(SpeedStr) of + SpeedF -> + trunc(SpeedF) + catch + _:_:_ -> + -1 + end + end; + [SpeedStr, "ghz"] -> + try list_to_float(SpeedStr) of + SpeedF -> + trunc(1000*SpeedF) + catch + _:_:_ -> + try list_to_integer(SpeedStr) of + SpeedI -> + 1000*SpeedI + catch + _:_:_ -> + -1 + end + end; + _ -> + -1 + end, + NumProc = try list_to_integer(NumProcStr) of + NumProcI -> + NumProcI + catch + _:_:_ -> + 1 + end, + NumCores = try list_to_integer(NumCoresStr) of + NumCoresI -> + NumCoresI + catch + _:_:_ -> + 1 + end, + if + (Speed > 3000) -> + if + (NumProc =:= 1) -> + if + (NumCores < 2) -> + 5; + (NumCores < 4) -> + 3; + (NumCores < 6) -> + 2; + true -> + 1 + end; + true -> + if + (NumCores < 4) -> + 2; + true -> + 1 + end + end; + (Speed > 2000) -> + if + (NumProc =:= 1) -> + if + (NumCores < 2) -> + 8; + (NumCores < 4) -> + 5; + (NumCores < 6) -> + 3; + true -> + 1 + end; + true -> + if + (NumCores < 4) -> + 5; + (NumCores < 8) -> + 2; + true -> + 1 + end + end; + true -> + if + (NumProc =:= 1) -> + if + (NumCores < 2) -> + 10; + (NumCores < 4) -> + 7; + (NumCores < 6) -> + 5; + (NumCores < 8) -> + 3; + true -> + 1 + end; + true -> + if + (NumCores < 4) -> + 8; + (NumCores < 8) -> + 4; + true -> + 1 + end + end + end. + + analyze_and_print_solaris_host_info(Version) -> Release = case file:read_file_info("/etc/release") of @@ -1046,13 +1693,13 @@ analyze_and_print_solaris_host_info(Version) -> "-" end, io:format("Solaris: ~s" - "~n Release: ~s" - "~n Banner Name: ~s" - "~n Instruction Set: ~s" - "~n CPUs: ~s (~s)" - "~n System Config: ~s" - "~n Memory Size: ~s" - "~n Num Schedulers: ~s" + "~n Release: ~s" + "~n Banner Name: ~s" + "~n Instruction Set: ~s" + "~n CPUs: ~s (~s)" + "~n System Config: ~s" + "~n Memory Size: ~s" + "~n Num Online Schedulers: ~s" "~n~n", [Version, Release, BannerName, InstructionSet, NumPhysProc, NumProc, SysConf, MemSz, @@ -1093,19 +1740,19 @@ analyze_and_print_solaris_host_info(Version) -> _:_:_ -> 10 end, - try erlang:system_info(schedulers) of - 1 -> - 10; - 2 -> - 5; - N when (N =< 6) -> - 2; - _ -> - 1 - catch - _:_:_ -> - 10 - end + MemFactor. + {try erlang:system_info(schedulers) of + 1 -> + 10; + 2 -> + 5; + N when (N =< 6) -> + 2; + _ -> + 1 + catch + _:_:_ -> + 10 + end + MemFactor, []}. analyze_and_print_win_host_info(Version) -> @@ -1113,14 +1760,19 @@ analyze_and_print_win_host_info(Version) -> OsName = win_sys_info_lookup(os_name, SysInfo), OsVersion = win_sys_info_lookup(os_version, SysInfo), SysMan = win_sys_info_lookup(system_manufacturer, SysInfo), + SysMod = win_sys_info_lookup(system_model, SysInfo), NumProcs = win_sys_info_lookup(num_processors, SysInfo), TotPhysMem = win_sys_info_lookup(total_phys_memory, SysInfo), io:format("Windows: ~s" "~n OS Version: ~s (~p)" "~n System Manufacturer: ~s" + "~n System Model: ~s" "~n Number of Processor(s): ~s" "~n Total Physical Memory: ~s" - "~n", [OsName, OsVersion, Version, SysMan, NumProcs, TotPhysMem]), + "~n Num Online Schedulers: ~s" + "~n", [OsName, OsVersion, Version, + SysMan, SysMod, NumProcs, TotPhysMem, + str_num_schedulers()]), MemFactor = try begin @@ -1172,7 +1824,7 @@ analyze_and_print_win_host_info(Version) -> _ -> 2 end, - CPUFactor + MemFactor. + {CPUFactor + MemFactor, SysInfo}. win_sys_info_lookup(Key, SysInfo) -> win_sys_info_lookup(Key, SysInfo, "-"). @@ -1187,14 +1839,25 @@ win_sys_info_lookup(Key, SysInfo, Def) -> %% This function only extracts the prop we actually care about! which_win_system_info() -> - SysInfo = os:cmd("systeminfo"), - try process_win_system_info(string:tokens(SysInfo, [$\r, $\n]), []) - catch - _:_:_ -> - io:format("Failed process System info: " - "~s~n", [SysInfo]), - [] - end. + F = fun() -> + try + begin + SysInfo = os:cmd("systeminfo"), + process_win_system_info( + string:tokens(SysInfo, [$\r, $\n]), []) + end + catch + C:E:S -> + io:format("Failed get or process System info: " + " Error Class: ~p" + " Error: ~p" + " Stack: ~p" + "~n", [C, E, S]), + [] + end + end, + proxy_call(F, minutes(1), + fun() -> throw({skip, "System info timeout"}) end). process_win_system_info([], Acc) -> Acc; @@ -1211,6 +1874,9 @@ process_win_system_info([H|T], Acc) -> "system manufacturer" -> process_win_system_info(T, [{system_manufacturer, string:trim(Value)}|Acc]); + "system model" -> + process_win_system_info(T, + [{system_model, string:trim(Value)}|Acc]); "processor(s)" -> [NumProcStr|_] = string:tokens(Value, [$\ ]), T2 = lists:nthtail(list_to_integer(NumProcStr), T), @@ -1227,6 +1893,22 @@ process_win_system_info([H|T], Acc) -> end. +linux_info_lookup(Key, File) -> + try [string:trim(S) || S <- string:tokens(os:cmd("grep " ++ "\"" ++ Key ++ "\"" ++ " " ++ File), [$:,$\n])] of + Info -> + linux_info_lookup_collect(Key, Info, []) + catch + _:_:_ -> + "-" + end. + +linux_info_lookup_collect(_Key, [], Values) -> + lists:reverse(Values); +linux_info_lookup_collect(Key, [Key, Value|Rest], Values) -> + linux_info_lookup_collect(Key, Rest, [Value|Values]); +linux_info_lookup_collect(_, _, Values) -> + lists:reverse(Values). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Set kill timer diff --git a/lib/megaco/test/megaco_test_lib.hrl b/lib/megaco/test/megaco_test_lib.hrl index f6af199d4e..0777adbcd0 100644 --- a/lib/megaco/test/megaco_test_lib.hrl +++ b/lib/megaco/test/megaco_test_lib.hrl @@ -29,6 +29,8 @@ -define(LIB, megaco_test_lib). +-define(PCALL(F, T, D), ?LIB:proxy_call(F, T, D)). + -define(APPLY(Proxy, Fun), Proxy ! {apply, Fun}). diff --git a/lib/megaco/test/megaco_test_megaco_generator.erl b/lib/megaco/test/megaco_test_megaco_generator.erl index 4eedd8d731..f6ea57ab41 100644 --- a/lib/megaco/test/megaco_test_megaco_generator.erl +++ b/lib/megaco/test/megaco_test_megaco_generator.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2020. All Rights Reserved. +%% Copyright Ericsson AB 2007-2021. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -313,6 +313,9 @@ handle_parse({megaco_callback, Verifiers0} = _Instruction, State) handle_parse({trigger, Trigger} = Instruction, State) when is_function(Trigger) -> {ok, Instruction, State}; +handle_parse({trigger, Desc, Trigger} = Instruction, State) + when is_list(Desc) andalso is_function(Trigger) -> + {ok, Instruction, State}; handle_parse(Instruction, _State) -> error({invalid_instruction, Instruction}). @@ -770,6 +773,10 @@ handle_exec({trigger, Trigger}, State) when is_function(Trigger) -> p("trigger"), (catch Trigger()), {ok, State}; +handle_exec({trigger, Desc, Trigger}, State) when is_function(Trigger) -> + p("trigger: ~s", [Desc]), + (catch Trigger()), + {ok, State}; handle_exec({sleep, To}, State) -> p("sleep ~p", [To]), diff --git a/lib/megaco/test/megaco_test_mgc.erl b/lib/megaco/test/megaco_test_mgc.erl index 8a9b182368..1204dbba07 100644 --- a/lib/megaco/test/megaco_test_mgc.erl +++ b/lib/megaco/test/megaco_test_mgc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2020. All Rights Reserved. +%% Copyright Ericsson AB 2003-2021. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -411,7 +411,7 @@ loop(S) -> server_reply(Parent, update_conn_info_ack, Res), loop(evs(S, {uci, {Tag, Val}})); - {{conn_info, Tag}, Parent} when S#mgc.parent == Parent -> + {{conn_info, Tag}, Parent} when S#mgc.parent =:= Parent -> i("loop -> got conn_info request for ~w", [Tag]), Conns = megaco:user_info(S#mgc.mid, connections), Fun = fun(CH) -> @@ -450,48 +450,63 @@ loop(S) -> %% Give me statistics {{statistics, 1}, Parent} when S#mgc.parent == Parent -> - i("loop -> got request for statistics 1"), + i("loop(stats1) -> got request for statistics 1"), {ok, Gen} = megaco:get_stats(), - GetTrans = + i("loop(stats1) -> gen stats: " + "~n ~p", [Gen]), + GetTrans = fun(CH) -> + i("loop(stats1):GetTrans -> " + "get stats for connection ~p", [CH]), Reason = {statistics, CH}, Pid = megaco:conn_info(CH, control_pid), + i("loop(stats1):GetTrans -> control pid: ~p", [Pid]), SendMod = megaco:conn_info(CH, send_mod), + i("loop(stats1):GetTrans -> " + "send module: ~p", [SendMod]), SendHandle = megaco:conn_info(CH, send_handle), + i("loop(stats1):GetTrans -> " + "send handle: ~p", [SendHandle]), {ok, Stats} = case SendMod of megaco_tcp -> megaco_tcp:get_stats(SendHandle); megaco_udp -> megaco_udp:get_stats(SendHandle); SendMod -> exit(Pid, Reason) end, + i("loop(stats1):GetTrans -> stats: " + "~n ~p", [Stats]), {SendHandle, Stats} end, - Mid = S#mgc.mid, - Trans = - lists:map(GetTrans, megaco:user_info(Mid, connections)), + Mid = S#mgc.mid, + Trans = lists:map(GetTrans, megaco:user_info(Mid, connections)), Reply = {ok, [{gen, Gen}, {trans, Trans}]}, + i("loop(stats1) -> send reply"), server_reply(Parent, {statistics_reply, 1}, Reply), + i("loop(stats1) -> done"), loop(evs(S, {stats, 1})); {{statistics, 2}, Parent} when S#mgc.parent == Parent -> - i("loop -> got request for statistics 2"), + i("loop(stats2) -> got request for statistics 2"), {ok, Gen} = megaco:get_stats(), #mgc{tcp_sup = TcpSup, udp_sup = UdpSup} = S, TcpStats = get_trans_stats(TcpSup, megaco_tcp), UdpStats = get_trans_stats(UdpSup, megaco_udp), Reply = {ok, [{gen, Gen}, {trans, [TcpStats, UdpStats]}]}, + i("loop(stats2) -> send reply"), server_reply(Parent, {statistics_reply, 2}, Reply), + i("loop(stats2) -> done"), loop(evs(S, {stats, 2})); %% Megaco callback messages {request, Request, From} -> - d("loop -> received megaco request from ~p:" + d("loop(request) -> received megaco request from ~p:" "~n ~p", [From, Request]), {Reply, S1} = handle_megaco_request(Request, S), - d("loop -> send request reply: ~n~p", [Reply]), + d("loop(request) -> send reply: ~n~p", [Reply]), reply(From, Reply), + d("loop(request) -> done"), loop(evs(S1, {req, Request})); @@ -557,9 +572,14 @@ loop(S) -> evs(#mgc{evs = EVS} = S, Ev) when (length(EVS) < ?EVS_MAX) -> - S#mgc{evs = [{?FTS(), Ev}|EVS]}; + echo_evs(S#mgc{evs = [{?FTS(), Ev}|EVS]}); evs(#mgc{evs = EVS} = S, Ev) -> - S#mgc{evs = [{?FTS(), Ev}|lists:droplast(EVS)]}. + echo_evs(S#mgc{evs = [{?FTS(), Ev}|lists:droplast(EVS)]}). + +echo_evs(#mgc{evs = EVS} = S) -> + i("Events: " + "~n ~p", [EVS]), + S. done(#mgc{evs = EVS}, Reason) -> info_msg("Exiting with latest event(s): " diff --git a/lib/megaco/test/megaco_test_msg_v3_lib.erl b/lib/megaco/test/megaco_test_msg_v3_lib.erl index 5264791370..8bb821b475 100644 --- a/lib/megaco/test/megaco_test_msg_v3_lib.erl +++ b/lib/megaco/test/megaco_test_msg_v3_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2016. All Rights Reserved. +%% Copyright Ericsson AB 2006-2020. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -3775,8 +3775,16 @@ is_AmmRequest_descriptors(Descs) -> is_AmmRequest_descriptors([], _) -> true; -is_AmmRequest_descriptors([{Tag, _} = Desc|Descs], FoundDescs) -> - d("is_AmmRequest_descriptors -> entry with" +is_AmmRequest_descriptors([Desc|Descs], FoundDescs) -> + FoundDescs2 = is_AmmRequest_descriptor(Desc, FoundDescs), + is_AmmRequest_descriptors(Descs, FoundDescs2); +is_AmmRequest_descriptors(Descs, _) -> + d("is_AmmRequest_descriptors -> entry with WRONG TYPE" + "~n Descs: ~p", [Descs]), + wrong_type('AmmRequest_descriptors', Descs). + +is_AmmRequest_descriptor({Tag, _} = Desc, FoundDescs) when is_atom(Tag) -> + d("is_AmmRequest_descriptor -> entry with" "~n Tag: ~p" "~n FoundDescs: ~p", [Tag, FoundDescs]), case lists:member(Tag, FoundDescs) of @@ -3785,15 +3793,13 @@ is_AmmRequest_descriptors([{Tag, _} = Desc|Descs], FoundDescs) -> false -> case is_AmmDescriptor(Desc) of true -> - is_AmmRequest_descriptors(Descs, [Tag|FoundDescs]); + [Tag|FoundDescs]; false -> wrong_type('AmmRequest_descriptors', Desc) end end; -is_AmmRequest_descriptors(Descs, _) -> - d("is_AmmRequest_descriptors -> entry with WRONG TYPE" - "~n Descs: ~p", [Descs]), - wrong_type('AmmRequest_descriptors', Descs). +is_AmmRequest_descriptor(Tag, FoundDescs) when is_atom(Tag) -> + is_AmmRequest_descriptor({Tag, []}, FoundDescs). chk_AmmRequest(R, R) when is_record(R, 'AmmRequest') -> @@ -3837,7 +3843,11 @@ chk_AmmRequest_descriptors([H|T1], [H|T2]) -> wrong_type('AmmRequest_descriptors_val', H) end; chk_AmmRequest_descriptors([H1|T1], [H2|T2]) -> - d("chk_AmmRequest_descriptors -> entry when not equal"), + d("chk_AmmRequest_descriptors -> entry when not equal: " + "~n H1: ~p" + "~n T1: ~p" + "~n H2: ~p" + "~n T2: ~p", [H1, T1, H2, T2]), validate(fun() -> chk_AmmDescriptor(H1, H2) end, 'AmmRequest_descriptors_val'), chk_AmmRequest_descriptors(T1, T2); @@ -3885,6 +3895,11 @@ is_AmmDescriptor_val(statisticsDescriptor, D) -> chk_AmmDescriptor(D, D) -> chk_type(fun is_AmmDescriptor_tag/1, 'AmmDescriptor', D); +%% There are two ways of spec an empty statisticsDescriptor: +%% * statisticsDescriptor +%% * {statisticsDescriptor, []} +chk_AmmDescriptor(Tag, {Tag, []}) when (Tag =:= statisticsDescriptor) -> + ok; chk_AmmDescriptor({Tag, Val1} = Cmd1, {Tag, Val2} = Cmd2) -> case (is_AmmDescriptor_tag(Tag) andalso is_AmmDescriptor_val(Tag, Val1) andalso diff --git a/lib/megaco/test/megaco_trans_SUITE.erl b/lib/megaco/test/megaco_trans_SUITE.erl index 1e281987b8..78ba1f0515 100644 --- a/lib/megaco/test/megaco_trans_SUITE.erl +++ b/lib/megaco/test/megaco_trans_SUITE.erl @@ -84,7 +84,8 @@ -define(MG, megaco_test_mg). -define(MGC, megaco_test_mgc). --define(MGC_START(Pid, Mid, ET, Verb), ?MGC:start(Pid, Mid, ET, Verb)). +-define(MGC_START(Pid, Mid, ET, Verb), + mgc_start(Pid, Mid, ET, Verb)). -define(MGC_STOP(Pid), ?MGC:stop(Pid)). -define(MGC_GET_STATS(Pid, No), ?MGC:get_stats(Pid, No)). -define(MGC_RESET_STATS(Pid), ?MGC:reset_stats(Pid)). @@ -99,8 +100,8 @@ -define(MGC_ACK_INFO(Pid,To), ?MGC:ack_info(Pid,To)). -define(MGC_REQ_INFO(Pid,To), ?MGC:req_info(Pid,To)). --define(MG_START(Pid, Mid, Enc, Transp, Conf, Verb), - ?MG:start(Pid, Mid, Enc, Transp, Conf, Verb)). +-define(MG_START(Pid, Mid, Enc, Transp, Conf, Verb), + mg_start(Pid, Mid, Enc, Transp, Conf, Verb)). -define(MG_STOP(Pid), ?MG:stop(Pid)). -define(MG_GET_STATS(Pid), ?MG:get_stats(Pid)). -define(MG_RESET_STATS(Pid), ?MG:reset_stats(Pid)). @@ -330,14 +331,13 @@ do_single_ack([MgcNode, MgNode]) -> %% Start the MGC and MGs i("[MGC] start"), ET = [{text,tcp}, {text,udp}, {binary,tcp}, {binary,udp}], - {ok, Mgc} = - ?MGC_START(MgcNode, {deviceName, "ctrl"}, ET, ?MGC_VERBOSITY), + Mgc = ?MGC_START(MgcNode, {deviceName, "ctrl"}, ET, ?MGC_VERBOSITY), i("[MG] start"), %% MgConf0 = [{MgNode, "mg", text, tcp, ?MG_VERBOSITY}], MgMid = {deviceName, "mg"}, MgConfig = [{auto_ack, true}, {trans_timer, 5000}, {trans_ack, true}], - {ok, Mg} = ?MG_START(MgNode, MgMid, text, tcp, MgConfig, ?MG_VERBOSITY), + Mg = ?MG_START(MgNode, MgMid, text, tcp, MgConfig, ?MG_VERBOSITY), d("MG user info: ~p", [?MG_USER_INFO(Mg, all)]), @@ -412,8 +412,7 @@ do_multi_ack_timeout([MgcNode, MgNode]) -> %% Start the MGC and MGs i("[MGC] start"), ET = [{text,tcp}, {text,udp}, {binary,tcp}, {binary,udp}], - {ok, Mgc} = - ?MGC_START(MgcNode, {deviceName, "ctrl"}, ET, ?MGC_VERBOSITY), + Mgc = ?MGC_START(MgcNode, {deviceName, "ctrl"}, ET, ?MGC_VERBOSITY), i("[MG] start"), %% MgConf0 = [{MgNode, "mg", text, tcp, ?MG_VERBOSITY}], @@ -422,7 +421,7 @@ do_multi_ack_timeout([MgcNode, MgNode]) -> {trans_ack, true}, {trans_timer, 10000}, {trans_ack_maxcount, MaxCount + 10}], - {ok, Mg} = ?MG_START(MgNode, MgMid, text, tcp, MgConfig, ?MG_VERBOSITY), + Mg = ?MG_START(MgNode, MgMid, text, tcp, MgConfig, ?MG_VERBOSITY), d("MG user info: ~p", [?MG_USER_INFO(Mg, all)]), @@ -496,8 +495,7 @@ do_multi_ack_maxcount([MgcNode, MgNode]) -> %% Start the MGC and MGs i("[MGC] start"), ET = [{text,tcp}, {text,udp}, {binary,tcp}, {binary,udp}], - {ok, Mgc} = - ?MGC_START(MgcNode, {deviceName, "ctrl"}, ET, ?MGC_VERBOSITY), + Mgc = ?MGC_START(MgcNode, {deviceName, "ctrl"}, ET, ?MGC_VERBOSITY), i("[MG] start"), %% MgConf0 = [{MgNode, "mg", text, tcp, ?MG_VERBOSITY}], @@ -506,7 +504,7 @@ do_multi_ack_maxcount([MgcNode, MgNode]) -> %% {trans_timer, 120000}, %% {trans_ack_maxcount, MaxCount} ], - {ok, Mg} = ?MG_START(MgNode, MgMid, text, tcp, MgConfig, ?MG_VERBOSITY), + Mg = ?MG_START(MgNode, MgMid, text, tcp, MgConfig, ?MG_VERBOSITY), d("MG user info: ~p", [?MG_USER_INFO(Mg, all)]), @@ -9595,6 +9593,46 @@ await_completion(Ids, Timeout) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +mgc_start(Pid, Mid, ET, Verb) -> + try ?MGC:start(Pid, Mid, ET, Verb) of + {ok, MGC} -> + MGC; + {error, StartReason} -> + e("failed starting mgc (error): " + "~n ~p", [StartReason]), + ?SKIP({failed_starting, mgc, StartReason}) + catch + exit:{error, timeout} -> + e("failed starting mgc (exit): timeout"), + ?SKIP({failed_starting, mgc, timeout}); + exit:{failed_starting, _, StartExitReason} -> + e("failed starting mgc (exit): " + "~n ~p", [StartExitReason]), + ?SKIP({failed_starting, mgc, StartExitReason}) + end. + + +mg_start(Pid, Mid, Enc, Transp, Conf, Verb) -> + try ?MG:start(Pid, Mid, Enc, Transp, Conf, Verb) of + {ok, MG} -> + MG; + {error, Reason} -> + e("failed starting mg (error): " + "~n ~p", [Reason]), + ?SKIP({failed_starting, mgc, Reason}) + catch + exit:{error, timeout} -> + e("failed starting mg (exit): timeout"), + ?SKIP({failed_starting, mg, timeout}); + exit:{failed_starting, _, ExitReason} -> + e("failed starting mg (exit): " + "~n ~p", [ExitReason]), + ?SKIP({failed_starting, mg, ExitReason}) + end. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + try_tc(TCName, Pre, Case, Post) -> try_tc(TCName, "TEST", ?TEST_VERBOSITY, Pre, Case, Post). @@ -9617,8 +9655,8 @@ p(F, A) -> "~n " ++ F ++ "~n", [?FTS(), self() | A]). -%% e(F) -> -%% e(F, []). +e(F) -> + e(F, []). e(F, A) -> print(error, "ERROR", F, A). diff --git a/lib/megaco/test/megaco_udp_SUITE.erl b/lib/megaco/test/megaco_udp_SUITE.erl index 05910e50a9..b27bcbe83f 100644 --- a/lib/megaco/test/megaco_udp_SUITE.erl +++ b/lib/megaco/test/megaco_udp_SUITE.erl @@ -27,6 +27,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- +-include_lib("common_test/include/ct.hrl"). -include_lib("megaco/src/udp/megaco_udp.hrl"). -include("megaco_test_lib.hrl"). @@ -239,6 +240,8 @@ start_and_stop(doc) -> ["This test case sets up a connection and then cloises it. " "No data is sent. "]; start_and_stop(Config) when is_list(Config) -> + Factor = ?config(megaco_factor, Config), + ct:timetrap(Factor * ?SECS(45)), Pre = fun() -> p("create nodes"), ServerNode = make_node_name(server), @@ -247,20 +250,22 @@ start_and_stop(Config) when is_list(Config) -> ok = ?START_NODES(Nodes), Nodes end, - Case = fun do_start_and_stop/1, + Case = fun(X) -> do_start_and_stop(Factor, X) end, Post = fun(Nodes) -> p("stop nodes"), ?STOP_NODES(lists:reverse(Nodes)) end, try_tc(start_and_stop, Pre, Case, Post). -do_start_and_stop([ServerNode, ClientNode]) -> +do_start_and_stop(Factor, [ServerNode, ClientNode]) -> %% Create command sequences + TOCalc = fun(BaseTO) -> to_calc(Factor, BaseTO) end, + TO = TOCalc(?SECS(5)), p("create command sequences"), ServerPort = 2944, ServerCmds = start_and_stop_server_commands(ServerPort), {ok, ServerHost} = inet:gethostname(), - ClientCmds = start_and_stop_client_commands(ServerPort, ServerHost), + ClientCmds = start_and_stop_client_commands(TO, ServerPort, ServerHost), %% Start the test procs used in the test-case, one for each node p("start command handlers"), @@ -268,8 +273,8 @@ do_start_and_stop([ServerNode, ClientNode]) -> p("server command handler started: ~p", [Server]), Client = client_start_command_handler(ClientNode, ClientCmds), p("client command handler started: ~p", [Client]), - - ok = + + ok = receive {operational, Server} -> p("received listening message from server [~p] => " @@ -280,11 +285,11 @@ do_start_and_stop([ServerNode, ClientNode]) -> ?SKIP(Reason); {'EXIT', Client, {skip, Reason}} -> ?SKIP(Reason) - after 5000 -> + after TO -> {error, server_timeout} end, - ok = await_command_handler_completion([Server, Client], ?SECS(20)), + ok = await_command_handler_completion([Server, Client], TOCalc(?SECS(20))), p("done"), ok. @@ -337,7 +342,7 @@ start_and_stop_server_commands(Port) -> ]. -start_and_stop_client_commands(ServerPort, _ServerHost) -> +start_and_stop_client_commands(TO, ServerPort, _ServerHost) -> Opts = [{port, ServerPort}], Self = self(), [ @@ -362,7 +367,7 @@ start_and_stop_client_commands(ServerPort, _ServerHost) -> #{id => 4, desc => "Await continue", cmd => fun(State) -> - client_await_continue_signal(State, 5000) + client_await_continue_signal(State, TO) end}, #{id => 5, @@ -399,6 +404,8 @@ sendreceive(suite) -> sendreceive(doc) -> ["Test send and receive with the UDP transport. "]; sendreceive(Config) when is_list(Config) -> + Factor = ?config(megaco_factor, Config), + ct:timetrap(Factor * ?SECS(30)), Pre = fun() -> p("create nodes"), ServerNode = make_node_name(server), @@ -407,20 +414,22 @@ sendreceive(Config) when is_list(Config) -> ok = ?START_NODES(Nodes), Nodes end, - Case = fun do_sendreceive/1, + Case = fun(X) -> do_sendreceive(Factor, X) end, Post = fun(Nodes) -> p("stop nodes"), ?STOP_NODES(lists:reverse(Nodes)) end, try_tc(sendreceive, Pre, Case, Post). -do_sendreceive([ServerNode, ClientNode]) -> +do_sendreceive(Factor, [ServerNode, ClientNode]) -> %% Create command sequences p("create command sequences"), + TOCalc = fun(BaseTO) -> to_calc(Factor, BaseTO) end, + TO = TOCalc(?SECS(5)), ServerPort = 2944, - ServerCmds = sendreceive_server_commands(ServerPort), + ServerCmds = sendreceive_server_commands(TO, ServerPort), {ok, ServerHost} = inet:gethostname(), - ClientCmds = sendreceive_client_commands(ServerPort, ServerHost), + ClientCmds = sendreceive_client_commands(TO, ServerPort, ServerHost), %% Start the test procs used in the test-case, one for each node p("start command handlers"), @@ -440,16 +449,16 @@ do_sendreceive([ServerNode, ClientNode]) -> ?SKIP(Reason); {'EXIT', Client, {skip, Reason}} -> ?SKIP(Reason) - after 5000 -> + after TO -> {error, server_timeout} end, - ok = await_command_handler_completion([Server, Client], ?SECS(20)), + ok = await_command_handler_completion([Server, Client], TOCalc(?SECS(20))), p("done"), ok. -sendreceive_server_commands(Port) -> +sendreceive_server_commands(TO, Port) -> Opts = [{port, Port}], Self = self(), [ @@ -480,7 +489,7 @@ sendreceive_server_commands(Port) -> #{id => 5, desc => "Await initial message (ping)", cmd => fun(State) -> - server_await_initial_message(State, "ping", 5000) + server_await_initial_message(State, "ping", TO) end}, #{id => 6, @@ -492,7 +501,7 @@ sendreceive_server_commands(Port) -> #{id => 7, desc => "Await nothing before sending a message (hejsan)", cmd => fun(State) -> - server_await_nothing(State, 1000) + server_await_nothing(State, TO div 5) end}, #{id => 8, @@ -504,13 +513,13 @@ sendreceive_server_commands(Port) -> #{id => 9, desc => "Await reply (hoppsan) to message", cmd => fun(State) -> - server_await_message(State, "hoppsan", 1000) + server_await_message(State, "hoppsan", TO div 5) end}, #{id => 10, desc => "Await nothing before closing", cmd => fun(State) -> - server_await_nothing(State, 1000) + server_await_nothing(State, TO div 5) end}, #{id => 11, @@ -522,7 +531,7 @@ sendreceive_server_commands(Port) -> #{id => 12, desc => "Await nothing before stopping transport", cmd => fun(State) -> - server_await_nothing(State, 1000) + server_await_nothing(State, TO div 5) end}, #{id => 13, @@ -532,7 +541,7 @@ sendreceive_server_commands(Port) -> end} ]. -sendreceive_client_commands(ServerPort, ServerHost) -> +sendreceive_client_commands(TO, ServerPort, ServerHost) -> OwnPort = ServerPort+1, Opts = [{port, OwnPort}], Self = self(), @@ -558,7 +567,7 @@ sendreceive_client_commands(ServerPort, ServerHost) -> #{id => 4, desc => "Await continue", cmd => fun(State) -> - client_await_continue_signal(State, 5000) + client_await_continue_signal(State, TO) end}, #{id => 5, @@ -576,13 +585,13 @@ sendreceive_client_commands(ServerPort, ServerHost) -> #{id => 7, desc => "Await reply (pong) to initial message", cmd => fun(State) -> - client_await_message(State, "pong", 1000) + client_await_message(State, "pong", TO div 5) end}, #{id => 8, desc => "Await message (hejsan)", cmd => fun(State) -> - client_await_message(State, "hejsan", 5000) + client_await_message(State, "hejsan", TO) end}, #{id => 9, @@ -594,7 +603,7 @@ sendreceive_client_commands(ServerPort, ServerHost) -> #{id => 10, desc => "Await nothing before closing", cmd => fun(State) -> - client_await_nothing(State, 1000) + client_await_nothing(State, TO div 5) end}, #{id => 11, @@ -606,7 +615,7 @@ sendreceive_client_commands(ServerPort, ServerHost) -> #{id => 12, desc => "Await nothing before stopping transport", cmd => fun(State) -> - client_await_nothing(State, 1000) + client_await_nothing(State, TO div 5) end}, #{id => 13, @@ -624,6 +633,8 @@ block_unblock(suite) -> block_unblock(doc) -> ["Test the block/unblock functions of the UDP transport. "]; block_unblock(Config) when is_list(Config) -> + Factor = ?config(megaco_factor, Config), + ct:timetrap(Factor * ?MINS(1)), Pre = fun() -> p("create nodes"), ServerNode = make_node_name(server), @@ -632,20 +643,22 @@ block_unblock(Config) when is_list(Config) -> ok = ?START_NODES(Nodes), Nodes end, - Case = fun do_block_unblock/1, + Case = fun(X) -> do_block_unblock(Factor, X) end, Post = fun(Nodes) -> p("stop nodes"), ?STOP_NODES(lists:reverse(Nodes)) end, try_tc(block_unblock, Pre, Case, Post). -do_block_unblock([ServerNode, ClientNode]) -> +do_block_unblock(Factor, [ServerNode, ClientNode]) -> %% Create command sequences p("create command sequences"), + TOCalc = fun(BaseTO) -> to_calc(Factor, BaseTO) end, + TO = TOCalc(?SECS(5)), ServerPort = 2944, - ServerCmds = block_unblock_server_commands(ServerPort), + ServerCmds = block_unblock_server_commands(TO, ServerPort), {ok, ServerHost} = inet:gethostname(), - ClientCmds = block_unblock_client_commands(ServerPort, ServerHost), + ClientCmds = block_unblock_client_commands(TO, ServerPort, ServerHost), %% Start the test procs used in the test-case, one for each node p("start command handlers"), @@ -667,7 +680,7 @@ do_block_unblock([ServerNode, ClientNode]) -> ?SKIP(Reason1); {'EXIT', Client, {skip, Reason2}} -> ?SKIP(Reason2) - after 5000 -> + after TO -> {error, server_timeout} end, @@ -684,16 +697,16 @@ do_block_unblock([ServerNode, ClientNode]) -> ?SKIP(Reason3); {'EXIT', Client, {skip, Reason4}} -> ?SKIP(Reason4) - after 5000 -> + after TO -> {error, timeout} end, - ok = await_command_handler_completion([Server, Client], ?SECS(20)), + ok = await_command_handler_completion([Server, Client], TOCalc(?SECS(20))), p("done"), ok. -block_unblock_server_commands(Port) -> +block_unblock_server_commands(TO, Port) -> Opts = [{port, Port}], Self = self(), [ @@ -724,7 +737,7 @@ block_unblock_server_commands(Port) -> #{id => 5, desc => "Await initial message (ping)", cmd => fun(State) -> - server_await_initial_message(State, "ping", 5000) + server_await_initial_message(State, "ping", TO) end}, #{id => 6, @@ -736,7 +749,7 @@ block_unblock_server_commands(Port) -> #{id => 7, desc => "Await continue", cmd => fun(State) -> - server_await_continue_signal(State, 5000) + server_await_continue_signal(State, TO) end}, #{id => 8, @@ -748,19 +761,19 @@ block_unblock_server_commands(Port) -> #{id => 9, desc => "Await nothing before receiving (hoppsan) reply", cmd => fun(State) -> - server_await_nothing(State, 4000) + server_await_nothing(State, TO) end}, #{id => 10, desc => "Await reply (hoppsan) to message", cmd => fun(State) -> - server_await_message(State, "hoppsan", 2000) + server_await_message(State, "hoppsan", TO div 2) end}, #{id => 11, desc => "Await nothing before closing", cmd => fun(State) -> - server_await_nothing(State, 1000) + server_await_nothing(State, TO div 5) end}, #{id => 12, @@ -772,7 +785,7 @@ block_unblock_server_commands(Port) -> #{id => 13, desc => "Await nothing before stopping transport", cmd => fun(State) -> - server_await_nothing(State, 1000) + server_await_nothing(State, TO div 5) end}, #{id => 14, @@ -783,7 +796,7 @@ block_unblock_server_commands(Port) -> ]. -block_unblock_client_commands(ServerPort, ServerHost) -> +block_unblock_client_commands(TO, ServerPort, ServerHost) -> OwnPort = ServerPort+1, Opts = [{port, OwnPort}], Self = self(), @@ -809,7 +822,7 @@ block_unblock_client_commands(ServerPort, ServerHost) -> #{id => 4, desc => "Await continue", cmd => fun(State) -> - client_await_continue_signal(State, 5000) + client_await_continue_signal(State, TO) end}, #{id => 5, @@ -827,64 +840,138 @@ block_unblock_client_commands(ServerPort, ServerHost) -> #{id => 7, desc => "Await reply (pong) to initial message", cmd => fun(State) -> - client_await_message(State, "pong", 1000) + client_await_message(State, "pong", TO div 5) end}, #{id => 8, + desc => "Pre-Block info", + cmd => fun(#{socket := Socket} = State) -> + p("Socket Info: " + "~n Port Info: ~p", [erlang:port_info(Socket)]), + {ok, State} + end}, + + #{id => 9, desc => "Block", cmd => fun(State) -> client_block(State) end}, - #{id => 9, + #{id => 10, + desc => "Post-Block info", + cmd => fun(#{socket := Socket} = State) -> + Active = + case inet:getopts(Socket, [active]) of + {ok, [{active, Act}]} -> + Act; + _ -> + undefined + end, + p("Socket Info: " + "~n Active: ~p" + "~n Port Info: ~p", + [Active, erlang:port_info(Socket)]), + {ok, State} + end}, + + #{id => 11, desc => "Notify blocked", cmd => fun(State) -> client_notify_blocked(State) end}, - #{id => 10, + #{id => 12, desc => "Await nothing before unblocking", - cmd => fun(State) -> - client_await_nothing(State, 5000) + cmd => fun(#{socket := Socket} = State) -> + Fail = + fun(_) -> + Active = + case inet:getopts(Socket, [active]) of + {ok, [{active, Act}]} -> + Act; + _ -> + undefined + end, + p("Socket Info: " + "~n Active: ~p" + "~n Port Info: ~p", + [Active, erlang:port_info(Socket)]), + ok + end, + client_await_nothing(State, Fail, TO) end}, - #{id => 11, + #{id => 13, + desc => "Pre-Unblock info", + cmd => fun(#{socket := Socket} = State) -> + Active = + case inet:getopts(Socket, [active]) of + {ok, [{active, Act}]} -> + Act; + _ -> + undefined + end, + p("Socket Info: " + "~n Active: ~p" + "~n Port Info: ~p", + [Active, erlang:port_info(Socket)]), + {ok, State} + end}, + + #{id => 14, desc => "Unblock", cmd => fun(State) -> client_unblock(State) end}, - #{id => 8, + #{id => 15, + desc => "Post-Unblock info", + cmd => fun(#{socket := Socket} = State) -> + Active = + case inet:getopts(Socket, [active]) of + {ok, [{active, Act}]} -> + Act; + _ -> + undefined + end, + p("Socket Info: " + "~n Active: ~p" + "~n Port Info: ~p", + [Active, erlang:port_info(Socket)]), + {ok, State} + end}, + + #{id => 16, desc => "Await message (hejsan)", cmd => fun(State) -> - client_await_message(State, "hejsan", 5000) + client_await_message(State, "hejsan", TO) end}, - #{id => 9, + #{id => 17, desc => "Send reply (hoppsan) to message", cmd => fun(State) -> client_send_message(State, "hoppsan") end}, - #{id => 10, + #{id => 18, desc => "Await nothing before closing", cmd => fun(State) -> - client_await_nothing(State, 1000) + client_await_nothing(State, TO) end}, - #{id => 11, + #{id => 19, desc => "Close", cmd => fun(State) -> client_close(State) end}, - #{id => 12, + #{id => 20, desc => "Await nothing before stopping transport", cmd => fun(State) -> - client_await_nothing(State, 1000) + client_await_nothing(State, TO) end}, - #{id => 13, + #{id => 21, desc => "Stop transport", cmd => fun(State) -> client_stop_transport(State) @@ -974,14 +1061,17 @@ server_start_transport(State) when is_map(State) -> server_open(#{transport_ref := Ref} = State, Options) when is_list(Options) -> Opts = [{receive_handle, self()}, {module, ?MODULE} | Options], - case (catch megaco_udp:open(Ref, Opts)) of + try megaco_udp:open(Ref, Opts) of {ok, Socket, ControlPid} -> {ok, State#{handle => {socket, Socket}, % Temporary control_pid => ControlPid}}; {error, {could_not_open_udp_port, eaddrinuse}} -> {skip, {server, eaddrinuse}}; - Error -> - Error + {error, _} = ERROR -> + ERROR + catch + C:E:S -> + {error, {catched, C, E, S}} end. server_notify_operational(#{parent := Parent} = State) -> @@ -1080,14 +1170,18 @@ client_start_transport(State) when is_map(State) -> client_open(#{transport_ref := Ref} = State, Options) when is_list(Options) -> Opts = [{receive_handle, self()}, {module, ?MODULE} | Options], - case (catch megaco_udp:open(Ref, Opts)) of + try megaco_udp:open(Ref, Opts) of {ok, Socket, ControlPid} -> - {ok, State#{handle => {socket, Socket}, + {ok, State#{handle => {socket, Socket}, + socket => Socket, control_pid => ControlPid}}; {error, {could_not_open_udp_port, eaddrinuse}} -> {skip, {client, eaddrinuse}}; - Error -> - Error + {error, _} = ERROR -> + ERROR + catch + C:E:S -> + {error, {catched, C, E, S}} end. client_await_continue_signal(#{parent := Parent} = State, Timeout) -> @@ -1102,11 +1196,15 @@ client_notify_blocked(#{parent := Parent} = State) -> Parent ! {blocked, self()}, {ok, State}. -client_await_nothing(State, Timeout) - when is_map(State) -> +client_await_nothing(State, Timeout) -> + client_await_nothing(State, fun(_) -> ok end, Timeout). + +client_await_nothing(State, Fail, Timeout) + when is_map(State) andalso is_function(Fail, 1) -> receive Any -> p("received unexpected event: ~p", [Any]), + (catch Fail(Any)), {error, {unexpected_event, Any}} after Timeout -> {ok, State} @@ -1196,6 +1294,13 @@ make_node_name(Name) -> end. +to_calc(1 = _Factor, BaseTO) when is_integer(BaseTO) andalso (BaseTO > 0) -> + BaseTO; +to_calc(Factor, BaseTO) when is_integer(Factor) andalso (Factor > 0) andalso + is_integer(BaseTO) andalso (BaseTO > 0) -> + trunc( ((Factor + 1) / 2) * BaseTO ). + + p(F) -> p(F, []). diff --git a/lib/megaco/test/modules.mk b/lib/megaco/test/modules.mk index 55b3003d6d..b45bd4b13c 100644 --- a/lib/megaco/test/modules.mk +++ b/lib/megaco/test/modules.mk @@ -25,6 +25,15 @@ COVER_SPEC_FILE = megaco.cover BEHAVIOUR_MODULES = \ megaco_test_generator +ifeq ($(INCLUDE_PREV3_MODULES),true) +TEST_UTIL_PREV3_MODULES = \ + megaco_test_msg_prev3a_lib \ + megaco_test_msg_prev3b_lib \ + megaco_test_msg_prev3c_lib +else +TEST_UTIL_PREV3_MODULES = +endif + TEST_UTIL_MODULES = \ $(BEHAVIOUR_MODULES) \ megaco_codec_test_lib \ @@ -45,12 +54,20 @@ TEST_UTIL_MODULES = \ megaco_test_mg \ megaco_test_msg_v1_lib \ megaco_test_msg_v2_lib \ - megaco_test_msg_prev3a_lib \ - megaco_test_msg_prev3b_lib \ - megaco_test_msg_prev3c_lib \ + $(TEST_UTIL_PREV3_MODULES) \ megaco_test_msg_v3_lib \ megaco_test_lib + +ifeq ($(INCLUDE_PREV3_MODULES),true) +SUITE_PREV3_MODULES = \ + megaco_codec_prev3a_SUITE \ + megaco_codec_prev3b_SUITE \ + megaco_codec_prev3c_SUITE +else +SUITE_PREV3_MODULES = +endif + SUITE_MODULES = \ megaco_actions_SUITE \ megaco_app_SUITE \ @@ -59,9 +76,7 @@ SUITE_MODULES = \ megaco_codec_mini_SUITE \ megaco_codec_v1_SUITE \ megaco_codec_v2_SUITE \ - megaco_codec_prev3a_SUITE \ - megaco_codec_prev3b_SUITE \ - megaco_codec_prev3c_SUITE \ + $(SUITE_PREV3_MODULES) \ megaco_codec_v3_SUITE \ megaco_config_SUITE \ megaco_digit_map_SUITE \ |