diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-05 16:04:24 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-12 04:26:06 +0200 |
commit | 1ef2eedce756a7b1e8400fe9ab2441b16b7263b0 (patch) | |
tree | e832963704eb5af5e5d8c1585abefdd5752fcb28 /test | |
parent | network: make route_configure() return all created routes (diff) | |
download | systemd-1ef2eedce756a7b1e8400fe9ab2441b16b7263b0.tar.xz systemd-1ef2eedce756a7b1e8400fe9ab2441b16b7263b0.zip |
test-network: wait for the intreface is configured if it is expected
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 1e50a75980..cf009ee178 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -2784,20 +2784,16 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): expect_up = initial_up next_up = not expect_up - # if initial expected state is down, must wait for setup_state to reach configuring - # so systemd-networkd considers it 'activated' - setup_state = None if initial_up else 'configuring' - for iteration in range(4): with self.subTest(iteration=iteration, expect_up=expect_up): operstate = 'routable' if expect_up else 'off' + setup_state = 'configured' if expect_up else None self.wait_operstate('test1', operstate, setup_state=setup_state, setup_timeout=20) - setup_state = None if expect_up: self.assertIn('UP', check_output('ip link show test1')) self.assertIn('192.168.10.30/24', check_output('ip address show test1')) - self.assertIn('default via 192.168.10.1', check_output('ip route show')) + self.assertIn('default via 192.168.10.1', check_output('ip route show dev test1')) else: self.assertIn('DOWN', check_output('ip link show test1')) |