Commit graph

8425 commits

Author SHA1 Message Date
Evan Hunt
a8b583e78b test interfaces directly in runall.sh and parallel.mk 2018-02-26 14:58:16 +01:00
Michał Kępień
e0221f2d25 Check for test interfaces before running system tests
Prevent runall.sh and "make test" from even attempting to run system
tests when "ifconfig.sh up" has not been run beforehand.  This ensures
the user is not flooded with error messages in such a case.
2018-02-26 14:12:48 +01:00
Michał Kępień
857a40c87b Fix MX checks for dynamic updates
The check_mx() function in lib/ns/update.c incorrectly tests whether the
DNS_RDATA_CHECKMX/DNS_RDATA_CHECKMXFAIL flags are set for each applied
MX record update as these flags are never set in code paths related to
dynamic updates; they can only be set when loading a zone from a master
file (DNS_ZONEOPT_CHECKMX -> DNS_MASTER_CHECKMX -> DNS_RDATA_CHECKMX).
This flaw allows MX records containing IP addresses to be added to a
zone even when "check-mx fail;" is used.

Ensure correct behavior by modifying the relevant tests in check_mx() so
that they use DNS_ZONEOPT_CHECKMX/DNS_ZONEOPT_CHECKMXFAIL instead.
2018-02-26 13:10:45 +01:00
Evan Hunt
67a8b5ec17 wait for synchronization; re-notify slave if the transfer doesn't happen 2018-02-25 22:18:30 -08:00
Mark Andrews
0dfcb9beaa Merge branch '51-fix-cppcheck-detected-source-code-errors' into 'master'
Resolve "Fix cppcheck-detected source code errors"

Closes #51

See merge request isc-projects/bind9!46
2018-02-25 18:37:16 -05:00
Evan Hunt
54e010d51e fixed an upforwd test error. 2018-02-25 13:43:14 -08:00
Evan Hunt
ab0fe63f07 minor cleanup and addressed a sprintf format warning 2018-02-24 17:56:17 -08:00
Mark Andrews
b71a1386ed remove deadcode 2018-02-24 17:50:41 -08:00
Mark Andrews
f2c22662cc remove unused struct dst_context declaration 2018-02-24 17:50:08 -08:00
Evan Hunt
4c753f5880 Merge branch 'tidy-runall.sh-environment-variables' into 'master'
Tidy runall.sh environment variables

See merge request isc-projects/bind9!18
2018-02-24 15:43:22 -05:00
Evan Hunt
7d29f7e94b CHANGES, doc 2018-02-24 11:02:03 -08:00
Evan Hunt
05a91e4e4c list servers that time out in dig +nssearch 2018-02-24 10:56:09 -08:00
Evan Hunt
0d784de16a more CI speedup experiments
- turn off some of the build tests
- increase test threads to 8
- build with --disable-static
- suppress the non-system tests under bin/tests (timers, task, etc)
2018-02-23 18:04:02 -08:00
Evan Hunt
5d7d6881a1 improve reliability of xfer test 2018-02-23 16:52:34 -08:00
Evan Hunt
749df056be improve dyndb test resilience
- no longer grep for specific line numbers when checking
  parameter logging, as those can change
- report the failure immediatey if parameter check fails
2018-02-23 10:15:15 -08:00
Michał Kępień
b20ff30a79 Fix dyndb system test after copyright information update 2018-02-23 13:55:05 +01:00
Ondřej Surý
843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Ondřej Surý
996f5154f0 Revert removal of bin/tests/system/common/controls.conf, it's still needed 2018-02-23 10:08:37 +01:00
Ondřej Surý
ab1b02d274 Update copyright information after !59 merge. 2018-02-23 09:02:49 +01:00
Evan Hunt
0c559199bf final cleanup
- add CHANGES note
- update copyrights and license headers
- add -j to the make commands in .gitlab-ci.yml to take
  advantage of parallelization in the gitlab CI process
2018-02-22 22:58:15 -08:00
Evan Hunt
b9246ce773 improve reliability of the xfer test on slow systems
- lengthed the wait loop for the transfers to complete
2018-02-22 22:08:02 -08:00
Evan Hunt
474b10a133 remove v6synth
- this was a test for the allow-v6-synthesis option, which was
  deprecated and no longer works. the test was removed
  from conf.sh.in long ago.
