diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-21 04:12:46 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-21 14:37:47 +0900 |
commit | ae671a791a2e2628a757b8103e88b14081e78c3f (patch) | |
tree | 6f8f4b8d456bd269b2d1e315f9f02fd3b6d2e4d9 /table/policy_test.go | |
parent | 7d5a97862f927e8ba2fb82018e61fb17cd9ffcd2 (diff) |
policy: fix as-path match optimization
following as-path pattern will be optimized
- ^<asn>_ # left-most
- _<asn>$ # origin
- _<asn>_ # include
- ^<asn>$ # only
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/policy_test.go')
-rw-r--r-- | table/policy_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/table/policy_test.go b/table/policy_test.go index ab4b4067..be301593 100644 --- a/table/policy_test.go +++ b/table/policy_test.go @@ -911,7 +911,7 @@ func TestAsPathCondition(t *testing.T) { makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{1000, 7521, 100}, false), } - tests["^65001.*65535$"] = []astest{ + tests["^65001( |_.*_)65535$"] = []astest{ makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65535}, true), makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65001, 65535}, true), makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65002, 65003, 65535}, true), @@ -919,6 +919,8 @@ func TestAsPathCondition(t *testing.T) { makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65002, 65535}, false), makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65002, 65001, 65535}, false), makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65535, 65002}, false), + makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{650019, 65535}, false), + makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 165535}, false), } for k, v := range tests { |