Skip to content

Commit

Permalink
Test if the peer-group inheritance works for neighbors
Browse files Browse the repository at this point in the history
Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed May 21, 2024
1 parent 0dfa367 commit 45ccd39
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/sources/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,16 @@
# enabled = true
# ttl-min = 255 # 255 means directly connected

[[neighbors]]
[neighbors.config]
peer-group = "my-peer-group"
neighbor-address = "127.0.0.2"

[[peer-groups]]
[peer-groups.config]
peer-group-name = "my-peer-group"
peer-as = 65000
#send-software-version = true
send-software-version = true
[[peer-groups.afi-safis]]
[peer-groups.afi-safis.config]
afi-safi-name = "ipv4-unicast"
Expand Down
18 changes: 18 additions & 0 deletions pkg/config/oc/bgp_configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,22 @@ func TestConfigExample(t *testing.T) {
assert.NoError(v.ReadInConfig())
assert.NoError(v.UnmarshalExact(c))
assert.NoError(setDefaultConfigValuesWithViper(v, c))

// Test if we can set the parameters for a peer-group
for _, peerGroup := range c.PeerGroups {
if peerGroup.Config.PeerGroupName != "my-peer-group" {
continue
}

assert.True(peerGroup.Config.SendSoftwareVersion)
}

// Test if the peer-group inheritance works for neighbors
for _, neighbor := range c.Neighbors {
if neighbor.Config.PeerGroup != "my-peer-group" {
continue
}

assert.True(neighbor.Config.SendSoftwareVersion)
}
}

0 comments on commit 45ccd39

Please sign in to comment.