summaryrefslogtreecommitdiffstats
path: root/test/test-network/systemd-networkd-tests.py
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-05-20 02:53:26 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-05-20 11:33:47 +0200
commitf1f1be71feacb3b5d2fb89e2f6421c23b9320fbd (patch)
treec89b82c76007e66d73c2c6dedcac9a0def122818 /test/test-network/systemd-networkd-tests.py
parenttest-network: split out setup_netdevsim() (diff)
downloadsystemd-f1f1be71feacb3b5d2fb89e2f6421c23b9320fbd.tar.xz
systemd-f1f1be71feacb3b5d2fb89e2f6421c23b9320fbd.zip
test-network: also set custom altternative name for netdevsim interface
Due to the bug in kernel 6.9 caused by https://github.com/torvalds/linux/commit/8debcf5832c3e8a6baaea27c75ad8a6ba5077beb, the net_id udev builtin does not work for netdevsim interface. So, eni99np1 cannot be used with kernel 6.9 anymore. Workaround for #32910.
Diffstat (limited to '')
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index ff6f18dd2e..8d9e0533b7 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -562,7 +562,7 @@ def link_exists(*links):
return True
def link_resolve(link):
- return check_output(f'ip link show {link}').split(':')[1].strip()
+ return check_output(f'ip link show {link}').split(':')[1].strip().split('@')[0]
def remove_link(*links, protect=False):
for link in links:
@@ -5282,14 +5282,14 @@ class NetworkdSRIOVTests(unittest.TestCase, Utilities):
@expectedFailureIfNetdevsimWithSRIOVIsNotAvailable()
def test_sriov(self):
- copy_network_unit('25-default.link', '25-sriov.network')
+ copy_network_unit('25-netdevsim.link', '25-sriov.network')
self.setup_netdevsim(num_vfs=3)
start_networkd()
- self.wait_online('eni99np1:routable')
+ self.wait_online('sim99:routable')
- output = check_output('ip link show dev eni99np1')
+ output = check_output('ip link show dev sim99')
print(output)
self.assertRegex(output,
'vf 0 .*00:11:22:33:44:55.*vlan 5, qos 1, vlan protocol 802.1ad, spoof checking on, link-state enable, trust on, query_rss on\n *'
@@ -5304,12 +5304,12 @@ class NetworkdSRIOVTests(unittest.TestCase, Utilities):
self.setup_netdevsim()
start_networkd()
- self.wait_online('eni99np1:routable')
+ self.wait_online('sim99:routable')
- # the name eni99np1 may be an alternative name.
- ifname = link_resolve('eni99np1')
+ # The name sim99 is an alternative name, and cannot be used by udevadm below.
+ ifname = link_resolve('sim99')
- output = check_output('ip link show dev eni99np1')
+ output = check_output('ip link show dev sim99')
print(output)
self.assertRegex(output,
'vf 0 .*00:11:22:33:44:55.*vlan 5, qos 1, vlan protocol 802.1ad, spoof checking on, link-state enable, trust on, query_rss on\n *'
@@ -5325,7 +5325,7 @@ class NetworkdSRIOVTests(unittest.TestCase, Utilities):
udevadm_reload()
udevadm_trigger(f'/sys/devices/netdevsim99/net/{ifname}')
- output = check_output('ip link show dev eni99np1')
+ output = check_output('ip link show dev sim99')
print(output)
self.assertRegex(output,
'vf 0 .*00:11:22:33:44:55.*vlan 5, qos 1, vlan protocol 802.1ad, spoof checking on, link-state enable, trust on, query_rss on\n *'
@@ -5341,7 +5341,7 @@ class NetworkdSRIOVTests(unittest.TestCase, Utilities):
udevadm_reload()
udevadm_trigger(f'/sys/devices/netdevsim99/net/{ifname}')
- output = check_output('ip link show dev eni99np1')
+ output = check_output('ip link show dev sim99')
print(output)
self.assertRegex(output,
'vf 0 .*00:11:22:33:44:55.*vlan 5, qos 1, vlan protocol 802.1ad, spoof checking on, link-state enable, trust on, query_rss on\n *'
@@ -5357,7 +5357,7 @@ class NetworkdSRIOVTests(unittest.TestCase, Utilities):
udevadm_reload()
udevadm_trigger(f'/sys/devices/netdevsim99/net/{ifname}')
- output = check_output('ip link show dev eni99np1')
+ output = check_output('ip link show dev sim99')
print(output)
self.assertRegex(output,
'vf 0 .*00:11:22:33:44:55.*vlan 5, qos 1, vlan protocol 802.1ad, spoof checking on, link-state enable, trust on, query_rss on\n *'
@@ -5373,7 +5373,7 @@ class NetworkdSRIOVTests(unittest.TestCase, Utilities):
udevadm_reload()
udevadm_trigger(f'/sys/devices/netdevsim99/net/{ifname}')
- output = check_output('ip link show dev eni99np1')
+ output = check_output('ip link show dev sim99')
print(output)
self.assertRegex(output,
'vf 0 .*00:11:22:33:44:55.*vlan 5, qos 1, vlan protocol 802.1ad, spoof checking on, link-state enable, trust on, query_rss on\n *'