From: Jörg Behrmann Date: Wed, 25 Feb 2026 09:43:08 +0000 (+0100) Subject: test-network: factor out common enum X-Git-Tag: v261-rc1~119^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=475fb5e44fc3af4fd8b0e7308dceb44670388f8b;p=thirdparty%2Fsystemd.git test-network: factor out common enum --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 50a5478edac..0f816aab836 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -816,15 +816,16 @@ def stop_by_pid_file(pid_file): rm_f(pid_file) +class SvcParam(enum.Enum): + ALPN = 1 + DOHPATH = 7 + + def dnr_v4_instance_data(adn, addrs=None, prio=1, alpns=('dot',), dohpath=None): pack = lambda c, w=1: struct.pack('>' + '_BH_I'[w], len(c)) + c pyton = lambda n, w=2: struct.pack('>' + '_BH_I'[w], n) ipv4 = ipaddress.IPv4Address - class SvcParam(enum.Enum): - ALPN = 1 - DOHPATH = 7 - data = pyton(prio) adn = adn.rstrip('.') + '.' @@ -846,10 +847,6 @@ def dnr_v6_instance_data(adn, addrs=None, prio=1, alpns=('dot',), dohpath=None): pyton = lambda n, w=2: struct.pack('>' + '_BH_I'[w], n) ipv6 = ipaddress.IPv6Address - class SvcParam(enum.Enum): - ALPN = 1 - DOHPATH = 7 - data = pyton(prio) adn = adn.rstrip('.') + '.'