]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: check if actually alternative name is set 21406/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Nov 2021 03:56:06 +0000 (12:56 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Nov 2021 03:58:08 +0000 (12:58 +0900)
Fixes #21404.

test/test-network/systemd-networkd-tests.py

index 68b2e42502f16575df29d59bfbc86433e75d436b..9f3d1dce38f1b50bc047dab772c093738c856d0b 100755 (executable)
@@ -172,10 +172,16 @@ def expectedFailureIfRTA_VIAIsNotSupported():
 
 def expectedFailureIfAlternativeNameIsNotAvailable():
     def f(func):
+        supported = False
         call('ip link add dummy98 type dummy', stderr=subprocess.DEVNULL)
         rc = call('ip link prop add dev dummy98 altname hogehogehogehogehoge', stderr=subprocess.DEVNULL)
-        call('ip link del dummy98', stderr=subprocess.DEVNULL)
         if rc == 0:
+            rc = call('ip link show dev hogehogehogehogehoge', stderr=subprocess.DEVNULL)
+            if rc == 0:
+                supported = True
+
+        call('ip link del dummy98', stderr=subprocess.DEVNULL)
+        if supported:
             return func
         else:
             return unittest.expectedFailure(func)