diff --git a/test/streamstatstest.py b/test/streamstatstest.py index aee206c..defd3c3 100644 --- a/test/streamstatstest.py +++ b/test/streamstatstest.py @@ -6,6 +6,7 @@ import logging import os import pytest import random +import re import subprocess import sys import time @@ -507,8 +508,9 @@ def test_unidir(drone, ports, dut, dut_ports, dut_ip, emul_ports, dgid_list, guid = sign_stream_cfg['guid'][i] if guid < 0: continue - filter='frame[-9:9]==00.00.00.'+format(guid, 'x')+'.61.a1.b2.c3.d4'\ - + ' && !icmp && !icmpv6' + filter='frame[-9:9]==00.' \ + + re.sub('..', '\g<0>.', format(guid, '06x')) \ + + '61.a1.b2.c3.d4 && !icmp && !icmpv6' print(filter) cap_pkts = subprocess.check_output([tshark, '-n', '-r', 'capX.pcap', '-Y', filter]) @@ -548,8 +550,9 @@ def test_unidir(drone, ports, dut, dut_ports, dut_ip, emul_ports, dgid_list, guid = sign_stream_cfg['guid'][i] if guid < 0: continue - filter='frame[-9:9]==00.00.00.'+format(guid, 'x')+'.61.a1.b2.c3.d4'\ - + ' && !icmp && !icmpv6' + filter='frame[-9:9]==00.' \ + + re.sub('..', '\g<0>.', format(guid, '06x')) \ + + '61.a1.b2.c3.d4 && !icmp && !icmpv6' print(filter) cap_pkts = subprocess.check_output([tshark, '-n', '-r', 'capY.pcap', '-Y', filter])