- jarl zone list showed only primary zones. zone create binds its --type flag (default "primary") to the same variable as list's --type, so the default leaked into the list filter and hid hint, secondary and forward zones. list now has its own variable. TestListQueries runs list commands against a fake server and checks the filters they send. - named-checkconf/named-checkzone messages are classified by the tool's exit code: on success, everything printed is a warning. Warnings such as 'both "recursion no;" and "allow-recursion" active' were shown as errors. The CLI, jarld check and the web UI now label them as warnings and skip the routine "loaded serial" lines. - The zone_outside_view error points at --adopt-zones. - docs/views.md: step-by-step split DNS for a server that has no views yet, tested on a copy of a stock Ubuntu 26.04 setup. Linked from the README, concepts and validation docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
660 B
Go
20 lines
660 B
Go
package bind
|
|
|
|
import "testing"
|
|
|
|
func TestResultClassification(t *testing.T) {
|
|
// named-checkconf exited 0: everything it printed is a warning.
|
|
ok := newResult(`both "recursion no;" and "allow-recursion" active for view external
|
|
zone example.com/IN/internal: loaded serial 1
|
|
`, 0)
|
|
if !ok.OK || len(ok.Messages) != 2 || ok.Messages[0].Error || ok.Messages[1].Error {
|
|
t.Errorf("exit 0: %+v", ok)
|
|
}
|
|
// Non-zero exit: real problems stay errors.
|
|
bad := newResult(`/etc/bind/jarl/named.conf:12: unknown option 'recursoin'
|
|
`, 1)
|
|
if bad.OK || len(bad.Messages) != 1 || !bad.Messages[0].Error || bad.Messages[0].Line != 12 {
|
|
t.Errorf("exit 1: %+v", bad)
|
|
}
|
|
}
|