]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: make link_exists() support alternative names
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Oct 2022 03:12:26 +0000 (12:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Nov 2022 13:38:37 +0000 (22:38 +0900)
test/test-network/systemd-networkd-tests.py

index dfef73f030e79675bec1e053bd251971d01d028e..f1332cd916ae02fec5e82b459b83a0024dcc262e 100755 (executable)
@@ -411,7 +411,7 @@ def create_service_dropin(service, command, reload_command=None, additional_sett
     create_unit_dropin(f'{service}.service', drop_in)
 
 def link_exists(link):
-    return os.path.exists(os.path.join('/sys/class/net', link, 'ifindex'))
+    return call_quiet(f'ip link show {link}') == 0
 
 def remove_link(*links, protect=False):
     for link in links: