386ec26b3d
In fullstack test test_dscp_marking_packets two fake hosts are created, each of them has got one fake instance (called sender and receiver). Instance called "sender" sends ICMP packets to instance called "receiver". In receiver's namespace tcpdump process is spawned with filter to match only packets marked with specified DSCP value. After sender instance successfully pings receiver, tcpdump process is killed and stdout from it was examined to search logged ICMP packets which were send from sender's IP to receiver's IP address. That check was failing sometimes as is described in bug report. It was failing when tcpdump doesn't capture any packets so there was nothing on stdout from it. But even in such case tcpdump reports on stderr summary of packets and it was like below: 0 packets captured 6 packets received by filter 0 packets dropped by kernel which means that packets matching our filter was received by tcpdump but were probably not processed yet. See [1] for more details. So this patch changes filter used in tcpdump and way how its output is checked. Now in filter expression there are added src and dst IP addresses also so it will match only packets send from sender instance to receiver instance. After that tcpdump's stderr output is examined with regex to check if line like: X packets received by filter is there and if X value is different than 0. If so, it means that tcpdump received packets with wanted DSCP mark and test should pass. [1] https://unix.stackexchange.com/a/29369 Change-Id: Ia3522237dc787edb90d162ac4a5535ff5d2a03d5 Closes-Bug: #1733649 |
||
---|---|---|
.. | ||
agents | ||
exclusive_resources | ||
__init__.py | ||
base.py | ||
config_fixtures.py | ||
conn_testers.py | ||
helpers.py | ||
l3_test_common.py | ||
machine_fixtures.py | ||
net_helpers.py |