From 76fd8788cd067805d52a460c31bd736b2a626a3e Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Tue, 21 Apr 2026 11:04:22 +0000 Subject: [PATCH] nixosTests.ipv6: fix regular expression match conditions --- nixos/tests/ipv6.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/tests/ipv6.nix b/nixos/tests/ipv6.nix index 84c585be0ad4..822dece47722 100644 --- a/nixos/tests/ipv6.nix +++ b/nixos/tests/ipv6.nix @@ -81,7 +81,11 @@ machine.wait_until_succeeds(f"[ `{cmd} | wc -l` -eq 1 ]") output = machine.succeed(cmd) - ip = re.search(r"inet6 ([0-9a-f:]{2,})/", output).group(1) + matches: re.Match | None = re.search(r"inet6 ([0-9a-f:]{2,})/", output) + if matches is None: + raise Exception(f"Can't match IP out of output: {output}") + + ip = matches.group(1) if temporary: scope = scope + " temporary"