]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: factor out common enum
authorJörg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 25 Feb 2026 09:43:08 +0000 (10:43 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 May 2026 00:41:23 +0000 (09:41 +0900)
test/test-network/systemd-networkd-tests.py

index 50a5478edac58fea68a622cbbcdc3929da5f1c6e..0f816aab836c87e71c449998ec23438e230ba1c7 100755 (executable)
@@ -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('.') + '.'