From: Yu Watanabe Date: Wed, 17 Nov 2021 03:56:06 +0000 (+0900) Subject: test-network: check if actually alternative name is set X-Git-Tag: v250-rc1~229^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b36caceb889b2614b09bb96d839b216ee60dc3f7;p=thirdparty%2Fsystemd.git test-network: check if actually alternative name is set Fixes #21404. --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 68b2e42502f..9f3d1dce38f 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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)