fix(cli): carry the review fixes of the master port to v1.0

This commit is contained in:
Anthony Wong authored and Cuong Manh Le committed 2026-09-28 16:51:55 +07:00
1 parent 12ab2a0e71
commit f52dfd0354
24 files changed
+993 -68

No files matched your search

+16
View File
@@ -1,6 +1,7 @@
package cli
import (
"slices"
"testing"
"time"
@@ -230,6 +231,21 @@ func Test_upstreamMonitorKeepsACustomNameOutOfTheJournal(t *testing.T) {
}
}
// Test_journalUpstreamNamesBoundsEveryName covers the line that names several
// upstreams at once. One operator key in the list must not reach the journal.
func Test_journalUpstreamNamesBoundsEveryName(t *testing.T) {
got := journalUpstreamNames([]string{
upstreamPrefix + "0",
upstreamPrefix + "dns.controld.com/org-v1-SECRET0123",
upstreamOS,
})
want := []string{upstreamPrefix + "0", upstreamPrefix + "custom", upstreamOS}
if !slices.Equal(got, want) {
t.Fatalf("journalUpstreamNames = %v, want %v", got, want)
}
}
func Test_upstreamMonitorCountDown(t *testing.T) {
captureDebugMainLog(t)
um := newUpstreamMonitor(&ctrld.Config{})