2018-02-22 15:29:02 -08:00
Evan Hunt
731ad28be2 removed some unnecessary greps 2018-02-22 15:29:02 -08:00
Evan Hunt
56e440f65f reorder tests to get better use of parallelism 2018-02-22 15:29:02 -08:00
Evan Hunt
c032c54dda parallelize most system tests 2018-02-22 15:29:02 -08:00
Evan Hunt
1cb250c37c Added a release note, plus minor cleanups. 2018-02-22 13:38:51 -08:00
Ondřej Surý
c2c1e2531b Remove libseccomp based system-call filtering. 2018-02-22 13:41:06 +01:00
Mark Andrews
b98a92071d perform rpz testing with a loop rather that recursion 2018-02-22 14:01:42 +11:00
Mark Andrews
05f9deba0b use symbolic test modes native/dnsrps 2018-02-22 14:01:42 +11:00
Mark Andrews
034450ba02 add test numbers as use them in file names 2018-02-22 14:01:42 +11:00
Mark Andrews
146c16c06e check that sed selects a non zero range of lines 2018-02-22 11:30:07 +11:00
Michał Kępień
d989d20fe5 Preserve values of environment variables which are already set
This enables the environment variables controlling run.sh behavior to be
permanently set in a working environment (e.g. to automatically force
colored output without using "-c" in each runall.sh invocation).

Relevant runall.sh command line arguments still have a higher priority.
2018-02-21 14:59:38 +01:00
Michał Kępień
a324031a82 Allow forcing colored system test output
As parallel.mk and runsequential.sh both pipe system test output through
"tee" (for the purpose of creating test.output), run.sh invoked from
these two files detects it is not writing to a terminal, which prevents
colored output from being generated.  Allow forcing colored output using
a new command line argument for runall.sh, "-c", which sets an
environment variable (SYSTEMTEST_FORCE_COLOR) causing conf.sh to
unconditionally enable colored output.

The same environment variable can also be used directly to force colored
output when using "make test" instead of runall.sh.
2018-02-21 14:59:35 +01:00
Michał Kępień
3862043879 Allow retaining system test output using an environment variable
Instead of exporting an environment variable containing a command line
argument (NOCLEAN="-n"), extend run.sh to handle a "boolean" environment
variable (SYSTEMTEST_NO_CLEAN) itself.  The former method is buggy
because the value of NOCLEAN is set in parallel.mk when that file is
first created, but it is not subsequently updated upon each test run
(because make considers parallel.mk to be up to date).

To retain backward compatibility, the "-n" command line argument for
run.sh is still supported (and has a higher priority than the relevant
environment variable).

The SYSTEMTEST_NO_CLEAN environment variable can also be used directly
to prevent cleanup when using "make test" instead of runall.sh.

Apart from fixing a bug, this simplifies the way runall.sh controls
run.sh behavior due to the Makefile being bypassed.  Direct processing
of environment variables in run.sh is more scalable in the long run,
given that the previously utilized technique, even with its
implementation fixed, would still require Makefile.in to be modified in
two places each time a new flag needed to be passed from runall.sh to
run.sh.
2018-02-21 14:59:33 +01:00
Mark Andrews
643c8c27ff Merge branch '67-stabilize-cacheclean-system-test' into 'master'
Stabilize cacheclean system test

Closes #67

See merge request isc-projects/bind9!43
2018-02-20 16:01:00 -05:00
Stephen Morris
9f4c778f69 Merge branch 'rt46602' into 'master'
Allow parallel run of system tests

See merge request isc-projects/bind9!7
2018-02-20 09:00:59 -05:00
Michał Kępień
ca1049b2f3 Improve the way cache contents are searched for "ns.flushtest.example"
During the "check flushtree clears adb correctly" check, expecting
"ns.flushtest.example" to always be the first name in the ADB dump is
fragile, because in a certain corner case "a.root-servers.nil" will be
the first name instead.

