Skip to content

Commit

Permalink
Fix failure issue of test_check_igmp_reports
Browse files Browse the repository at this point in the history
We are having a random failure (most of the times when running it from
CI/Jenkins) in test_check_igmp_reports like this:
~~~
2023-09-25 16:21:00,799 379853 INFO     [nfv_tempest_plugin.tests.common.shell_utilities [-] nfv_plugin_test] Executing command: sudo killall -SIGINT tcpdump;cat /tmp/tmpo5kcpu03 | ( grep igmp || true ) | ( grep report || true ) | wc -l
}}}

Traceback (most recent call last):
  File "/home/stack/plugins/nfv-tempest-plugin.git/nfv_tempest_plugin/tests/scenario/test_igmp_snooping_usecases.py", line 336, in test_check_igmp_reports
    self.assertGreater(output, 0, "No igmp reports received")
  File "/usr/lib64/python3.9/unittest/case.py", line 1235, in assertGreater
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib64/python3.9/unittest/case.py", line 676, in fail
    raise self.failureException(msg)
AssertionError: 0 not greater than 0 : No igmp reports received
~~~

However, as output file is not deleted we can check that igmp reports
are actually captured:
~~~
[tripleo-admin@compute-0 ~]$ cat /tmp/tmpo5kcpu03
dropped privs to tcpdump
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on br-dpdk0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
16:20:57.710074 IP 10.10.164.124 > igmp.mcast.net: igmp v3 report, 1 group record(s)

1 packet captured
7 packets received by filter
0 packets dropped by kernel

[tripleo-admin@compute-0 ~]$ cat /tmp/tmpo5kcpu03 | ( grep igmp || true ) | ( grep report || true ) | wc -l
1
~~~

So it seems to be race condition that makes /tmp/tmpxxx not be created
sometimes in the short period of time between the kill and cat
executions

We hope that introducing a 3 second sleep between kill and cat
commands can solve the issue.

Change-Id: I78f70969955c245f6149fc4e56856b865bc6aa62
  • Loading branch information
rdiazcam committed Sep 26, 2023
1 parent 4b261c7 commit 5a395bd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def test_check_igmp_reports(self, test='check_igmp_reports'):
cmd_dump = "PATH=$PATH:/usr/sbin; sudo tcpdump -i {} igmp " \
"> {} 2>&1 &".format(reports_interface, tcpdump_file)
# Filter only igmp reports messages (join/leave), not igmp queries
cmd_result = "sudo killall -SIGINT tcpdump;cat {} | " \
cmd_result = "sudo killall -SIGINT tcpdump; sleep 3; cat {} | " \
"( grep igmp || true ) | ( grep report || true ) | " \
"wc -l".format(tcpdump_file)

Expand Down

0 comments on commit 5a395bd

Please sign in to comment.