summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-20 08:55:06 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-20 09:17:22 +0000
commite5896c901ae7b66a5ad03230575ccd5e8a24665b (patch)
tree38e484ccc91767333f7e601050ce92313cc8b301 /table
parente55122db0becb2edcd592eed4abc95348d30d9d1 (diff)
policy: add test case
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r--table/policy_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/table/policy_test.go b/table/policy_test.go
index 106eb275..ab4b4067 100644
--- a/table/policy_test.go
+++ b/table/policy_test.go
@@ -911,6 +911,16 @@ func TestAsPathCondition(t *testing.T) {
makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{1000, 7521, 100}, false),
}
+ 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),
+ makeTest(bgp.BGP_ASPATH_ATTR_TYPE_SEQ, []uint32{65001, 65534}, false),
+ 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),
+ }
+
for k, v := range tests {
s, _ := NewAsPathSet(config.AsPathSet{
AsPathSetName: k,