summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2016-05-13 14:43:01 +0200
committeranonym <anonym@riseup.net>2016-05-13 15:10:45 +0200
commitca2b65a75c7d191b88f673eefd897a0aac219472 (patch)
tree8f884a4424553d1a60b527b87e80d4c7acbb04be
parentbd1a71ba46c47ab31c176ff4997a44e5dc987843 (diff)
Run tcpdump with --immediate-mode.
With this option, "packets are delivered to tcpdump as soon as they arrive, rather than being buffered for efficiency". It's not available in Jessie's tcpdump, but it is in jessie-backports. Background: Normally tcpdump uses a 1000 ms = 1 s timeout (set via `pcap_set_timeout`; for more details, see the "read timeout" section in the "pcap" man page from the libpcap*-dev package) which explaines that the `sleep 1` worked most of the time before on my lightly loaded system, but much rarely on jenkins highly loaded system. At the moment this should hopefully fix the issues we have with the "Anti test: Detecting UDP leaks of DNS lookups with the firewall leak detector" scenario in the test/9521-chutney branch.
-rw-r--r--features/support/helpers/sniffing_helper.rb10
-rw-r--r--wiki/src/contribute/release_process/test/setup.mdwn2
2 files changed, 2 insertions, 10 deletions
diff --git a/features/support/helpers/sniffing_helper.rb b/features/support/helpers/sniffing_helper.rb
index 1f48e71..38b1382 100644
--- a/features/support/helpers/sniffing_helper.rb
+++ b/features/support/helpers/sniffing_helper.rb
@@ -27,6 +27,7 @@ class Sniffer
"/usr/sbin/tcpdump",
"-n",
"-U",
+ "--immediate-mode",
"-i", @vmnet.bridge_name,
"-w", @pcap_file,
filter,
@@ -37,15 +38,6 @@ class Sniffer
end
def stop
- # Sometimes tcpdump/pcap is not fast enough to write a captured
- # packet to file vs when we kill the process. For instance, if we
- # sniff then network, run some step that generates traffic that we
- # are interested in, and then immediately run this method, we
- # might kill tcpdump before it has handled said traffic, so
- # there's a race. Since we already run tcpdump with `-U` there
- # seems to be little else we can do than a static sleep, short of
- # switching to another sniffing technology that is faster.
- sleep 1
begin
Process.kill("TERM", @pid)
rescue
diff --git a/wiki/src/contribute/release_process/test/setup.mdwn b/wiki/src/contribute/release_process/test/setup.mdwn
index e28bf36..583fb62 100644
--- a/wiki/src/contribute/release_process/test/setup.mdwn
+++ b/wiki/src/contribute/release_process/test/setup.mdwn
@@ -52,7 +52,7 @@ The following packages are necessary on Debian Jessie:
ruby-rspec \
ruby-test-unit \
seabios \
- tcpdump \
+ tcpdump/jessie-backports \
tor/jessie-backports \
unclutter \
virt-viewer \