mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
[9.18] fix: nil: Extend named-rrchecker multi-line parsing support
named-rrchecker now parses the braces which support multi-line input from the beginning of the input rather than only when reading the data fields of the record. Closes #5336 Backport of MR !10521 Merge branch 'backport-5336-extend-named-rrchecker-multiline-support-9.18' into 'bind-9.18' See merge request isc-projects/bind9!10547
This commit is contained in:
commit
d95caf1b4f
2 changed files with 14 additions and 2 deletions
|
|
@ -136,7 +136,10 @@ def run_rrchecker(option, rr_class, rr_type, rr_rest):
|
|||
return rrchecker_output.split()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("option", ["-p", "-u"])
|
||||
@pytest.mark.parametrize(
|
||||
"option",
|
||||
["-p", "-u", "multi-line at class", " multi-line at type", "multi-line at data"],
|
||||
)
|
||||
def test_rrchecker_conversions(option):
|
||||
tempzone_file = "tempzone"
|
||||
with open(tempzone_file, "w", encoding="utf-8") as file:
|
||||
|
|
@ -175,6 +178,15 @@ def test_rrchecker_conversions(option):
|
|||
"-u", rr_class_orig, rr_type_orig, rr_rest_orig
|
||||
)
|
||||
rr_rest = " ".join(rr_rest)
|
||||
elif option == "multi-line at class":
|
||||
rr_class = "(" + rr_class
|
||||
rr_rest = rr_rest + ")"
|
||||
elif option == "multi-line at type":
|
||||
rr_type = "(" + rr_type
|
||||
rr_rest = rr_rest + ")"
|
||||
elif option == "multi-line at data":
|
||||
rr_rest = "(" + rr_rest
|
||||
rr_rest = rr_rest + ")"
|
||||
|
||||
rr_class, rr_type, *rr_rest = run_rrchecker("-p", rr_class, rr_type, rr_rest)
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ main(int argc, char *argv[]) {
|
|||
specials[')'] = 1;
|
||||
specials['"'] = 1;
|
||||
isc_lex_setspecials(lex, specials);
|
||||
options = ISC_LEXOPT_EOL;
|
||||
options = ISC_LEXOPT_EOL | ISC_LEXOPT_DNSMULTILINE;
|
||||
isc_lex_setcomments(lex, ISC_LEXCOMMENT_DNSMASTERFILE);
|
||||
|
||||
RUNTIME_CHECK(isc_lex_openstream(lex, stdin) == ISC_R_SUCCESS);
|
||||
|
|
|
|||
Loading…
Reference in a new issue