As the purpose of the relevant check is to ensure "ns.flushtest.example"
is removed from ADB by "rndc flushtree flushtest.example", search the
entire list of names present in ADB instead of just the first entry when
looking for "ns.flushtest.example".
2018-02-20 13:59:29 +01:00
Michał Kępień
2bbff06d36 Wait until a cache dump completes instead of waiting for a fixed amount of time
Dumping the cache is an asynchronous operation, so sleeping for a fixed
amount of time after running "rndc dumpdb" is imperfect as dumping cache
contents may take longer than expected on slower machines.  Instead of
always sleeping for 1 second, wait until the "; Dump complete" line
appears in the dump or 10 seconds pass, whichever comes first.
2018-02-20 13:59:28 +01:00
Michał Kępień
aeea1faf01 Do not overwrite cache dumps
Unless configured otherwise in named.conf, "rndc dumpdb" causes a cache
dump to be written to a file called "named_dump.db" in the working
directory of the given named instance.  Repeatedly using this command
throughout different checks in the cacheclean system test causes cache
dumps for older checks to be overwritten, which hinders failure
diagnosis.  Prevent this by moving each cache dump to a check-specific
location after running "rndc dumpdb".

Furthermore, during the "check flushtree clears adb correctly" check,
dump_cache() is called twice without renaming the resulting files.
Prevent the first cache dump from being overwritten by moving it to a
different file before calling "rndc dumpdb" for the second time.
2018-02-20 13:59:27 +01:00
Michał Kępień
01de79b332 Assign an index to each check in the cacheclean system test
This will enable storing per-check forensic data, which facilitates
troubleshooting test failures.
2018-02-20 13:59:25 +01:00
Tinderbox User
72326f7701 update copyright notice / whitespace 2018-02-18 23:47:45 +00:00
Stephen Morris
7bb9a97904 [rt46602] Changes to get tests running on Windows
1. Track changes to conf.sh.in in conf.sh.win32
2. Modifications to prevent Windows "Configure" script replacing
   the sed "@PORT@" substitution tokens in conf.sh.win32.
