bind9/bin/tests/system/dnstap
Michał Kępień a1800c23a0
Wait until fstrm_capture is ready
The fstrm_capture utility is started in the background during the
"dnstap" system test.  Consequently, "rndc dnstap-reopen" and similar
commands may be executed before fstrm_capture starts listening on the
Unix domain socket it is configured to receive dnstap data on.  This
results in the dnstap data sent to that socket in the meantime to be
lost; while the fstrm writer thread is able to recover from such a
scenario within a couple of seconds (by reopening the configured dnstap
destination itself), only one write attempt is made for data
successfully queued to the writer thread, so dnstap frames can still be
lost in the process.  This may happen during the "dnstap" system test,
leading to the dnstap output file being empty, which in turn causes the
test to fail.

Fix by waiting until fstrm_capture starts listening on the Unix domain
socket it is configured to use before asking named to reopen the
configured dnstap destination.  Since various fstrm_capture versions log
different messages when the listening socket is set up, wait for a
common string that works for all fstrm_capture versions released to
date.  Add a few extra debug messages indicating test progress and make
the test fail if the expected fstrm_capture log message is not generated
within 10 seconds.

(cherry picked from commit 26d3d97f12)
2023-08-07 13:59:35 +02:00
..
ns1 Use DEFAULT_HMAC for rndc 2022-08-10 17:25:26 +10:00
ns2 Use DEFAULT_HMAC for rndc 2022-08-10 17:25:26 +10:00
ns3 Use DEFAULT_HMAC for rndc 2022-08-10 17:25:26 +10:00
ns4 Use DEFAULT_HMAC for rndc 2022-08-10 17:25:26 +10:00
bad-fstrm-reopen-interval.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-buffer-hint-max.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-buffer-hint-min.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-flush-timeout-max.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-flush-timeout-min.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-input-queue-size-max.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-input-queue-size-min.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-input-queue-size-po2.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-output-notify-threshold.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-output-queue-size-max.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-output-queue-size-min.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-reopen-interval-max.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-fstrm-set-reopen-interval-min.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-missing-dnstap-output-view.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-missing-dnstap-output.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bad-size-version.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
clean.sh Capture all fstrm_capture output 2023-08-07 13:59:35 +02:00
good-dnstap-in-options.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-dnstap-in-view.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-reopen-interval.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-set-buffer-hint.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-set-flush-timeout.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-set-input-queue-size.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-set-output-notify-threshold.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-set-output-queue-model-mpsc.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-set-output-queue-model-spsc.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-set-output-queue-size.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-fstrm-set-reopen-interval.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-size-unlimited.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
good-size-version.conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
large-answer.fstrm dnstap-read: clear buffer before expanding it 2019-06-28 12:43:51 +02:00
prereq.sh Add dnstap prerequisite for dnstap system test 2022-12-02 10:45:21 +01:00
README Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
setup.sh Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
tests.sh Wait until fstrm_capture is ready 2023-08-07 13:59:35 +02:00
tests_dnstap.py Bump the requirement in dnstap test to dnspython 2.0.0 2023-04-04 16:44:19 +00:00
tests_sh_dnstap.py Add pytest functions for shell system tests 2023-05-23 16:55:26 +02:00
ydump.py Auto-format Python files with black 2022-06-08 13:18:27 +02:00

Copyright (C) Internet Systems Consortium, Inc. ("ISC")

SPDX-License-Identifier: MPL-2.0

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0.  If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.

See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.

The "large-answer.fstrm" file was generated by configuring a named instance
compiled with --enable-dnstap and --enable-fixed-rrset with the following
directives:

    minimal-responses yes;
    rrset-order { order fixed; };
    dnstap { auth response; };
    dnstap-identity none;
    dnstap-output file "large-answer.fstrm";

The captured RRset from the "example." zone was created using:

    $GENERATE 1-48 @ IN A 127.0.0.$

A server instance set up this way was then queried non-recursively (RD=0) for
"example/A".