diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-07-31 10:00:35 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-10-03 23:04:20 +0900 |
commit | 21ac7fa3ca69ff95b6fab96245d8c03612ee56eb (patch) | |
tree | 66087056f7fd5974d138102d1e46a1a08bfda128 /packet/mrt/mrt_test.go | |
parent | e1d2dd025de89dd0c5db88322f990d60e09cc91f (diff) |
packet/mrt: Enable RibEntry to switch add-path enabled
Because path_id = 0 is valid Path ID, we cannot determine whether add-path
is enabled based on just a value of path_id.
This patch adds a new argument to switch add-path features.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'packet/mrt/mrt_test.go')
-rw-r--r-- | packet/mrt/mrt_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packet/mrt/mrt_test.go b/packet/mrt/mrt_test.go index e2e601a5..30edd496 100644 --- a/packet/mrt/mrt_test.go +++ b/packet/mrt/mrt_test.go @@ -114,7 +114,7 @@ func TestMrtRibEntry(t *testing.T) { bgp.NewPathAttributeLocalPref(1 << 22), } - e1 := NewRibEntry(1, uint32(time.Now().Unix()), 0, p) + e1 := NewRibEntry(1, uint32(time.Now().Unix()), 0, p, false) b1, err := e1.Serialize() if err != nil { t.Fatal(err) @@ -143,7 +143,7 @@ func TestMrtRibEntryWithAddPath(t *testing.T) { bgp.NewPathAttributeMultiExitDisc(1 << 20), bgp.NewPathAttributeLocalPref(1 << 22), } - e1 := NewRibEntry(1, uint32(time.Now().Unix()), 200, p) + e1 := NewRibEntry(1, uint32(time.Now().Unix()), 200, p, true) b1, err := e1.Serialize() if err != nil { t.Fatal(err) @@ -173,9 +173,9 @@ func TestMrtRib(t *testing.T) { bgp.NewPathAttributeLocalPref(1 << 22), } - e1 := NewRibEntry(1, uint32(time.Now().Unix()), 0, p) - e2 := NewRibEntry(2, uint32(time.Now().Unix()), 0, p) - e3 := NewRibEntry(3, uint32(time.Now().Unix()), 0, p) + e1 := NewRibEntry(1, uint32(time.Now().Unix()), 0, p, false) + e2 := NewRibEntry(2, uint32(time.Now().Unix()), 0, p, false) + e3 := NewRibEntry(3, uint32(time.Now().Unix()), 0, p, false) r1 := NewRib(1, bgp.NewIPAddrPrefix(24, "192.168.0.0"), []*RibEntry{e1, e2, e3}) b1, err := r1.Serialize() @@ -207,9 +207,9 @@ func TestMrtRibWithAddPath(t *testing.T) { bgp.NewPathAttributeLocalPref(1 << 22), } - e1 := NewRibEntry(1, uint32(time.Now().Unix()), 100, p) - e2 := NewRibEntry(2, uint32(time.Now().Unix()), 200, p) - e3 := NewRibEntry(3, uint32(time.Now().Unix()), 300, p) + e1 := NewRibEntry(1, uint32(time.Now().Unix()), 100, p, true) + e2 := NewRibEntry(2, uint32(time.Now().Unix()), 200, p, true) + e3 := NewRibEntry(3, uint32(time.Now().Unix()), 300, p, true) r1 := NewRib(1, bgp.NewIPAddrPrefix(24, "192.168.0.0"), []*RibEntry{e1, e2, e3}) b1, err := r1.Serialize() |