3. runall.sh now runs Windows tests sequentially
2018-02-16 16:14:41 +00:00
Stephen Morris
7222c9fc76 [rt46602] Miscellaneous changes to fix rebase issues 2018-02-16 16:14:41 +00:00
Stephen Morris
30cd931a0d [rt46602] Change name of shell variable holding current test directory
It was TESTNAME, but this is an obvious name and was used in one of
the system tests, something that interfered with the content of
progress messages.  It is now SYSTESTDIR.
2018-02-16 16:14:40 +00:00
Michał Kępień
2c519531a7 [rt46602] Export environment variables in a portable manner 2018-02-16 16:14:40 +00:00
Michał Kępień
e005fb948d [rt46602] Sanitize test names to fix "make check" on Solaris 2018-02-16 16:14:40 +00:00
Stephen Morris
3dfb7c17eb [rt46602] Add .gitignore file for catz 2018-02-16 16:14:40 +00:00
Stephen Morris
59d88ee192 [rt46602] Pass noclean option to Makefile via exported variable 2018-02-16 16:09:49 +00:00
Stephen Morris
23dfa27a84 [rt46602] Mention conf.sh.win32 in instructions for adding a test. 2018-02-16 16:09:49 +00:00
Michał Kępień
f0721de624 [rt46602] Fix various typos, formatting issues and stylistic nits 2018-02-16 16:09:49 +00:00
Michał Kępień
42cf18d239 [rt46602] Remove redundant variable assignment 2018-02-16 16:09:49 +00:00
Michał Kępień
1ac4c3e4e5 [rt46602] named.port is no longer created by setup.sh for allow_query 2018-02-16 16:09:49 +00:00
Michał Kępień
fe1ccafc34 [rt46602] Consistently print usage for runall.sh to stderr 2018-02-16 16:09:49 +00:00
Michał Kępień
0dcee1cad3 [rt46602] Clean up getopts usage
Ensure case clauses are in sync with the string passed to getopts.
Remove catch-all clauses as they will never be evaluated.
2018-02-16 16:09:49 +00:00
Michał Kępień
fe51c34df3 [rt46602] Assign default values to variables set by command line options and consistently treat them as integers 2018-02-16 16:09:49 +00:00
Michał Kępień
1960de5530 [rt46602] named.port cannot be ignored by git because it is required to be present by notify/ns4 2018-02-16 16:09:49 +00:00
Michał Kępień
344d05063f [rt46602] Re-add clean.sh invocation to catz/setup.sh
Commit 57aa7b60fd caused catz/setup.sh to no longer call clean.sh, which
results in the catz system test failing on subsequent runs if the first
run is interrupted or fails.
2018-02-16 16:09:49 +00:00
Stephen Morris
451b7309ca [rt46602] Remove option to format the printed start time of a test
There was too much incompatibility between operating systems as to
the allowed options for "date".
2018-02-16 16:09:49 +00:00
Stephen Morris
462766cd76 [rt46602] Escape line ends in shell script variable assignment
Escape the line ends in a multi-line variable assignment.  Under some
circumstances, substituting the variable caused syntax errors when
used as the list of values in a shell script "for" statement.
2018-02-16 16:09:49 +00:00
Stephen Morris
fb78f82ba1 [rt46602] Fix EXTRAPORT substitutions in copy_setport
Fix problems where all EXTRAPORT macros were being replaced by
the EXTRAPORT1 value. (Copy and paste issue.)
2018-02-16 16:09:49 +00:00
Stephen Morris
cdf18a5009 [rt46602] Minor documentation changes 2018-02-16 16:09:49 +00:00
Stephen Morris
7f2d41d4c4 [rt46602] Correct way allow_query test produces RNDC output 2018-02-16 16:09:49 +00:00
Stephen Morris
0855a8a6cc [rt46602] Simplify the cleanup code 2018-02-16 16:09:48 +00:00
Stephen Morris
f606b17dfb [rt46602] Extensions to README
Added descriptions of how nameservers are started and stopped
during the tests, and how the framework cleans up the files created.
2018-02-16 16:09:31 +00:00
Stephen Morris
b88b508b22 [rt46602] Miscellenous small changes 2018-02-16 15:19:44 +00:00
Stephen Morris
1f07c69f25 [rt46602] Handle echoing of multi-line output from tests 2018-02-16 15:19:44 +00:00
Stephen Morris
c12e06755f [rt46602] Rename "test" variable to "systest"
... to avoid confusion between the variable and the command of the
same name.
2018-02-16 15:19:44 +00:00
Stephen Morris
00bc29640b [rt46602] Add ability to prevent deletion of output files when running all tests
Some tests may need to examine all output files from all system tests.
Allow the deletion of these files to be inhibited if required.
2018-02-16 15:19:44 +00:00
Stephen Morris
244d1c30e2 [rt46602] Error messages before start of test are output to stderr
Error messages concerning the invocation of run.sh are output to
stderr.  Messages after the test has started are output to stdout.
2018-02-16 15:19:44 +00:00
Stephen Morris
a5cf6bd12a [rt46602] Ensure that output sent to stderr is routed to the output file 2018-02-16 15:19:44 +00:00
Stephen Morris
ce66752adc [rt46602] Minor tidying up of documentation 2018-02-16 15:19:44 +00:00
Stephen Morris
549a6c6bc8 [rt46602] Check prerequsities before network interfaces when running test. 2018-02-16 15:19:44 +00:00
Stephen Morris
f0f5b5f045 [rt46602] Minor formatting changes to Perl files 2018-02-16 15:19:44 +00:00
Stephen Morris
c344e1d768 [rt46603] Provide echostart() and echoend() to output test start/end messages. 2018-02-16 15:19:44 +00:00
Stephen Morris
055e5be9fd [rt46602] Ensure test output in systests.output is not mixed up
When running all the system tests, output from a test is sent to a
test.output file in the test directory.  These are combined in to
systests.output when the run finishes.
2018-02-16 15:19:44 +00:00
Stephen Morris
3c25e5fa02 [rt46602] Miscellaneous minor fixes
... for misspellings, typos, trailing spaces, duplicated lines etc.
2018-02-16 15:19:43 +00:00
Stephen Morris
edc7a18d84 [rt46602] Allocate 100 ports to each test 2018-02-16 15:19:43 +00:00
Stephen Morris
f5d8f07900 [rt46602] Pass port numbers to tests via environment variables 2018-02-16 15:19:43 +00:00
Stephen Morris
b2d90da0c2 [rt46602] Ensure parallel tests are in alphabetical order 2018-02-16 15:19:43 +00:00
Stephen Morris
af005cdbcf [rt46602] Expanded system tests README
Add more information on running the tests, together with a section
on how the tests are organised, aimed at new developers.
2018-02-16 15:19:43 +00:00
Stephen Morris
b24c2e11d8 [rt46602] More updates to the test running framework
Tidy up the stop/start files and make switch usage consistent. Also
tidy up the various "clean" targets in the Makefile.
2018-02-16 14:57:52 +00:00
Stephen Morris
517d990bd4 [rt46602] Modify some test files to cope with the "-p" flag 2018-02-16 14:57:51 +00:00
Stephen Morris
32fe6f7682 [rt46602] Tidy up run management
Miscellaneous tidying up of run management.  The most significant
change is that "runall.sh" now runs _all_ the tests, even the
ones that can run in parallel.  runsequential.sh is the script
to run tests that have not been converted to parallel running.
2018-02-16 14:57:51 +00:00
Stephen Morris
e0ff77f9d3 [rt46602] Assign block of ports for each test
Some tests use more ports than just the query and control ports.
Each test that can run in parallel with other tests is now assigned
a unique block of 10 ports.
2018-02-16 14:57:51 +00:00
Stephen Morris
07341693e1 [rt46602] Allow catz system test to run in parallel with other tests 2018-02-16 14:57:51 +00:00
Stephen Morris
78f2b9ca01 [rt46602] Miscellaneous changes to existing parallelised tests
Currently these tests are allow_query, rpzrecurse and serve-stale

1. Function to copy files and set port numbers renamed from copy_config
to copy_setports, as this is used to change the ports in Perl and Python
test scripts as well.
2. Changes to rpzrecurse/tests.sh to handle two calls to getopts (one to
parse port numbers, the other to parse rpzrecurse-specific options). Also
fixed various commands to use correct ports.
3. Updates to "clean.sh" scripts to ensure that all files created in the
test are removed.
2018-02-16 14:57:51 +00:00
Stephen Morris
e7429b124b [rt46602] Ensure that tests running in parallel use unique ports
Via an intermediate make file, tests that have been modified to be able
to run in parallel are assigned unique query and control port numbers
(other than 5300 and 9953 respectively).  Tests that have not yet been
modified all use ports 5300 and 9953, so must be run sequentially.
2018-02-16 14:57:51 +00:00
Stephen Morris
e1a69e5d1f [rt46602] Miscellaneous tidying up of code cherry-picked from experimental branch 2018-02-16 14:57:51 +00:00
Ondřej Surý
3b14d54fd7 [rt46602] Allow parallel run of new dynamic port tests and the old ones 2018-02-16 14:57:51 +00:00
Ondřej Surý
caaec1ef6d [rt46602] Put back original .gitignore files in the system tests 2018-02-16 14:57:51 +00:00
Ondřej Surý
2a435708e4 [rt46602] Adjust rpzrecurse for dynamic port usage
Resolve conflict in run.sh during cherry-pick from an experimental branch.
2018-02-16 14:57:51 +00:00
Ondřej Surý
e6802badc0 [rt46602] Add $SEDPORTS variable to help with @PORT@ and @CONTROLPORT@ replacement 2018-02-16 14:57:51 +00:00
Ondřej Surý
d2c8286163 [rt46602] Move most of ignored files to top of system tests directory 2018-02-16 14:57:51 +00:00
Ondřej Surý
53bade5ece [rt46602] Fix output from rndc reload 2018-02-16 14:57:51 +00:00
Ondřej Surý
bc276f6c05 [rt46602] Add .gitignore to allow_query 2018-02-16 14:57:51 +00:00
Ondřej Surý
7e3c96c867 [rt46602] Utilize echo_i to allow mixed test output 2018-02-16 14:57:51 +00:00
Ondřej Surý
278c72fef6 [rt46602] Prefix R:<result> as R:<test>:<result>
Resolve conflict in run.sh during cherry-pick from experimental branch.
2018-02-16 14:57:50 +00:00
Ondřej Surý
f7ac41757a [rt46602] Add echo_i function to print I:<testname>:string 2018-02-16 14:57:50 +00:00
Ondřej Surý
cba162e70e [rt46602] Add serve-stale working files to .gitignore 2018-02-16 14:57:50 +00:00
Ondřej Surý
992a2bafec [rt46602] Convert allow_query to dynamic port 2018-02-16 14:57:50 +00:00