|
22 | 22 | # You should have received a copy of the GNU General Public License |
23 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
24 | 24 |
|
25 | | -pckt_mavic_air_fcc = [0x55, 0x17, 0x04, 0x38, 0x02, 0x0e, 0x1d, 0x00, 0x40, 0x07, 0x30, 0x55, 0x53, 0x00, 0x00, 0x55, 0x53, 0x00, 0x00, 0x01, 0x00, 0xfe, 0x5d] |
26 | | -pckt_mini_2_fcc = [0x55, 0x18, 0x04, 0x20, 0x02, 0x09, 0x00, 0x00, 0x40, 0x09, 0x27, 0x00, 0x02, 0x48, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x81, 0x1f] |
27 | | - |
28 | 25 | import logging |
29 | 26 | import subprocess |
30 | 27 | import os |
|
35 | 32 | import datetime |
36 | 33 | import pytest |
37 | 34 |
|
38 | | -import array |
39 | | - |
40 | 35 | LOGGER = logging.getLogger(__name__) |
41 | 36 |
|
| 37 | +pckt_mavic_air_fcc = [0x55, 0x17, 0x04, 0x38, 0x02, 0x0e, 0x1d, 0x00, 0x40, 0x07, 0x30, 0x55, 0x53, 0x00, 0x00, 0x55, 0x53, 0x00, 0x00, 0x01, 0x00, 0xfe, 0x5d] |
| 38 | +pckt_mini_2_fcc = [0x55, 0x18, 0x04, 0x20, 0x02, 0x09, 0x00, 0x00, 0x40, 0x09, 0x27, 0x00, 0x02, 0x48, 0x00, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x81, 0x1f] |
| 39 | + |
42 | 40 | def write_one_packet_pcap(fname, userdlt, data): |
43 | 41 | with open(fname, "wb") as out: |
44 | 42 | out.write(struct.pack("=IHHiIII", |
@@ -78,11 +76,10 @@ def case_comm_dissector_tshark_show(pcap_file, userdlt, proto_name, pckt, env=No |
78 | 76 | write_one_packet_pcap(pcap_file, userdlt, bytearray(pckt)) |
79 | 77 | run_comm_dissector_tshark_show("tshark", str(pcap_file), proto_name, pkt_cmd, env=env) |
80 | 78 |
|
81 | | -# Make this a separate mark rather than comm, until our CI can execute this correctly |
82 | | -@pytest.mark.commDISS |
| 79 | +@pytest.mark.comm |
83 | 80 | def test_comm_dissector_tshark_show(tmp_path): |
84 | 81 | """ Test dissecting a packet with Wiresharks tshark. |
85 | 82 | """ |
86 | 83 | test_env = os.environ.copy() |
87 | | - case_comm_dissector_tshark_show(tmp_path / "dji-packet.pcap", 3, "DJI_DUMLv1", pckt_mavic_air_fcc, env=test_env) |
88 | | - case_comm_dissector_tshark_show(tmp_path / "dji-packet.pcap", 3, "DJI_DUMLv1", pckt_mini_2_fcc, env=test_env) |
| 84 | + case_comm_dissector_tshark_show(tmp_path / "dji-packet-mavair.pcap", 3, "DJI_DUMLv1", pckt_mavic_air_fcc, env=test_env) |
| 85 | + case_comm_dissector_tshark_show(tmp_path / "dji-packet-mini2.pcap", 3, "DJI_DUMLv1", pckt_mini_2_fcc, env=test_env) |
0 commit comments