From: Pablo Neira Ayuso Date: Mon, 14 Sep 2020 19:10:13 +0000 (+0200) Subject: tests: py: flush log file output before running each command X-Git-Tag: v0.9.7~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09ed19a81af877b52d00ee30806e7b49c5e250dc;p=thirdparty%2Fnftables.git 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 --- 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)