MCPcopy
hub / github.com/osrg/gobgp / TestApplyToPathList_WithdrawIgnored

Function TestApplyToPathList_WithdrawIgnored

pkg/server/zclient_test.go:375–392  ·  view source on GitHub ↗

TestApplyToPathList_WithdrawIgnored verifies that withdraw paths are skipped.

(t *testing.T)

Source from the content-addressed store, hash-verified

373
374// TestApplyToPathList_WithdrawIgnored verifies that withdraw paths are skipped.
375func TestApplyToPathList_WithdrawIgnored(t *testing.T) {
376 assert := assert.New(t)
377
378 nlri, _ := bgp.NewIPAddrPrefix(netip.MustParsePrefix("10.3.1.0/24"))
379 nh, _ := bgp.NewPathAttributeNextHop(testNextHop)
380 attrs := []bgp.PathAttributeInterface{
381 bgp.NewPathAttributeOrigin(bgp.BGP_ORIGIN_ATTR_TYPE_INCOMPLETE),
382 nh,
383 }
384 path := table.NewPath(bgp.RF_IPv4_UC, nil, bgp.PathNLRI{NLRI: nlri}, true, attrs, time.Now(), false)
385
386 cache := nexthopStateCache{
387 testNextHop: 20,
388 }
389
390 updated := cache.applyToPathList([]*table.Path{path})
391 assert.Empty(updated, "withdraw paths must be skipped")
392}

Callers

nothing calls this directly

Calls 5

applyToPathListMethod · 0.95
NewIPAddrPrefixFunction · 0.92
NewPathAttributeNextHopFunction · 0.92
NewPathAttributeOriginFunction · 0.92
NewPathFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…