platform: modularize api/gui, add docs-tests-web foundation, and refresh root config

This commit is contained in:
beckline
2026-03-26 22:40:54 +03:00
parent 0e2d7f61ea
commit 6a56d734c2
562 changed files with 70151 additions and 16423 deletions

View File

@@ -0,0 +1,30 @@
package app
import "testing"
func TestIsContainerIfaceIncludesNetnsVeth(t *testing.T) {
cases := map[string]bool{
"docker0": true,
"br-abcdef123": true,
"veth123": true,
"svh6198e294": true,
"svn6198e294": true,
"eth0": false,
"tun0": false,
}
for iface, want := range cases {
if got := isContainerIface(iface); got != want {
t.Fatalf("isContainerIface(%q)=%v want=%v", iface, got, want)
}
}
}
func TestRouteLineIsLinkDown(t *testing.T) {
if !routeLineIsLinkDown("10.240.20.0/30 dev svh6a59db31 proto kernel scope link src 10.240.20.1 linkdown") {
t.Fatalf("expected linkdown route to be detected")
}
if routeLineIsLinkDown("10.240.20.0/30 dev svh6198e294 proto kernel scope link src 10.240.20.1") {
t.Fatalf("unexpected linkdown detection for active route")
}
}