diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-07-13 17:12:15 +0900 |
---|---|---|
committer | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-07-15 19:12:55 +0900 |
commit | b56ddd477bccd5ae0bd830b95de977ba516f066b (patch) | |
tree | 56d8390df6b37d28a0022d3ba7ba3d5fb5e9e182 /test/scenario_test/policy | |
parent | b73c4df33906a09acce12a4159f96626ae045797 (diff) |
scenaio_test: add extended community test
Diffstat (limited to 'test/scenario_test/policy')
-rw-r--r-- | test/scenario_test/policy/policy_generator.go | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/test/scenario_test/policy/policy_generator.go b/test/scenario_test/policy/policy_generator.go index 0d81fadc..9b35c5aa 100644 --- a/test/scenario_test/policy/policy_generator.go +++ b/test/scenario_test/policy/policy_generator.go @@ -207,6 +207,14 @@ func createPolicyConfig() *config.RoutingPolicy { CommunitySetName: "comRegExp", CommunityMembers: []string{"6[0-9]+:[0-9]+"}, } + eComOrigin := config.ExtCommunitySet{ + ExtCommunitySetName: "eComAS4", + ExtCommunityMembers: []string{"SoO:65001.65100:200"}, + } + eComTarget := config.ExtCommunitySet{ + ExtCommunitySetName: "eComRegExp", + ExtCommunityMembers: []string{"RT:6[0-9]+:3[0-9]+"}, + } st0 := config.Statement{ Name: "st0", @@ -612,6 +620,34 @@ func createPolicyConfig() *config.RoutingPolicy { }, }, } + st_eComOrigin := config.Statement{ + Name: "st_eComAS4", + Conditions: config.Conditions{ + MatchPrefixSet: "psExabgp", + MatchNeighborSet: "nsExabgp", + BgpConditions: config.BgpConditions{ + MatchExtCommunitySet: "eComOrigin", + }, + MatchSetOptions: config.MATCH_SET_OPTIONS_TYPE_ALL, + }, + Actions: config.Actions{ + AcceptRoute: false, + }, + } + st_eComTarget := config.Statement{ + Name: "st_eComRegExp", + Conditions: config.Conditions{ + MatchPrefixSet: "psExabgp", + MatchNeighborSet: "nsExabgp", + BgpConditions: config.BgpConditions{ + MatchExtCommunitySet: "eComTarget", + }, + MatchSetOptions: config.MATCH_SET_OPTIONS_TYPE_ALL, + }, + Actions: config.Actions{ + AcceptRoute: false, + }, + } test_01_import_policy_initial := config.PolicyDefinition{ Name: "test_01_import_policy_initial", @@ -833,15 +869,25 @@ func createPolicyConfig() *config.RoutingPolicy { StatementList: []config.Statement{st_asprepend_lastas}, } + test_40_ecommunity_origin_condition_import := config.PolicyDefinition{ + Name: "test_40_ecommunity_origin_condition_import", + StatementList: []config.Statement{st_eComOrigin}, + } + + test_41_ecommunity_target_condition_export := config.PolicyDefinition{ + Name: "test_41_ecommunity_target_condition_export", + StatementList: []config.Statement{st_eComTarget}, + } + ds := config.DefinedSets{ PrefixSetList: []config.PrefixSet{ps0, ps1, ps2, ps3, ps4, ps5, ps6, psExabgp}, NeighborSetList: []config.NeighborSet{nsPeer2, nsPeer2V6, nsExabgp}, BgpDefinedSets: config.BgpDefinedSets{ AsPathSetList: []config.AsPathSet{aspathFrom, aspathAny, aspathOrigin, aspathOnly}, CommunitySetList: []config.CommunitySet{comStr, comRegExp}, + ExtCommunitySetList: []config.ExtCommunitySet{eComOrigin, eComTarget}, }, } - p := &config.RoutingPolicy{ DefinedSets: ds, PolicyDefinitionList: []config.PolicyDefinition{ @@ -889,6 +935,8 @@ func createPolicyConfig() *config.RoutingPolicy { test_37_aspath_prepend_action_export, test_38_aspath_prepend_action_lastas_import, test_39_aspath_prepend_action_lastas_export, + test_40_ecommunity_origin_condition_import, + test_41_ecommunity_target_condition_export, }, } return p |