diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-09-30 18:42:40 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-10-01 11:23:39 +0900 |
commit | 4081c33b46a72a1a61651a9d0463a2ed85a82bbe (patch) | |
tree | 7646f65fe2fee1341a4caac1565664a5a5a830d1 /policy | |
parent | 38d80240654acf7e6b41077b00ef4c8288d93e46 (diff) |
path: distinguish aspath set from aspath seq
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'policy')
-rw-r--r-- | policy/policy_test.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/policy/policy_test.go b/policy/policy_test.go index b36dae6c..246c77b3 100644 --- a/policy/policy_test.go +++ b/policy/policy_test.go @@ -554,8 +554,7 @@ func TestAsPathConditionEvaluate(t *testing.T) { peer := &table.PeerInfo{AS: 65001, Address: net.ParseIP("10.0.0.1")} origin := bgp.NewPathAttributeOrigin(0) aspathParam1 := []bgp.AsPathParamInterface{ - bgp.NewAsPathParam(2, []uint16{65001, 65000, 65004, 65005}), - bgp.NewAsPathParam(1, []uint16{65001, 65010, 65004, 65005}), + bgp.NewAsPathParam(2, []uint16{65001, 65000, 65010, 65004, 65005}), } aspath := bgp.NewPathAttributeAsPath(aspathParam1) nexthop := bgp.NewPathAttributeNextHop("10.0.0.1") @@ -567,7 +566,7 @@ func TestAsPathConditionEvaluate(t *testing.T) { path1 := table.ProcessMessage(updateMsg1, peer)[0] aspathParam2 := []bgp.AsPathParamInterface{ - bgp.NewAsPathParam(1, []uint16{65010}), + bgp.NewAsPathParam(2, []uint16{65010}), } aspath2 := bgp.NewPathAttributeAsPath(aspathParam2) pathAttributes = []bgp.PathAttributeInterface{origin, aspath2, nexthop, med} @@ -662,7 +661,6 @@ func TestMultipleAsPathConditionEvaluate(t *testing.T) { origin := bgp.NewPathAttributeOrigin(0) aspathParam1 := []bgp.AsPathParamInterface{ bgp.NewAsPathParam(2, []uint16{65001, 65000, 54000, 65004, 65005}), - bgp.NewAsPathParam(1, []uint16{65001, 65010, 54000, 65004, 65005}), } aspath := bgp.NewPathAttributeAsPath(aspathParam1) nexthop := bgp.NewPathAttributeNextHop("10.0.0.1") @@ -705,7 +703,7 @@ func TestMultipleAsPathConditionEvaluate(t *testing.T) { asPathSet5 := config.AsPathSet{ AsPathSetName: "asset5", AsPathList: []config.AsPath{ - config.AsPath{AsPath: "^65001 65000 54000 65004 65005 65001,65010,54000,65004,65005$"}, + config.AsPath{AsPath: "^65001 65000 54000 65004 65005$"}, }, } @@ -726,7 +724,7 @@ func TestMultipleAsPathConditionEvaluate(t *testing.T) { asPathSet8 := config.AsPathSet{ AsPathSetName: "asset8", AsPathList: []config.AsPath{ - config.AsPath{AsPath: "6[0-9]+_6[0-9]+_6[0-9]+"}, + config.AsPath{AsPath: "6[0-9]+_6[0-9]+_5[0-9]+"}, }, } @@ -844,8 +842,8 @@ func TestAsPathConditionWithOtherCondition(t *testing.T) { peer := &table.PeerInfo{AS: 65001, Address: net.ParseIP("10.0.0.1")} origin := bgp.NewPathAttributeOrigin(0) aspathParam := []bgp.AsPathParamInterface{ - bgp.NewAsPathParam(2, []uint16{65001, 65000, 65004, 65004, 65005}), bgp.NewAsPathParam(1, []uint16{65001, 65000, 65004, 65005}), + bgp.NewAsPathParam(2, []uint16{65001, 65000, 65004, 65004, 65005}), } aspath := bgp.NewPathAttributeAsPath(aspathParam) nexthop := bgp.NewPathAttributeNextHop("10.0.0.1") @@ -1041,8 +1039,8 @@ func TestCommunityConditionEvaluateWithOtherCondition(t *testing.T) { peer := &table.PeerInfo{AS: 65001, Address: net.ParseIP("10.0.0.1")} origin := bgp.NewPathAttributeOrigin(0) aspathParam := []bgp.AsPathParamInterface{ - bgp.NewAsPathParam(2, []uint16{65001, 65000, 65004, 65004, 65005}), bgp.NewAsPathParam(1, []uint16{65001, 65000, 65004, 65005}), + bgp.NewAsPathParam(2, []uint16{65001, 65000, 65004, 65004, 65005}), } aspath := bgp.NewPathAttributeAsPath(aspathParam) nexthop := bgp.NewPathAttributeNextHop("10.0.0.1") @@ -1501,8 +1499,8 @@ func TestExtCommunityConditionEvaluateWithOtherCondition(t *testing.T) { peer := &table.PeerInfo{AS: 65001, Address: net.ParseIP("10.2.1.1")} origin := bgp.NewPathAttributeOrigin(0) aspathParam := []bgp.AsPathParamInterface{ - bgp.NewAsPathParam(2, []uint16{65001, 65000, 65004, 65004, 65005}), bgp.NewAsPathParam(1, []uint16{65001, 65000, 65004, 65005}), + bgp.NewAsPathParam(2, []uint16{65001, 65000, 65004, 65004, 65005}), } aspath := bgp.NewPathAttributeAsPath(aspathParam) nexthop := bgp.NewPathAttributeNextHop("10.2.1.1") |