diff options
author | Thomas Haller <thaller@redhat.com> | 2023-10-16 21:43:08 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2023-10-21 11:58:20 +0200 |
commit | 8cacebc36732fe190a991d512e60e4fcbfc782eb (patch) | |
tree | d1c8f6ac488564229ec47ce1f740d897ef621f26 /tests/shell/testcases/sets/dumps | |
parent | 22fab8681a50014174cdd02ace90f74b9e9eefe9 (diff) |
tests/shell: honor NFT_TEST_VERBOSE_TEST variable to debug tests via `bash -x`
It can be cumbersome to debug why a test fails. Our tests are just shell
scripts, which for the most part don't print much. That is good, but for
debugging, it can be useful to run the test via `bash -x`. Previously,
we would just patch the source file while debugging.
Add an option "-x" and NFT_TEST_VERBOSE_TEST=y environment variable. If set,
"test-wrapper.sh" will check whether the shebang is "#!/bin/bash" and add
"-x" to the command line.
While at it, let test-wrapper.sh also log a line like
Command: $CMD
With this, we see in the log the command that was run, and how
NFT_TEST_VERBOSE_TEST may have affected it. This is anyway useful,
because many tests don't print anything at all, and we end up with an
empty "testout.log". Empty files are cumbersome, e.g. I like to use
`grep -R ^` to show the content of all files, which does not show empty
files. Ensuring that something is always written is desirable.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/testcases/sets/dumps')
0 files changed, 0 insertions, 0 deletions