From: Yu Watanabe Date: Mon, 3 Jun 2024 08:43:43 +0000 (+0900) Subject: test-network: flush stream buffer and journals before/after running test X-Git-Tag: v256-rc4~26^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fec5982900efb4fcd5a6f8eca68e274f557442d;p=thirdparty%2Fsystemd.git test-network: flush stream buffer and journals before/after running test --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index b294621de98..64fb5fce13e 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -923,7 +923,11 @@ def udevadm_trigger(*args, action='add'): udevadm('trigger', '--settle', f'--action={action}', *args) def setup_common(): + # We usually show something in each test. So, let's break line to make the title of a test and output + # from the test mixed. Then, flush stream buffer and journals. print() + sys.stdout.flush() + check_output('journalctl --sync') def tear_down_common(): # 1. stop DHCP/RA servers @@ -956,6 +960,10 @@ def tear_down_common(): flush_routing_policy_rules() flush_routes() + # 8. flush stream buffer and journals to make not any output from the test with the next one + sys.stdout.flush() + check_output('journalctl --sync') + def setUpModule(): rm_rf(networkd_ci_temp_dir) cp_r(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'conf'), networkd_ci_temp_dir) @@ -989,6 +997,10 @@ def tearDownModule(): clear_system_units() restore_active_units() + # Flush stream buffer and journals before showing the test summary. + sys.stdout.flush() + check_output('journalctl --sync') + class Utilities(): # pylint: disable=no-member