mirror of
https://git.netfilter.org/nftables
synced 2026-01-28 11:24:07 +00:00
The variable has to undergo word splitting, otherwise the shell tries
to find the variable value as an executable, which breaks in cases that
7c8a44b25c22 ("tests: shell: Allow wrappers to be passed as nft command")
intends to support.
Mention this in the shell tests README.
Fixes: d8ccad2a2b73 ("tests: cover baecd1cf2685 ("segtree: Fix segfault when restoring a huge interval set")")
Signed-off-by: Štěpán Němec <snemec@redhat.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
This test suite is intended to perform tests on a higher level
|
|
than the other regression test suites.
|
|
|
|
It can run arbitrary executables which can perform any test, not
|
|
limited to testing the nft syntax or netlink code (which is what
|
|
the regression tests do).
|
|
|
|
To run the test suite (as root):
|
|
$ cd tests/shell
|
|
# ./run-tests.sh
|
|
|
|
Test files are executable files matching the pattern <<name_N>>,
|
|
where N should be 0 in all new tests. All tests should return 0 on
|
|
success.
|
|
|
|
Since they are located with `find', test files can be put in any
|
|
subdirectory.
|
|
|
|
You can turn on a verbose execution by calling:
|
|
# ./run-tests.sh -v
|
|
|
|
And generate missing dump files with:
|
|
# ./run-tests.sh -g <TESTFILE>
|
|
|
|
Before each test file invocation, `nft flush ruleset' will be called.
|
|
Also, test file process environment will include the variable $NFT
|
|
which contains the nft command being tested.
|
|
|
|
You can pass an arbitrary $NFT value as well:
|
|
# NFT=/usr/local/sbin/nft ./run-tests.sh
|
|
|
|
Note that, to support usage such as NFT='valgrind nft', tests must
|
|
invoke $NFT unquoted.
|
|
|
|
By default, the tests are run with the nft binary at '../../src/nft'
|