f-87: agent: bridge public = interfaces.internet, watchdog du segment #87
Le veth vp-<id>-e rejoint cfg.PublicBridge() (interfaces.internet, br-public par défaut, jamais default_interface). Le watchdog signale un bridge public absent, éteint ou sans port VXLAN. config.exemple.yml : internet: br-public. Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
7535e068b9
commit
26095062c8
10 changed files with 200 additions and 3 deletions
20
internal/config/agent/interfaces_test.go
Normal file
20
internal/config/agent/interfaces_test.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package configuration
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestPublicBridge(t *testing.T) {
|
||||
cases := map[string]struct {
|
||||
cfg Config
|
||||
want string
|
||||
}{
|
||||
"clé absente": {Config{DefaultInterface: "br-000000"}, "br-public"},
|
||||
"clé vide": {Config{DefaultInterface: "br-000000", Interfaces: map[string]string{"internet": ""}}, "br-public"},
|
||||
"clé posée": {Config{Interfaces: map[string]string{"internet": "br-wan"}}, "br-wan"},
|
||||
"autres types, sans default_interface en repli": {Config{DefaultInterface: "br-000000", Interfaces: map[string]string{"lan": "br-lan"}}, "br-public"},
|
||||
}
|
||||
for name, c := range cases {
|
||||
if got := c.cfg.PublicBridge(); got != c.want {
|
||||
t.Errorf("%s : %q, %q attendu", name, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue