Closed walter-weinmann closed 6 years ago
@walter-weinmann unable to reproduce
*** User 2018-06-04 04:47:37.286 ***
smpp_test_utils:unpack_map_pack:54 ===> unbind
#{broadcast_area_identifier =>
[#{details => "my_broadcast_area_identifier_00010",format => 1}],
broadcast_content_type => #{network_type => 0,service => 256},
broadcast_frequency_interval => #{number => 3,time_unit => 13},
broadcast_rep_num => 0,command_id => 273,command_length => 153,
command_status => 0,data_coding => 255,
message_id => "this_could_be_a_message_id",priority_flag => 4,
replace_if_present_flag => 1,schedule_delivery_time => "990823165343000R",
sequence_number => 1,service_type => [],sm_default_msg_id => 3,
source_addr => "168.0.0.1",source_addr_npi => 8,source_addr_ton => 1,
validity_period => "990922155242000R"}
{
"broadcast_area_identifier": [
{
"details": "my_broadcast_area_identifier_00010",
"format": 1
}
],
"broadcast_content_type": {
"network_type": 0,
"service": 256
},
"broadcast_frequency_interval": {
"number": 3,
"time_unit": 13
},
"broadcast_rep_num": 0,
"command_id": 273,
"command_length": 153,
"command_status": 0,
"data_coding": 255,
"message_id": "this_could_be_a_message_id",
"priority_flag": 4,
"replace_if_present_flag": 1,
"schedule_delivery_time": "990823165343000R",
"sequence_number": 1,
"service_type": "",
"sm_default_msg_id": 3,
"source_addr": "168.0.0.1",
"source_addr_npi": 8,
"source_addr_ton": 1,
"validity_period": "990922155242000R"
}
*** User 2018-06-04 04:47:37.287 ***
smpp_test_utils:unpack_map_pack:57 ===>
Expected : <<0,0,0,153,0,0,1,17,0,0,0,0,0,0,0,1,0,1,8,49,54,56,46,48,46,48,46,
49,0,116,104,105,115,95,99,111,117,108,100,95,98,101,95,97,95,109,
101,115,115,97,103,101,95,105,100,0,4,57,57,48,56,50,51,49,54,53,
51,52,51,48,48,48,82,0,57,57,48,57,50,50,49,53,53,50,52,50,48,48,
48,82,0,1,255,3,6,6,0,35,1,109,121,95,98,114,111,97,100,99,97,115,
116,95,97,114,101,97,95,105,100,101,110,116,105,102,105,101,114,
95,48,48,48,49,48,6,1,0,3,0,1,0,6,4,0,2,0,0,6,5,0,3,13,0,3>>
Got : <<0,0,0,153,0,0,1,17,0,0,0,0,0,0,0,1,0,1,8,49,54,56,46,48,46,48,46,
49,0,116,104,105,115,95,99,111,117,108,100,95,98,101,95,97,95,109,
101,115,115,97,103,101,95,105,100,0,4,57,57,48,56,50,51,49,54,53,
51,52,51,48,48,48,82,0,57,57,48,57,50,50,49,53,53,50,52,50,48,48,
48,82,0,1,255,3,6,4,0,2,0,0,6,5,0,3,13,0,3,6,1,0,3,0,1,0,6,6,0,35,
1,109,121,95,98,114,111,97,100,99,97,115,116,95,97,114,101,97,95,
105,100,101,110,116,105,102,105,101,114,95,48,48,48,49,48>>
*** CT Error Notification 2018-06-04 04:47:37.287 ***
smpp_test_utils:'-unpack_map_pack/1-fun-1-' failed on line 60
Reason: assertEqual
*** CT Error Notification 2018-06-04 04:47:37.703 ***
erlang:list_to_binary failed
Reason: badarg
@walter-weinmann assuming this issue is still valid (from your point-of-view), here is my analysis:
1> PDU1 = <<0,0,0,153,0,0,1,17,0,0,0,0,0,0,0,1,0,1,8,49,54,56,46,48,46,48,46,
1>
1> 49,0,116,104,105,115,95,99,111,117,108,100,95,98,101,95,97,95,109,
1>
1> 101,115,115,97,103,101,95,105,100,0,4,57,57,48,56,50,51,49,54,53,
1>
1> 51,52,51,48,48,48,82,0,57,57,48,57,50,50,49,53,53,50,52,50,48,48,
1>
1> 48,82,0,1,255,3,6,6,0,35,1,109,121,95,98,114,111,97,100,99,97,115,
1>
1> 116,95,97,114,101,97,95,105,100,101,110,116,105,102,105,101,114,
1>
1> 95,48,48,48,49,48,6,1,0,3,0,1,0,6,4,0,2,0,0,6,5,0,3,13,0,3>>.
<<0,0,0,153,0,0,1,17,0,0,0,0,0,0,0,1,0,1,8,49,54,56,46,48,
46,48,46,49,0,...>>
2> PDU2 = <<0,0,0,153,0,0,1,17,0,0,0,0,0,0,0,1,0,1,8,49,54,56,46,48,46,48,46,
2>
2> 49,0,116,104,105,115,95,99,111,117,108,100,95,98,101,95,97,95,109,
2>
2> 101,115,115,97,103,101,95,105,100,0,4,57,57,48,56,50,51,49,54,53,
2>
2> 51,52,51,48,48,48,82,0,57,57,48,57,50,50,49,53,53,50,52,50,48,48,
2>
2> 48,82,0,1,255,3,6,4,0,2,0,0,6,5,0,3,13,0,3,6,1,0,3,0,1,0,6,6,0,35,
2>
2> 1,109,121,95,98,114,111,97,100,99,97,115,116,95,97,114,101,97,95,
2>
2> 105,100,101,110,116,105,102,105,101,114,95,48,48,48,49,48>>
2>
2> .
<<0,0,0,153,0,0,1,17,0,0,0,0,0,0,0,1,0,1,8,49,54,56,46,48,
46,48,46,49,0,...>>
3> PDU1 == PDU2.
false
5> MAP1 = smpp:unpack_map(PDU1).
#{broadcast_area_identifier =>
[#{details => "my_broadcast_area_identifier_00010",
format => 1}],
broadcast_content_type =>
#{network_type => 0,service => 256},
broadcast_frequency_interval =>
#{number => 3,time_unit => 13},
broadcast_rep_num => 0,command_id => 273,
command_length => 153,command_status => 0,
data_coding => 255,
message_id => "this_could_be_a_message_id",
priority_flag => 4,replace_if_present_flag => 1,
schedule_delivery_time => "990823165343000R",
sequence_number => 1,service_type => [],
sm_default_msg_id => 3,source_addr => "168.0.0.1",
source_addr_npi => 8,source_addr_ton => 1,
validity_period => "990922155242000R"}
6> MAP2 = smpp:unpack_map(PDU2).
#{broadcast_area_identifier =>
[#{details => "my_broadcast_area_identifier_00010",
format => 1}],
broadcast_content_type =>
#{network_type => 0,service => 256},
broadcast_frequency_interval =>
#{number => 3,time_unit => 13},
broadcast_rep_num => 0,command_id => 273,
command_length => 153,command_status => 0,
data_coding => 255,
message_id => "this_could_be_a_message_id",
priority_flag => 4,replace_if_present_flag => 1,
schedule_delivery_time => "990823165343000R",
sequence_number => 1,service_type => [],
sm_default_msg_id => 3,source_addr => "168.0.0.1",
source_addr_npi => 8,source_addr_ton => 1,
validity_period => "990922155242000R"}
7> MAP1 == MAP2.
true
As you can see (also what I was trying to explain in flowdock and mails) though the binaries are different the parsed PDUs are the same. This means you should remove this "Expected ... Got..." comparison (and ?dbgFmt
) from your test cases as well.
erlang:list_to_binary
problem
Can you give a stacktrace as wo where in smpp.erl
is this happening?
_I am maintaining not reproducable untill I understand that the problem is still in smpp_parser
and NOT in test code!_
Fixed with latest version.