From: Yu Watanabe Date: Thu, 27 Jan 2022 22:29:32 +0000 (+0900) Subject: test-network: wait for a while if manual policy is always-{up,down} X-Git-Tag: v251-rc1~436^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F22277%2Fhead;p=thirdparty%2Fsystemd.git test-network: wait for a while if manual policy is always-{up,down} If wait_operstate() is called super quickly after ip command, then the up/down state may not be changed and propagated to networkd, and wait_operstate() mistakenly pass with the previous state. To avoid such situation, wait for a while to make networkd actually detect the interface brought up/down. --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index c53092562a5..ba161703935 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -3101,6 +3101,8 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): check_output('ip link set dev test1 down') expect_up = initial_up if always else next_up next_up = not next_up + if always: + time.sleep(1) def test_activation_policy(self): for test in ['up', 'always-up', 'manual', 'always-down', 'down', '']: