]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: make masq a proper function
authorJörg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 25 Feb 2026 10:00:54 +0000 (11:00 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 May 2026 00:43:36 +0000 (09:43 +0900)
test/test-network/systemd-networkd-tests.py

index ec01e2a3bcd63154f1b569fb4b126e1c43235fd4..fabb76fcbf2008deb23c49e0a3c3839c25512905 100755 (executable)
@@ -9738,6 +9738,9 @@ Address={ipv6_address}
 
             check_json(networkctl_json())
 
+        def masq(bs):
+            return ':'.join(f'{b:02x}' for b in bs)
+
         copy_network_unit(
             '25-veth.netdev',
             '25-dhcp-server-veth-peer.network',
@@ -9761,7 +9764,6 @@ Address={ipv6_address}
             adn='dns.google',
             addrs=['2001:4860:4860::8888', '2001:4860:4860::8844'],
         )
-        masq = lambda bs: ':'.join(f'{b:02x}' for b in bs)
         start_dnsmasq(f'--dhcp-option=162,{masq(dnr_v4)}', f'--dhcp-option=option6:144,{masq(dnr_v6)}')
 
         check(self, True, True)