From 475fb5e44fc3af4fd8b0e7308dceb44670388f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Behrmann?= Date: Wed, 25 Feb 2026 10:43:08 +0100 Subject: [PATCH] test-network: factor out common enum --- test/test-network/systemd-networkd-tests.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 50a5478eda..0f816aab83 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('.') + '.'