From: Nicki Křížek Date: Mon, 8 Dec 2025 15:14:11 +0000 (+0100) Subject: new: test: Regex support for logs and cmd output in pytest X-Git-Tag: v9.21.17~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8ecb4ffb611162a75a00f26e01959407e980ce9;p=thirdparty%2Fbind9.git new: test: Regex support for logs and cmd output in pytest Improve and unify the handling of regular expressions when searching in logs, files and command output in system tests. - Use `Re()` for constructing regular expressions, which is an imported shorthand for `re.compile()` (imported as `from re import compile as Re` - Add new `isctest.text.Text` interface which is a text wrapper that supports the `in` operator for line matching operation for both strings and regular expressions, e.g.: - `assert "running" in ns1.log` - `assert Re("a.example..*10.0.0.1") in response.out` - Use the new `isctest.text.Text` for: - `isctest.run.cmd()` output, where `.out` and `.err` can be used for stdout and stderr contents - `NamedInstance.log` rather than the previous log interface (`.expect()` and `.prohibit()` is no longer available or needed. The `in` operator along with an `assert` statement can be used now instead.) - `NamedInstance.rndc()` output, which returns identical output as `isctest.run.cmd()` Merge branch 'nicki/pytest-grep' into 'main' See merge request isc-projects/bind9!11054 --- e8ecb4ffb611162a75a00f26e01959407e980ce9