summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-06-11 10:41:28 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-06-11 14:52:41 +0200
commit8843726ac27061c993524a9fdecfcecc36f34e1e (patch)
tree22c35c80038e10fdf955123af0e56539eb6af0dd /test
parentman/systemd-soft-reboot.service: upgrade drop-in to unit file for slice (diff)
downloadsystemd-8843726ac27061c993524a9fdecfcecc36f34e1e.tar.xz
systemd-8843726ac27061c993524a9fdecfcecc36f34e1e.zip
test-network: wait a while for addresses to be dropped
Hopefully fixes the following failure: ``` ====================================================================== FAIL: test_ipv6_token_prefixstable (__main__.NetworkdRATests.test_ipv6_token_prefixstable) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/systemd/tests/testdata/test-network/systemd-networkd-tests.py", line 5705, in test_ipv6_token_prefixstable self.assertNotIn('2002:da8:1:0:b47e:7975:fc7a:7d6e/64', output) # the 1st prefixstable ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '2002:da8:1:0:b47e:7975:fc7a:7d6e/64' unexpectedly found in '19: veth99@veth-peer: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000\n inet6 2002:da8:1:0:b47e:7975:fc7a:7d6e/64 scope global tentative dynamic mngtmpaddr noprefixroute \n valid_lft 2100sec preferred_lft 1000sec\n inet6 2002:da8:1:0:da5d:e50a:43fd:5d0f/64 scope global dynamic mngtmpaddr noprefixroute \n valid_lft 2100sec preferred_lft 1000sec\n inet6 fe80::1034:56ff:fe78:9abc/64 scope link proto kernel_ll \n valid_lft forever preferred_lft forever' ---------------------------------------------------------------------- ```
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 848c8eb4bf..92cb07f11c 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -5699,23 +5699,17 @@ class NetworkdRATests(unittest.TestCase, Utilities):
networkctl_reconfigure('veth99')
self.wait_online('veth99:routable')
-
- output = check_output('ip -6 address show dev veth99')
- print(output)
- self.assertNotIn('2002:da8:1:0:b47e:7975:fc7a:7d6e/64', output) # the 1st prefixstable
- self.assertIn('2002:da8:1:0:da5d:e50a:43fd:5d0f/64', output) # the 2nd prefixstable
+ self.wait_address('veth99', '2002:da8:1:0:da5d:e50a:43fd:5d0f/64', ipv='-6', timeout_sec=10) # the 2nd prefixstable
+ self.wait_address_dropped('veth99', '2002:da8:1:0:b47e:7975:fc7a:7d6e/64', ipv='-6', timeout_sec=10) # the 1st prefixstable
check_output('ip address del 2002:da8:1:0:da5d:e50a:43fd:5d0f/64 dev veth99')
check_output('ip address add 2002:da8:1:0:da5d:e50a:43fd:5d0f/64 dev veth-peer nodad')
networkctl_reconfigure('veth99')
self.wait_online('veth99:routable')
-
- output = check_output('ip -6 address show dev veth99')
- print(output)
- self.assertNotIn('2002:da8:1:0:b47e:7975:fc7a:7d6e/64', output) # the 1st prefixstable
- self.assertNotIn('2002:da8:1:0:da5d:e50a:43fd:5d0f/64', output) # the 2nd prefixstable
- self.assertIn('2002:da8:1:0:c7e4:77ec:eb31:1b0d/64', output) # the 3rd prefixstable
+ self.wait_address('veth99', '2002:da8:1:0:c7e4:77ec:eb31:1b0d/64', ipv='-6', timeout_sec=10) # the 3rd prefixstable
+ self.wait_address_dropped('veth99', '2002:da8:1:0:da5d:e50a:43fd:5d0f/64', ipv='-6', timeout_sec=10) # the 2nd prefixstable
+ self.wait_address_dropped('veth99', '2002:da8:1:0:b47e:7975:fc7a:7d6e/64', ipv='-6', timeout_sec=10) # the 1st prefixstable
def test_ipv6_token_prefixstable_without_address(self):
copy_network_unit('25-veth.netdev', '25-ipv6-prefix.network', '25-ipv6-prefix-veth-token-prefixstable-without-address.network')