Change way how tcpdump result is checked in multicast test
In the multicast scenario test, when IGMP snooping is enabled thus
multicast traffic shouldn't be delivered to the unregistered node.
To check that this is true, we run tcpdump on the unregistered node
with filter to catch multicast packets and we assert that any packet
wasn't captured by tcpdump.
The problem is that we were expeciting in the actual tcpdump message
string like:
'0 packets captured\n0 packets received by filter'
and that can cause problem as sometimes test is failing due to output
like:
'0 packets captured
3 packets received by filter
0 packets dropped by kernel'
Now, according to the tcpdump manpage [1] meaning of the "packets
received by filter" is like below:
"the meaning of this depends on the OS on which you're running
tcpdump, and possibly on the way the OS was configured - if a
filter was specified on the command line, on some OSes it counts
packets regardless of whether they were matched by the filter
expression and, even if they were matched by the filter expression,
regardless of whether tcpdump has read and processed them yet,
on other OSes it counts only packets that were matched by
the filter expression regardless of whether tcpdump has read and
processed them yet, and on other OSes it counts only packets that
were matched by the filter expression and were processed by
tcpdump"
So to avoid failured to due packets "received by filter", lets just
match on packets "captured" as in case of this test, when we are using
"-c1" switch in tcpdump that should be enough.
[1] https://www.tcpdump.org/manpages/tcpdump.1.html
Closes-Bug: #1926780
Change-Id: If36931beecd53c0767a5de5fd01f861961385049
1 file changed