docs: enhance EvoBGP architecture plan with new risk mitigation strategies, testing matrix for BIRD2, and CI/CD workflow details. Updated section titles for clarity and added completed todos for deployment practices.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package birdfmt
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"net/netip"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
//go:embed testdata/golden/static_ipv4_small.golden
|
||||
var goldenStaticIPv4Small string
|
||||
|
||||
func TestRenderStaticIPv4Protocol_Golden(t *testing.T) {
|
||||
p1 := netip.MustParsePrefix("203.0.113.0/24")
|
||||
p2 := netip.MustParsePrefix("198.51.100.0/24")
|
||||
// duplicate to assert dedup
|
||||
got := RenderStaticIPv4Protocol("evobgp_test", []netip.Prefix{p1, p2, p1})
|
||||
|
||||
want := strings.TrimSuffix(goldenStaticIPv4Small, "\n")
|
||||
got = strings.TrimSuffix(got, "\n")
|
||||
if got != want {
|
||||
t.Fatalf("golden mismatch\n--- got ---\n%s\n--- want ---\n%s", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRenderStaticIPv4Protocol_Empty(t *testing.T) {
|
||||
got := RenderStaticIPv4Protocol("evobgp_empty", nil)
|
||||
if !strings.Contains(got, "protocol static evobgp_empty") {
|
||||
t.Fatal(got)
|
||||
}
|
||||
if !strings.Contains(got, "ipv4") {
|
||||
t.Fatal(got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user