f-75: watchdog: règles de confinement manquantes sur les subnets bridge #75
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
f966f394eb
commit
85abdaa1ef
3 changed files with 69 additions and 1 deletions
|
|
@ -280,3 +280,32 @@ func problems(ns []notification) []string {
|
|||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func TestCheckSubnets_BridgeSansInterfaceIP(t *testing.T) {
|
||||
db := newTestDB(t)
|
||||
seedSubnet(t, db, "br-000042", "vp-admin", modeBridge)
|
||||
r := &recorder{}
|
||||
|
||||
if err := CheckSubnets(db, dnsmasqConfig(), newFakeUnits(), r); err != nil {
|
||||
t.Fatalf("erreur inattendue: %v", err)
|
||||
}
|
||||
|
||||
if !r.hasProblemContaining("interface_ip unreadable") {
|
||||
t.Errorf("un subnet bridge sans interface_ip devrait être signalé, obtenu %v", r.calls)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckSubnets_VxlanSansInterfaceIPNeVerifiePasLesReglesBridge(t *testing.T) {
|
||||
db := newTestDB(t)
|
||||
seedSubnet(t, db, "br-000042", "vp-admin", modeVxlan)
|
||||
seedKV(t, db, prefixSubnet+"br-000042/vxlan_id", "42")
|
||||
r := &recorder{}
|
||||
|
||||
if err := CheckSubnets(db, dnsmasqConfig(), newFakeUnits(), r); err != nil {
|
||||
t.Fatalf("erreur inattendue: %v", err)
|
||||
}
|
||||
|
||||
if r.hasProblemContaining("interface_ip unreadable") {
|
||||
t.Errorf("un subnet vxlan ne passe pas par la vérification bridge, obtenu %v", r.calls)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue