sign: Fix filter in test script for GUID > 255
This commit is contained in:
parent
72521f782e
commit
9cd26567cd
@ -6,6 +6,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
import random
|
import random
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
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]
|
guid = sign_stream_cfg['guid'][i]
|
||||||
if guid < 0:
|
if guid < 0:
|
||||||
continue
|
continue
|
||||||
filter='frame[-9:9]==00.00.00.'+format(guid, 'x')+'.61.a1.b2.c3.d4'\
|
filter='frame[-9:9]==00.' \
|
||||||
+ ' && !icmp && !icmpv6'
|
+ re.sub('..', '\g<0>.', format(guid, '06x')) \
|
||||||
|
+ '61.a1.b2.c3.d4 && !icmp && !icmpv6'
|
||||||
print(filter)
|
print(filter)
|
||||||
cap_pkts = subprocess.check_output([tshark, '-n', '-r', 'capX.pcap',
|
cap_pkts = subprocess.check_output([tshark, '-n', '-r', 'capX.pcap',
|
||||||
'-Y', filter])
|
'-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]
|
guid = sign_stream_cfg['guid'][i]
|
||||||
if guid < 0:
|
if guid < 0:
|
||||||
continue
|
continue
|
||||||
filter='frame[-9:9]==00.00.00.'+format(guid, 'x')+'.61.a1.b2.c3.d4'\
|
filter='frame[-9:9]==00.' \
|
||||||
+ ' && !icmp && !icmpv6'
|
+ re.sub('..', '\g<0>.', format(guid, '06x')) \
|
||||||
|
+ '61.a1.b2.c3.d4 && !icmp && !icmpv6'
|
||||||
print(filter)
|
print(filter)
|
||||||
cap_pkts = subprocess.check_output([tshark, '-n', '-r', 'capY.pcap',
|
cap_pkts = subprocess.check_output([tshark, '-n', '-r', 'capY.pcap',
|
||||||
'-Y', filter])
|
'-Y', filter])
|
||||||
|
Loading…
Reference in New Issue
Block a user