summaryrefslogtreecommitdiffstats
path: root/tests/py
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-09-14 21:10:13 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-09-14 22:14:45 +0200
commit09ed19a81af877b52d00ee30806e7b49c5e250dc (patch)
tree60ce54cbf6aedb1c9ecfd466f893522b22ef7721 /tests/py
parent371d32c63b892605b2baa6742234f6974ad59dcc (diff)
tests: py: flush log file output before running each command
If nft crashes or hits an assertion, the last command run shows in the /tmp/nftables-test.log file. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py')
-rwxr-xr-xtests/py/nft-test.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index df97ed8e..e7b5e01e 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -1022,6 +1022,8 @@ def execute_cmd(cmd, filename, lineno, stdout_log=False, debug=False):
if debug_option:
print(cmd)
+ log_file.flush()
+
if debug:
debug_old = nftables.get_debug()
nftables.set_debug(debug)