test-network: fix invalid captive portal URL with dnsmasq 2.92 (#40011)

dnsmasq 2.92 started converting binary content to ascii so the previous
invalid URL is no longer invalid as it's escaped.

So the test started failing: https://bugs.debian.org/1122015

Use a '|' character instead, which is not a valid URL character but it's
also not escaped by dnsmasq.

Follow-up for 1219391c9f
This commit is contained in:
Luca Boccassi
2025-12-07 00:43:47 +00:00
committed by GitHub
parent 450f4ed58a
commit e2fbcee030

View File

@@ -8630,8 +8630,8 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
start_networkd()
self.wait_online('veth-peer:carrier')
masq = lambda bs: ':'.join(f'{b:02x}' for b in bs)
start_dnsmasq('--dhcp-option=114,' + masq(b'http://\x00invalid/url'),
'--dhcp-option=option6:103,' + masq(b'http://\x00/invalid/url'))
start_dnsmasq('--dhcp-option=114,http://|invalid/url',
'--dhcp-option=option6:103,http://|invalid/url')
check(self, True, True)
check(self, True, False)