|
|
This page is not up-to-date!
|
|
|
|
|
|
## Required prerequisites
|
|
|
Python >= 3.3
|
|
|
python3-dnspython >= 1.11.1
|
|
|
psutil (sudo pip3 install psutil)
|
|
|
dnssec-signzone
|
|
|
dnssec-keygen
|
|
|
dnssec-verify
|
|
|
lsof
|
|
|
## Highly recommended prerequisites
|
|
|
Knot >= 1.3.0
|
|
|
Bind 9.9.x
|
|
|
valgrind
|
|
|
gdb
|
|
|
|
|
|
## Usage
|
|
|
Functional testing environment is located in **git_knot_project_folder**`/tests-extra/functional`. The most important parts:
|
|
|
|
|
|
* `tests` - test cases are grouped to test directories by their types (AXFR, DDNS, ...). Each test case consists of a test script `test.py` and an optional `data` directory for zone files. Test case names must be simple like python module names (no leading digit).
|
|
|
* `data` - storage for general data (e.g. zones) which are common to more test cases.
|
|
|
* `functests.py` - controlling script.
|
|
|
|
|
|
It is possible to redefine some default parameters via environmet variables:
|
|
|
`KNOT_TEST_GDB` - gdb binary (leave empty value to disable backtrace extraction).
|
|
|
`KNOT_TEST_VGDB` - vgdb binary.
|
|
|
`KNOT_TEST_VALGRIND` - valgrind binary (leave empty value to disable valgrind checking).
|
|
|
`KNOT_TEST_VALGRIND_FLAGS` - valgrind flags.
|
|
|
`KNOT_TEST_KNOT` - Knot binary (leave empty value to skip tests with Knot :scream:).
|
|
|
`KNOT_TEST_KNOTC` - Knot control binary.
|
|
|
`KNOT_TEST_BIND` - Bind binary (leave empty value to skip tests with Bind).
|
|
|
`KNOT_TEST_BINDC` - Bind control binary.
|
|
|
|
|
|
## Syntax:
|
|
|
|
|
|
```
|
|
|
./functests.py [:]test[/case]...
|
|
|
```
|
|
|
|
|
|
By default, all test cases are launched.
|
|
|
|
|
|
- run all tests excluding all **axfr** cases and **dnssec/sign** case: ```./functests.py :axfr :dnssec/sign```
|
|
|
- run just **axfr/interrupt** test case: ```./functests.py axfr/interrupt```
|
|
|
- more information: ```./functests.py -h```
|
|
|
|
|
|
## Console output:
|
|
|
|
|
|
```
|
|
|
./functests.py axfr edns
|
|
|
09:34:48# KNOT TESTING SUITE 2013-10-22
|
|
|
09:34:48# Working directory /tmp/knottest-1382427288-95yfok
|
|
|
09:34:48# Test 'axfr'
|
|
|
09:35:08# * case 'bind_knot': EXCEPTION ([Errno 111] Connection refused)
|
|
|
09:35:29# * case 'interrupt': OK
|
|
|
09:35:47# * case 'knot_bind': OK
|
|
|
09:36:08# * case 'knot_knot': OK
|
|
|
09:36:08# Test 'edns'
|
|
|
09:36:34# * case 'nsid': OK
|
|
|
09:36:42# * case 'payload': OK
|
|
|
09:36:42# TEST CASES: 6, FAILED: 1
|
|
|
```
|
|
|
|
|
|
## Working directory contents
|
|
|
|
|
|
```
|
|
|
/tmp/knottest-1382427288-95yfok
|
|
|
├── axfr # axfr test cases
|
|
|
│ ├── bind_knot # bind_knot test case data/output
|
|
|
│ │ ├── bind1
|
|
|
│ │ │ ├── bind1.conf # Server configuration
|
|
|
│ │ │ ├── bind1.ctlkey # Server configuration
|
|
|
│ │ │ ├── stderr # Server stderr
|
|
|
│ │ │ └── stdout # Server stdout
|
|
|
│ │ ├── case.log # Detailed testing log
|
|
|
│ │ ├── traceback.log # Exception traceback log (if any)
|
|
|
│ │ ├── knot1
|
|
|
│ │ │ ├── knot1.conf
|
|
|
│ │ │ ├── stderr
|
|
|
│ │ │ ├── stdout
|
|
|
│ │ │ ├── wild.diff.db
|
|
|
│ │ │ └── __wild.slave # Slave zone file
|
|
|
│ │ └── zones
|
|
|
│ │ └── wild.zone # Master zone file
|
|
|
│ ├── interrupt
|
|
|
. .
|
|
|
│ └── knot_knot
|
|
|
├── edns
|
|
|
│ ├── nsid
|
|
|
│ │ ├── case.log
|
|
|
│ │ ├── knot1
|
|
|
. . .
|
|
|
└── summary.log # Testing summary - same as stdout
|
|
|
```
|
|
|
|
|
|
|