Commit df1c5d52 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

Merge #2624

Get rid of the shell/perl-based system tests
parents 0eb1e505 7a8781d9
......@@ -115,11 +115,6 @@ cppcheck:
--template '{file}:{line}: check_fail: {message} ({severity},{id})' \
src
# system tests
systest:
cd tests/system; \
sh $(abs_srcdir)/tests/system/runall.sh
### include tool to generate documentation from log message specifications
### in the distributed tarball:
EXTRA_DIST = tools/system_messages.py
......
......@@ -1305,7 +1305,6 @@ AC_CONFIG_FILES([Makefile
src/lib/statistics/Makefile
src/lib/statistics/tests/Makefile
tests/Makefile
tests/system/Makefile
tests/tools/Makefile
tests/tools/badpacket/Makefile
tests/tools/badpacket/tests/Makefile
......@@ -1389,23 +1388,6 @@ AC_OUTPUT([doc/version.ent
src/lib/util/python/gen_wiredata.py
src/lib/server_common/tests/data_path.h
tests/lettuce/setup_intree_bind10.sh
tests/system/conf.sh
tests/system/run.sh
tests/system/glue/setup.sh
tests/system/glue/nsx1/b10-config.db
tests/system/bindctl/nsx1/b10-config.db.template
tests/system/ixfr/db.example.n0
tests/system/ixfr/db.example.n2
tests/system/ixfr/db.example.n2.refresh
tests/system/ixfr/db.example.n4
tests/system/ixfr/db.example.n6
tests/system/ixfr/ixfr_init.sh
tests/system/ixfr/b10-config.db
tests/system/ixfr/common_tests.sh
tests/system/ixfr/in-1/setup.sh
tests/system/ixfr/in-2/setup.sh
tests/system/ixfr/in-3/setup.sh
tests/system/ixfr/in-4/setup.sh
], [
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
chmod +x src/bin/xfrin/run_b10-xfrin.sh
......@@ -1436,14 +1418,6 @@ AC_OUTPUT([doc/version.ent
chmod +x src/lib/util/python/mkpywrapper.py
chmod +x src/lib/util/python/gen_wiredata.py
chmod +x src/lib/python/isc/log/tests/log_console.py
chmod +x tests/system/conf.sh
chmod +x tests/system/run.sh
chmod +x tests/system/ixfr/ixfr_init.sh
chmod +x tests/system/ixfr/common_tests.sh
chmod +x tests/system/ixfr/in-1/setup.sh
chmod +x tests/system/ixfr/in-2/setup.sh
chmod +x tests/system/ixfr/in-3/setup.sh
chmod +x tests/system/ixfr/in-4/setup.sh
])
AC_OUTPUT
......
SUBDIRS = system tools
SUBDIRS = tools
{
"version": 3,
"Logging": {
"loggers": [{
"severity": "DEBUG",
"name": "*",
"debuglevel": 99
}]
},
"Auth": {
"listen_on": [{
"port": 47806,
"address": "127.0.0.1"
}]
},
"data_sources": {
"classes": {
"IN": [
{
"type": "sqlite3",
"params": {
"database_file": "data/glue.sqlite3"
}
}
]
}
},
"Init": {
"components": {
"b10-auth": { "kind": "needed", "special": "auth" },
"b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
}
}
}
{
"version": 3,
"Logging": {
"loggers": [ {
"debuglevel": 99,
"severity": "DEBUG",
"name": "*"
} ]
},
"Auth": {
"database_file": "data/xfrin-diffs.sqlite3",
"listen_on": [ {
"address": "::1",
"port": 47807
} ]
},
"data_sources": {
"classes": {
"IN": [{
"type": "sqlite3",
"params": {
"database_file": "data/xfrin-diffs.sqlite3"
}
}]
}
},
"Xfrout": {
"zone_config": [ {
"origin": "example."
} ],
"also_notify": [ {
"address": "::1",
"port": 47806
} ]
},
"Stats": {
"poll-interval": 1
},
"Init": {
"components": {
"b10-auth": { "kind": "needed", "special": "auth" },
"b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
"b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
"b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
}
}
}
{"version": 2,
"Xfrin": {
"zones": [{
"master_addr": "10.53.0.1",
"master_port": 53210,
"name": "example.",
"use_ixfr": true
}]
{
"version": 3,
"Logging": {
"loggers": [ {
"debuglevel": 99,
"severity": "DEBUG",
"name": "*"
} ]
},
"Auth": {
"listen_on": [{
"address": "10.53.0.2",
"port": 53210
}],
"database_file": "@abs_builddir@/zone.sqlite3"
"database_file": "data/xfrin-before-diffs.sqlite3",
"listen_on": [ {
"address": "::1",
"port": 47806
} ]
},
"Xfrin": {
"zones": [ {
"name": "example",
"master_addr": "::1",
"master_port": 47807,
"use_ixfr": true
} ]
},
"data_sources": {
"classes": {
"IN": [{
"type": "sqlite3",
"params": {
"database_file": "@abs_builddir@/zone.sqlite3"
"database_file": "data/xfrin-before-diffs.sqlite3"
}
}]
}
},
"Logging": {
"loggers": [{
"name": "*",
"severity": "DEBUG",
"output_options": [],
"debuglevel": 99
}]
},
"Zonemgr": {
"secondary_zones": [{
"name": "example.",
"class": "IN"
}]
},
"Init": {
"components": {
"b10-auth": {"kind": "needed", "special": "auth" },
"b10-auth": { "kind": "needed", "special": "auth" },
"b10-xfrin": { "address": "Xfrin", "kind": "dispensable" },
"b10-xfrout": { "address": "Xfrout", "kind": "dispensable" },
"b10-zonemgr": { "address": "Zonemgr", "kind": "dispensable" },
"b10-stats": { "address": "Stats", "kind": "dispensable" },
"b10-cmdctl": { "special": "cmdctl", "kind": "needed" }
}
}
......
......@@ -3,6 +3,51 @@ Feature: Querying feature
for instance whether multiple queries in a row return consistent
answers.
Scenario: Glue
# Check the auth server returns the correct glue when asked for it.
Given I have bind10 running with configuration glue.config
And wait for bind10 stderr message BIND10_STARTED_CC
And wait for bind10 stderr message CMDCTL_STARTED
And wait for bind10 stderr message AUTH_SERVER_STARTED
# This query should result in a delegation with two NS; one in the
# delegated zone and one in a so called out-of-bailiwick zone for which
# the auth server has authority, too. For the former, the server
# should return glue in the parent zone. For the latter, BIND 9 and
# BIND 10 behave differently; BIND 9 uses "glue" in the parent zone
# (since this is the root zone everything can be considered a valid
# glue). BIND 10 (using sqlite3 data source) searches the other zone
# and uses the authoritative data in that zone (which is intentionally
# different from the glue in the root zone).
A query for foo.bar.example type A should have rcode NOERROR
The answer section of the last query response should be
"""
"""
The authority section of the last query response should be
"""
example. 172800 IN NS NS1.example.COM.
example. 172800 IN NS NS.example.
"""
The additional section of the last query response should be
"""
NS.example. 172800 IN A 192.0.2.1
NS.example. 172800 IN A 192.0.2.2
NS1.example.COM. 172800 IN A 192.0.2.3
"""
# Test we don't get out-of-zone glue
A query for example.net type A should have rcode NOERROR
The answer section of the last query response should be
"""
"""
The authority section of the last query response should be
"""
example.net. 300 IN NS ns2.example.info.
example.net. 300 IN NS ns1.example.info.
"""
The additional section of the last query response should be
"""
"""
Scenario: Repeated queries
Given I have bind10 running with configuration example.org.inmem.config
And wait for bind10 stderr message BIND10_STARTED_CC
......
......@@ -70,6 +70,8 @@ copylist = [
"configurations/xfrin/retransfer_slave.conf"],
["data/inmem-xfrin.sqlite3.orig",
"data/inmem-xfrin.sqlite3"],
["data/xfrin-before-diffs.sqlite3.orig",
"data/xfrin-before-diffs.sqlite3"],
["data/xfrin-notify.sqlite3.orig",
"data/xfrin-notify.sqlite3"],
["data/ddns/example.org.sqlite3.orig",
......
......@@ -144,3 +144,45 @@ Feature: Xfrin
# FIXME: This step fails. Probably an empty zone is created in the data
# source :-|. This should be REFUSED, not SERVFAIL.
A query for www.example.org to [::1]:47806 should have rcode SERVFAIL
# TODO:
# * IXFR - generate an sqlite db that contains the journal. Check it was
# IXFR by logs.
# * IXFR->AXFR fallback if IXFR is not available (even rejected or
# something, not just the differences missing).
# * Retransfer with short refresh time (without notify).
Scenario: With differences
# We transfer from one bind10 to other, just like in the Retransfer command
# scenario. Just this time, the master contains the differences table
# and the slave has a previous version of the zone, so we use the IXFR.
Given I have bind10 running with configuration xfrin/retransfer_master_diffs.conf with cmdctl port 47804 as master
And wait for master stderr message BIND10_STARTED_CC
And wait for master stderr message CMDCTL_STARTED
And wait for master stderr message AUTH_SERVER_STARTED
And wait for master stderr message XFROUT_STARTED
And wait for master stderr message ZONEMGR_STARTED
And I have bind10 running with configuration xfrin/retransfer_slave_diffs.conf
And wait for bind10 stderr message BIND10_STARTED_CC
And wait for bind10 stderr message CMDCTL_STARTED
And wait for bind10 stderr message AUTH_SERVER_STARTED
And wait for bind10 stderr message XFRIN_STARTED
And wait for bind10 stderr message ZONEMGR_STARTED
A query for example. type SOA to [::1]:47806 should have rcode NOERROR
The answer section of the last query response should be
"""
example. 3600 IN SOA ns1.example. hostmaster.example. 94 3600 900 7200 300
"""
When I send bind10 the command Xfrin retransfer example. IN ::1 47807
Then wait for new bind10 stderr message XFRIN_GOT_INCREMENTAL_RESP
Then wait for new bind10 stderr message XFRIN_IXFR_TRANSFER_SUCCESS not XFRIN_XFR_PROCESS_FAILURE
Then wait for new bind10 stderr message ZONEMGR_RECEIVE_XFRIN_SUCCESS
A query for example. type SOA to [::1]:47806 should have rcode NOERROR
The answer section of the last query response should be
"""
example. 3600 IN SOA ns1.example. hostmaster.example. 100 3600 900 7200 300
"""
systest:
sh $(srcdir)/runall.sh
distclean-local:
sh $(srcdir)/cleanall.sh
# Most of the files under this directory (including test subdirectories)
# must be listed in EXTRA_DIST.
EXTRA_DIST = README cleanall.sh ifconfig.sh start.pl stop.pl runall.sh
EXTRA_DIST += common/default_user.csv
EXTRA_DIST += glue/auth.good glue/example.good glue/noglue.good glue/test.good
EXTRA_DIST += glue/tests.sh glue/clean.sh
EXTRA_DIST += glue/nsx1/com.db glue/nsx1/net.db glue/nsx1/root-servers.nil.db
EXTRA_DIST += glue/nsx1/root.db
EXTRA_DIST += bindctl/tests.sh bindctl/clean.sh bindctl/setup.sh
EXTRA_DIST += bindctl/nsx1/root.db bindctl/nsx1/example-normalized.db
Copyright (C) 2004, 2010, 2011 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 2000, 2001 Internet Software Consortium.
See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
This is a simple test environment for running BIND 10 system tests
involving multiple name servers. It was originally developed for BIND
9, and has been ported to test BIND 10 implementations. Ideally we
should share the same framework for both versions, so some part of the
original setup are kept, even though they are BIND 9 specific and not
currently used.
Also, these tests generally rely on BIND 9 programs, most commonly
its dig, and will sometimes be its name server (named). So, the test
environment assumes that there's a source tree of BIND 9 where its
programs are built, and that an environment variable "BIND9_TOP" is set
to point to the top directory of the source tree.
There are multiple test suites, each in a separate subdirectory and
involving a different DNS setup. They are:
bindctl/ Some basic management operations using the bindctl tool
glue/ Glue handling tests
ixfr/ Incremental transfer tests
(the following tests are planned to be added soon)
dnssec/ DNSSEC tests
masterfile/ Master file parser
axfr/ Full-transfer tests
Typically each test suite sets up 2-5 instances of BIND 10 (or BIND 9
named) and then performs one or more tests against them. Within the test
suite subdirectory, each instance has a separate subdirectory containing
its configuration data. By convention, these subdirectories are named
"nsx1", "nsx2", etc for BIND 10 ("x" means BIND 10), and "ns1", "ns2",
etc. for BIND 9.
The tests are completely self-contained and do not require access to
the real DNS. Generally, one of the test servers (ns[x]1) is set up as
a root name server and is listed in the hints file of the others.
To enable all servers to run on the same machine, they bind to separate
virtual IP address on the loopback interface. ns[x]1 runs on 10.53.0.1,
ns[x]2 on 10.53.0.2, etc. Before running any tests, you must set up
these addresses by running "ifconfig.sh up" as root.
Mac OS X:
If you wish to make the interfaces survive across reboots copy
org.isc.bind.system and org.isc.bind.system to /Library/LaunchDaemons
then run "launchctl load /Library/LaunchDaemons/org.isc.bind.system.plist"
as root.
The servers use port 53210 instead of the usual port 53, so they can be
run without root privileges once the interfaces have been set up.
The tests can be run individually like this:
sh run.sh xfer
sh run.sh glue
etc.
To run all the tests, just type "make systest" either on this directory
or on the top source directory. Note: currently these tests cannot be
run when built under a separate build directory. Everything must be
run within the original source tree.
#!/bin/sh
#
# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000, 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
rm -f */b10-config.db
rm -f dig.out.* bindctl.out.*
rm -f */msgq_socket */zone.sqlite3
/b10-config.db.template
/bind10.run
/bindctl.out
{"version": 2,
"Auth": {
"listen_on": [{"address": "10.53.0.1", "port": 53210}],
"database_file": "@abs_builddir@/zone.sqlite3"
},
"data_sources": {
"classes": {
"IN": [{
"type": "sqlite3",
"params": {
"database_file": "@abs_builddir@/zone.sqlite3"
}
}]
}
},
"Logging": {
"loggers": [
{
"name": "*",
"severity": "DEBUG",
"output_options": [],
"debuglevel": 99
}
]
},
"Stats": {
"poll-interval": 1
}
}
com. 300 IN SOA postmaster.example. ns.example.com. 2000042100 600 600 1200 600
com. 300 IN NS ns.example.com.
ns.example.com. 300 IN A 192.0.2.2
; Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
; Copyright (C) 2000, 2001 Internet Software Consortium.
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
$TTL 300
. IN SOA postmaster.example. a.root.servers.nil. (
2000042100 ; serial
600 ; refresh
600 ; retry
1200 ; expire
600 ; minimum
)
. NS ns.example.com.
ns.example.com. A 192.0.2.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment