]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: py: flush log file output before running each command
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 14 Sep 2020 19:10:13 +0000 (21:10 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 14 Sep 2020 20:14:45 +0000 (22:14 +0200)
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>
tests/py/nft-test.py

index df97ed8eefb7b45aa72fe76c12faf714a0078cba..e7b5e01efcb96084d654e496f58cd0364a8d6e21 100755 (executable)
@@ -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)