Skip to content

Commit

Permalink
chore: add test for parsing matter packet (#1364)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Feb 29, 2024
1 parent 4877829 commit 0108b50
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,3 +1055,29 @@ def test_txt_after_invalid_nsec_name_still_usable():
b't=2\x0emdnssequence=0'
)
assert len(parsed.answers()) == 5


def test_parse_matter_packet():
"""Test our wire parser can handle a packet from matter."""
packet_hex = (
"000084000000000a00000000075f6d6174746572045f746370056c6f63"
"616c00000c000100001194002421413336303441463533314638364442"
"372d30303030303030303030303030303636c00cc00c000c0001000011"
"94002421333346353633363743453244333646302d3030303030303030"
"3444423341334541c00cc00c000c000100001194002421414531313941"
"304130374145304632302d34383742343631363639333638413332c00c"
"c00c000c00010000119400242141333630344146353331463836444237"
"2d30303030303030303030303030303237c00cc00c000c000100001194"
"002421413336303441463533314638364442372d303030303030303030"
"30303030303637c00cc00c000c00010000119400242133334635363336"
"3743453244333646302d30303030303030304243363637324136c00cc0"
"0c000c000100001194002421414531313941304130374145304632302d"
"39464534383646413645373730464433c00cc00c000c00010000119400"
"2421413336303441463533314638364442372d30303030303030303030"
"303030303434c00cc00c000c0001000011940024213935374431413839"
"44463239343033312d41423337393041444346434231423239c00cc00c"
"000c000100001194002421413336303441463533314638364442372d30"
"303030303030303030303030303638c00c"
)
parsed = r.DNSIncoming(bytes.fromhex(packet_hex))
assert len(parsed.answers()) == 10

0 comments on commit 0108b50

Please sign in to comment.