sign: Fix filter in test script for GUID > 255

This commit is contained in:
Srivats P 2016-12-08 21:26:09 +05:30
parent 72521f782e
commit 9cd26567cd

View File

@ -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])