Repository navigation
Conversation
|
I preferred using This PR could also have been an opportunity to add to the scenario |
I checked if that could be the case, but
Well, then it is more than a bug fix. I could be in the same PR or in a new one. I will check how to do it. Else, did you see any problem with the PR? |
|
Writing a failing unit test that reproduces the bug is the best way to make sure that we’ve actually fixed the bug and don’t reintroduce it later on. diff --git a/t/Test-consistency05.t b/t/Test-consistency05.t
index a640e824..cac4c226 100644
--- a/t/Test-consistency05.t
+++ b/t/Test-consistency05.t
@@ -155,7 +155,13 @@ scenario 'NO-NS-ADDR-CHILD-2' => sub {
scenario 'OOD-ADDR-MISMATCH' => sub {
zone 'child.{SCENARIO}.{TESTCASE}.xa';
- expect 'CS05_OOD_ADDR_MISMATCH';
+ expect 'CS05_OOD_ADDR_MISMATCH' => {
+ nsname => 'ns1.sibbling.ood-addr-mismatch.consistency05.xa',
+ ns_ip_list_glue => '127.14.5.39;'
+ . 'fda1:b2:c3:0:127:14:5:39',
+ ns_ip_list_lookup => '127.14.5.33;'
+ . 'fda1:b2:c3:0:127:14:5:33',
+ };
forbid_others;
};(I’m not entirely sure that the arguments’ values I’m expecting in the unit test are correct. Feel free to fix them for me.) When I check out your branch and apply my changes to have the failing unit test, I realize that there is another problem with the same code. Notice the arguments of the last line. Let’s not change what isn’t strictly necessary to change to fix the bug. |
|
Okay, basically you also need this: diff --git a/lib/Zonemaster/Engine/Test/Consistency.pm b/lib/Zonemaster/Engine/Test/Consistency.pm
index 90ca034d..5699b1de 100644
--- a/lib/Zonemaster/Engine/Test/Consistency.pm
+++ b/lib/Zonemaster/Engine/Test/Consistency.pm
@@ -1057,8 +1057,8 @@ sub consistency05 {
if ( not $set->equals( $lookup ) ) {
push @results, _emit_log( CS05_OOD_ADDR_MISMATCH => {
nsname => $n,
- ns_ip_list_glue => join( ";", map { $_->address() } $set->sorted_items() ),
- ns_ip_list_lookup => join( ";", map { $_->address() } $lookup->sorted_items() )
+ ns_ip_list_glue => join( ";", map { $_->address()->short() } $set->sorted_items() ),
+ ns_ip_list_lookup => join( ";", map { $_->address()->short() } $lookup->sorted_items() )
} );
}
}Then the failing test I mentioned in my previous comment passes. |
Co-authored-by: Marc van der Wal <103426270+marc-vanderwal@users.noreply.github.com>
Purpose
This PR corrects some errors for Consistency05 implementation:
Context
Issue #1559.
How to test this PR
Correct messages (msgids) should be displayed.