1. 31 Jul, 2019 5 commits
  2. 30 Jul, 2019 11 commits
    • Michał Kępień's avatar
      Merge branch '1171-alpine-linux-tweaks-v9_14' into 'v9_14' · ef63765c
      Michał Kępień authored
      [v9_14] Alpine Linux tweaks
      See merge request !2209
    • Michał Kępień's avatar
      Add Alpine Linux to GitLab CI · 6cf79bc9
      Michał Kępień authored
      Ensure BIND is continuously tested on Alpine Linux as it is commonly
      used as a base for Docker containers and employs a less popular libc
      implementation, musl libc.
      (cherry picked from commit 326a334b)
    • Michał Kępień's avatar
      Do not use legacy time zone names · 8d0cdb54
      Michał Kępień authored
      "PST8PDT" is a legacy time zone name whose use in modern code is
      discouraged.  It so happens that using this time zone with musl libc
      time functions results in different output than for other libc
      implementations, which breaks the lib/isc/tests/time_test unit test.
      Use the "America/Los_Angeles" time zone instead in order to get
      consistent output across all tested libc implementations.
      (cherry picked from commit f4daf6e0)
    • Michał Kępień's avatar
      Fix awk invocation in the "verify" system test · 5159597d
      Michał Kępień authored
      Appending output of a command to the same file as the one that command
      is reading from is a dangerous practice.  It seems to have accidentally
      worked with all the awk implementations we have tested against so far,
      but for BusyBox awk, doing this may result in the input/output file
      being written to in an infinite loop.  Prevent this from happening by
      redirect awk output to a temporary file and appending its contents to
      the original file in a separate shell pipeline.
      (cherry picked from commit bb9c1654)
    • Michał Kępień's avatar
      Extend prerequisites for the "xfer" system test · 61981b36
      Michał Kępień authored
      The Net::DNS Perl module needs the Digest::HMAC module to support TSIG.
      However, since the latter is not a hard requirement for the former, some
      packagers do not make Net::DNS depend on Digest::HMAC.  If Net::DNS is
      installed on a host but Digest::HMAC is not, the "xfer" system test
      breaks in a very hard-to-debug way (ans5 returns TSIG RRs with empty
      RDATA, which prevents TSIG-signed SOA queries and transfers from
      working).  Prevent this from happening by making the "xfer" system test
      explicitly require Digest::HMAC apart from Net::DNS.
      (cherry picked from commit b10d28d1)
    • Michał Kępień's avatar
      Make "digdelv" system test work with BusyBox sed · fe7dec85
      Michał Kępień authored
      The BusyBox version of sed treats leading '\+' in a regular expression
      to be matched as a syntax error ("Repetition not preceded by valid
      expression"), which triggers false positives for the "digdelv" system
      test.  Make the relevant sed invocations work portably across all sed
      implementations by removing the leading backslash.
      (cherry picked from commit 266e3ed5)
    • Michał Kępień's avatar
      Make "autosign" system test work with BusyBox awk · fdd926d7
      Michał Kępień authored
      The BusyBox version of awk treats some variables which other awk
      implementations consider to be decimal values as octal values.  This
      intermittently breaks key event interval calculations in the "autosign"
      system test, trigger false positives for it.  Prevent the problem from
      happening by stripping leading zeros from the affected awk variables.
      (cherry picked from commit ad008f7d)
    • Michał Kępień's avatar
      Tweak buffer sizes to prevent compilation warnings · 149ffc52
      Michał Kępień authored
      For some libc implementations, BUFSIZ is small enough (e.g. 1024 for
      musl libc) to trigger compilation warnings about insufficient size of
      certain buffers.  Since the relevant buffers are used for printing DNS
      names, increase their size to '(n + 1) * DNS_NAME_FORMATSIZE', where 'n'
      is the number of DNS names which are printed to a given buffer.  This
      results in somewhat arbitrary, albeit nicely-aligned and large enough
      buffer sizes.
      (cherry picked from commit 33844556)
    • Michał Kępień's avatar
      Always include <errno.h> instead of <sys/errno.h> · 3f341b99
      Michał Kępień authored
      Including <sys/errno.h> instead of <errno.h> raises a compiler warning
      when building against musl libc.  Always include <errno.h> instead of
      <sys/errno.h> to prevent that compilation warning from being triggered
      and to achieve consistency in this regard across the entire source tree.
      (cherry picked from commit b5cd1460)
    • Michał Kępień's avatar
      Unify header ordering in unit tests · 80669d8c
      Michał Kępień authored
      Make sure all unit tests include headers in a similar order:
       1. Three headers which must be included before <cmocka.h>.
       2. System headers.
       3. UNIT_TESTING definition, followed by the <cmocka.h> header.
       4. libisc headers.
       5. Headers from other BIND libraries.
       6. Local headers.
      Also make sure header file names are sorted alphabetically within each
      block of #include directives.
      (cherry picked from commit 5381ac0f)
    • Michał Kępień's avatar
      Include <sched.h> where necessary for musl libc · 77dc5be6
      Michał Kępień authored
      All unit tests define the UNIT_TESTING macro, which causes <cmocka.h> to
      replace malloc(), calloc(), realloc(), and free() with its own functions
      tracking memory allocations.  In order for this not to break
      compilation, the system header declaring the prototypes for these
      standard functions must be included before <cmocka.h>.
      Normally, these prototypes are only present in <stdlib.h>, so we make
      sure it is included before <cmocka.h>.  However, musl libc also defines
      the prototypes for calloc() and free() in <sched.h>, which is included
      by <pthread.h>, which is included e.g. by <isc/mutex.h>.  Thus, unit
      tests including "dnstest.h" (which includes <isc/mem.h>, which includes
      <isc/mutex.h>) after <cmocka.h> will not compile with musl libc as for
      these programs, <sched.h> will be included after <cmocka.h>.
      Always including <cmocka.h> after all other header files is not a
      feasible solution as that causes the mock assertion macros defined in
      <isc/util.h> to mangle the contents of <cmocka.h>, thus breaking
      compilation.  We cannot really use the __noreturn__ or analyzer_noreturn
      attributes with cmocka assertion functions because they do return if the
      tested condition is true.  The problem is that what BIND unit tests do
      is incompatible with Clang Static Analyzer's assumptions: since we use
      cmocka, our custom assertion handlers are present in a shared library
      (i.e. it is the cmocka library that checks the assertion condition, not
      a macro in unit test code).  Redefining cmocka's assertion macros in
      <isc/util.h> is an ugly hack to overcome that problem - unfortunately,
      this is the only way we can think of to make Clang Static Analyzer
      properly process unit test code.  Giving up on Clang Static Analyzer
      being able to properly process unit test code is not a satisfactory
      Undefining _GNU_SOURCE for unit test code could work around the problem
      (musl libc's <sched.h> only defines the prototypes for calloc() and
      free() when _GNU_SOURCE is defined), but doing that could introduce
      discrepancies for unit tests including entire *.c files, so it is also
      not a good solution.
      All in all, including <sched.h> before <cmocka.h> for all affected unit
      tests seems to be the most benign way of working around this musl libc
      quirk.  While quite an ugly solution, it achieves our goals here, which
      are to keep the benefit of proper static analysis of unit test code and
      to fix compilation against musl libc.
      (cherry picked from commit 59528d0e)
  3. 29 Jul, 2019 2 commits
    • Michał Kępień's avatar
      Merge branch... · 747dbdcb
      Michał Kępień authored
      Merge branch 'michal/filter-aaaa-system-test-make-root-hints-consistent-with-authoritative-data-v9_14' into 'v9_14'
      [v9_14] "filter-aaaa" system test: make root hints consistent with authoritative data
      See merge request !2205
    • Michał Kępień's avatar
      Make root hints consistent with authoritative data · 7bcb5a31
      Michał Kępień authored
      Resolvers in the "filter-aaaa" system test are configured with a single
      root hint: "ns.rootservers.net", pointing to  However,
      querying ns1 for "ns.rootservers.net" results in NXDOMAIN answers.
      Since the TTL for the root hint is set to 0, it may happen that a
      resolver's ADB will be asked to return any known addresses for
      "ns.rootservers.net", but it will only have access to a cached NXDOMAIN
      answer for that name and an expired root hint, which will result in a
      resolution failure, triggering a false positive for the "filter-aaaa"
      system test.  Prevent this from happening by making all the root hints
      consistent with authoritative data served by ns1.
      (cherry picked from commit c19ebde1)
  4. 26 Jul, 2019 2 commits
  5. 25 Jul, 2019 2 commits
  6. 23 Jul, 2019 4 commits
  7. 22 Jul, 2019 14 commits