diff --git a/feature/bgp/policybase/otg_tests/comm_match_action_test/README.md b/feature/bgp/policybase/otg_tests/comm_match_action_test/README.md new file mode 100644 index 00000000000..3767faa24ee --- /dev/null +++ b/feature/bgp/policybase/otg_tests/comm_match_action_test/README.md @@ -0,0 +1,125 @@ +# RT-7.8: BGP Policy Match Standard Community and Add Community Import/Export Policy + +## Summary + +Configure bgp policy to add communities to routes by matching on the following +criteria. + +* RT-7.8.1 Validate test environment +* RT-7.8.2 Validate policy to set standard community for various policies using OC release 3.x + +## Testbed type + +* https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed + +## Procedure + +* Testbed configuration - Setup eBGP sessions and prefixes. + * Generate config for 2 DUT and ATE ports where: + * DUT port 1 to ATE port 1. + * DUT port 2 to ATE port 2. + * Configure ATE port 1 with an external type BGP session to DUT port 1. + * Advertise ipv4 and ipv6 prefixes to DUT port 1 using the following communities: + * prefix-set-1 with 2 ipv6 and 2 ipv4 routes without communities. + * prefix-set-2 with 2 ipv6 and 2 ipv4 routes with communities `[5:5, 6:6 ]`. + +* RT-7.8.1 - Validate prefixes are propagated by DUT + * For IPv4 and IPv6 prefixes: + * Observe received prefixes at ATE port-2. + * Send traffic from ATE port-2 to all prefix-sets-1,2. + * Verify traffic is received on ATE port 1 for all prefixes. + * Stop traffic + +* RT-7.8.2 - Create policy to set standard community for all routes using OC release 3.x + * Configure the following community sets on the DUT. + (prefix: `/routing-policy/defined-sets/bgp-defined-sets/`) + * Create a `community-sets/community-set` named 'match_std_comms' with members as follows: + * community-member = [ "5:5" ] + * Create a `community-sets/community-set` named 'add_std_comms' with members as follows: + * community-member = [ "10:10", "20:20", "30:30" ] + + * Create `/routing-policy/policy-definitions/policy-definition/policy-definition[name='add_std_comms']/` + with the following `statements/` + * statement[name='add_std_comms']/ + * actions/bgp-actions/set-community/reference/config/community-set-refs = + /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set[name='add_std_comms'] + * actions/bgp-actions/set-community/config/options = ADD + * actions/bgp-actions/set-community/config/method = REFERENCE + * actions/config/policy-result = NEXT_STATEMENT + * statement[name='accept_all_routes']/ + * actions/config/policy-result = ACCEPT_ROUTE + + * Create a `/routing-policy/policy-definitions/policy-definition/policy-definition[name='match_and_add_comms'/` + with the following `statements/` + * statement[name='match_and_add_std_comms']/ + * conditions/bgp-conditions/match-community-set/config/community-set = 'match_std_comms' + * conditions/bgp-conditions/match-community-set/config/match-set-options = ANY + * actions/bgp-actions/set-community/reference/config/community-set-refs = 'add_std_comms' + * actions/bgp-actions/set-community/config/options = ADD + * actions/bgp-actions/set-community/config/method = REFERENCE + * actions/config/policy-result = NEXT_STATEMENT + * statement[name='accept_all_routes']/ + * actions/config/policy-result = ACCEPT_ROUTE + + * For each policy-definition created, run a subtest (RT-7.8.2.x-neighbor-) to + * Use gnmi Set REPLACE option for: + * `/routing-policy/policy-definitions` to configure the policy + * Use `/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy` + to apply the policy on the DUT bgp neighbor to the ATE port 1. + * Verify routes are received on ATE port 1 for all prefixes (since all routes are accepted by policies). + * Verify expected communities are present in ATE. + * Verify expected communities are present in DUT state. + * Do not fail test if this path is not supported, only log results + * `/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/community-index` + * `/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/community-index` + + * For each policy-definition created, run a sub-test (RT-7.8.2.x-peer-group-) to + * Use gnmi Set REPLACE option for: + * `/routing-policy/policy-definitions` to configure the policy + * Use `/network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/apply-policy/config/import-policy` + to apply the policy on the DUT bgp neighbor to the ATE port 1. + * Verify expected communities are present in ATE. + * Verify expected communities are present in DUT state. + * Do not fail test if this path is not supported, only log results + * `/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/community-index` + * `/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/community-index` + + * Expected result - communities + | | add_std_comms | match_and_add_std_comms | + | ------------ | --------------------------------------------- | --------------------------------- | + | prefix-set-1 | [ 10:10, 20:20, 30:30 ] | none | + | prefix-set-2 | [ 10:10, 20:20, 30:30, 5:5, 6:6 ] | [ 10:10, 20:20, 30:30, 5:5, 6:6 ] | + +## Config Parameter Coverage + +### Policy for community-set configuration + +* /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-set-name +* /routing-policy/defined-sets/bgp-defined-sets/community-sets/community-set/config/community-member + +### Policy action configuration + +* /routing-policy/policy-definitions/policy-definition/config/name +* /routing-policy/policy-definitions/policy-definition/statements/statement/config/name +* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-community/reference/config/community-set-refs + +### Policy for community-set match configuration + +* /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/config/community-set +* /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-community-set/config/match-set-options + +### Policy attachment point configuration + +* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy +* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/export-policy +* /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/apply-policy/config/import-policy +* /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/apply-policy/config/export-policy + +## Telemetry Parameter Coverage + +* /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/community-index +* /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/community-index + +## Minimum DUT Required + +vRX - Virtual Router Device diff --git a/feature/bgp/policybase/otg_tests/comm_match_action_test/metadata.textproto b/feature/bgp/policybase/otg_tests/comm_match_action_test/metadata.textproto new file mode 100644 index 00000000000..2a83890b34c --- /dev/null +++ b/feature/bgp/policybase/otg_tests/comm_match_action_test/metadata.textproto @@ -0,0 +1,7 @@ +# proto-file: github.com/openconfig/featureprofiles/proto/metadata.proto +# proto-message: Metadata + +plan_id: "RT-7.8" +description: "BGP Policy Match Standard Community and Add Community Import/Export Policy" +testbed: TESTBED_DUT_ATE_2LINKS +tags: TAGS_AGGREGATION, TAGS_TRANSIT, TAGS_DATACENTER_EDGE \ No newline at end of file diff --git a/feature/bgp/policybase/otg_tests/link_bandwidth_test/README.md b/feature/bgp/policybase/otg_tests/link_bandwidth_test/README.md new file mode 100644 index 00000000000..813e1e65b40 --- /dev/null +++ b/feature/bgp/policybase/otg_tests/link_bandwidth_test/README.md @@ -0,0 +1,177 @@ +# RT-7.5: BGP Policy - Set Link Bandwidth Community + +## Summary + +Configure bgp policy to add statically configured BGP link bandwidth +communities to routes based on a prefix match. + +## Testbed type + +* [2 port ATE to DUT](https://github.com/openconfig/featureprofiles/blob/main/topologies/atedut_2.testbed) + +## Procedure + +* Testbed configuration - Setup external BGP sessions and prefixes. + * Generate config for 2 DUT and ATE ports where: + * DUT port 1 to ATE port 1. + * DUT port 2 to ATE port 2. + * Configure dummy accept policies and attach it to both sessions on DUT. + * Create a `/routing-policy/policy-definitions/policy-definition/policy-definition` + named 'allow_all' with the following `statements` + * statement[name='allow-all']/ + * actions/config/policy-result = ACCEPT_ROUTE + * Use `/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy` + to apply the policy on the DUT bgp neighbor to the ATE port 1. + * Configure ATE port 1 with a BGP session to DUT port 1. + * Advertise ipv4 and ipv6 prefixes to DUT port 1 using the following communities: + * prefix-set-1 with 2 ipv4 and 2 ipv6 routes without communities. + * prefix-set-2 with 2 ipv4 and 2 ipv6 routes with communities `[ "100:100" ]`. + * prefix-set-3 with 2 ipv4 and 2 ipv6 routes with extended communities `[ "link-bandwidth:100:0" ]`. + +* RT-7.5.1 - Validate bgp sessions and traffic + * For IPv4 and IPv6 prefixes: + * Observe received prefixes at ATE port-2. + * Generate traffic from ATE port-2 to ATE port-1. + * Verify traffic is received on ATE port 1 for advertised prefixes. + routes. + +* RT-7.5.2 - Validate adding and removing link-bandwidth ext-community-sets using OC model release 3.x + * Configure the following extended community sets on the DUT: + (prefix: `routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set`) + * Create an ext-community-set named 'linkbw_0' with: + * ext-community-member = [ "link-bandwidth:100:0" ] + * Create an ext-community-set named 'linkbw_1M' with members as follows: + * ext-community-member = [ "link-bandwidth:100:1M" ] + * Create an ext-community-set named 'linkbw_2G' with members as follows: + * ext-community-member = [ "link-bandwidth:100:2G" ] + * Create an community-set named 'regex_match_as100' with members as follows: + * community-member = [ "^100:.*$" ] + * Create an ext-community-set named 'linkbw_any' with members as follows: + * ext-community-member = [ "^link-bandwidth:.*:.*$" ] + * Create an ext-community-set named 'linkbw_any_0' with members as follows: + * ext-community-member = [ "^link-bandwidth:.*:.0" ] + + * Create a `/routing-policy/policy-definitions/policy-definition/policy-definition` + named **'set_linkbw_0'** with the following `statements` + * statement[name='zero_linkbw']/ + * actions/bgp-actions/set-ext-community/reference/config/ext-community-set-refs = 'linkbw_0' + * actions/bgp-actions/set-ext-community/config/options = ADD + * actions/bgp-actions/set-community/config/method = REFERENCE + * actions/config/policy-result = NEXT_STATEMENT + * statement[name='accept_all_routes']/ + * actions/config/policy-result = ACCEPT_ROUTE + + * Create a `/routing-policy/policy-definitions/policy-definition/policy-definition` + named **'not_match_100_set_linkbw_1M'** with the following `statements` + * statement[name='1-megabit-match']/ + * conditions/bgp-conditions/match-community-set/config/community-set = 'regex_match_as100' + * conditions/bgp-conditions/match-community-set/config/match-set-options = INVERT + * actions/bgp-actions/set-ext-community/reference/config/ext-community-set-refs = 'linkbw_1M' + * actions/config/policy-result = NEXT_STATEMENT + * statement[name='accept_all_routes']/ + * actions/config/policy-result = ACCEPT_ROUTE + + * Create a `/routing-policy/policy-definitions/policy-definition/policy-definition` + named 'match_100_set_linkbw_2G' with the following `statements` + * statement[name='2-gigabit-match']/ + * conditions/bgp-conditions/match-community-set/config/community-set = 'regex_match_as100' + * conditions/bgp-conditions/match-community-set/config/match-set-options = ANY + * actions/bgp-actions/set-ext-community/reference/config/ext-community-set-refs = 'linkbw_2G' + * actions/config/policy-result = NEXT_STATEMENT + * statement[name='accept_all_routes']/ + * actions/config/policy-result = ACCEPT_ROUTE + + * Create a `/routing-policy/policy-definitions/policy-definition/policy-definition` + named **'del_linkbw'** with the following `statements` + * statement[name='del_linkbw']/ + * actions/bgp-actions/set-ext-community/config/options = 'REMOVE' + * actions/bgp-actions/set-ext-community/config/method = 'REFERENCE' + * actions/bgp-actions/set-ext-community/reference/config/ext-community-set-refs = 'linkbw_any' + * actions/config/policy-result = NEXT_STATEMENT + * statement[name='accept_all_routes']/ + * actions/config/policy-result = ACCEPT_ROUTE + + * Create a `/routing-policy/policy-definitions/policy-definition/policy-definition` + named 'match_linkbw_0_remove_and_set_localpref_5' with the following `statements` + * statement[name='match_and_remove_linkbw_any_0']/ + * conditions/bgp-conditions/match-ext-community-set/config/community-set = 'linkbw_any_0' + * actions/bgp-actions/set-ext-community/reference/config/ext-community-set-refs = 'linkbw_any_0' + * actions/bgp-actions/set-ext-community/config/method = 'REFERENCE' + * actions/bgp-actions/set-ext-community/config/options = 'REMOVE' + * actions/bgp-actions/config/set-local-pref = 5 + * actions/config/policy-result = NEXT_STATEMENT + * statement[name='accept_all_routes']/ + * actions/config/policy-result = ACCEPT_ROUTE + + * For each policy-definition created, run a subtest (RT-7.8.3.x-) to + * Use gnmi Set REPLACE option for: + * `/routing-policy/policy-definitions` to configure the policy + * Use `/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy` + to apply the policy on the DUT bgp neighbor to the ATE port 1. + * Verify expected communities are present in ATE. + * Verify expected communities are present in DUT state. + * Do not fail test if this path is not supported, only log results + * `/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/ext-community-index` + * `/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/ext-community-index` + + * Expected community values for each policy + | | zero_linkbw | not_match_100_set_linkbw_1M | + | ------------ | -------------------------------------- | --------------------------- | + | prefix-set-1 | [ "link-bandwidth:100:0" ] | [none] | + | prefix-set-2 | [ "100:100", "link-bandwidth:100:0" ] | [ "100:100" ] | + | prefix-set-3 | [ "link-bandwidth:100:0" ] | [ "link-bandwidth:100:0" ] | + + | | match_100_set_linkbw_2G | del_linkbw | rm_any_zero_bw_set_LocPref_5 | + | ------------ | ----------------------------------------------- | ------------- | ---------------------------- | + | prefix-set-1 | [ none ] | [none] | [none] | + | prefix-set-2 | [ "100:100", "link-bandwidth:100:2000000000" ] | [ "100:100" ] | [ "100:100" ] | + | prefix-set-3 | [ "link-bandwidth:100:0" ] | [ none ] | [ none ], localpref=5 | + + * LocalPreference + The prefixes of "prefix-set-3" matching policy "rm_any_zero_bw_set_LocPref_5" should have Local Preference value 5.\ + All other prefixes, Local Preference should be none or 100 (standard default).\ + For all other policies, Local Preference should be none or 100 (standard default) + + * Regarding prefix-set-3 and policy "nomatch_100_set_linkbw_2G" + * prefix-set-3 is advertised to the DUT with community "link-bandwidth:100:0" set. + * The DUT evaluates a match for "regex_nomatch_as100". This does not match because the regex pattern does not include the link-bandwidth community type. + * Community linkbw_2G should be added. + + * Regarding policy-definition "match_linkbw_0_remove_and_set_localpref_5" + * The link-bandwidth value 0 is interpreted by some implementation as weight "0" in WCMP group. In these implementations the remaining members distribute traffic according to weights. + * Other implementations consider value 0 invalid or not having link-bandwidth. These implementations create ECMP group with all routes including this one, and ignores link-bandwidth of all members - distribute traffic equally. + * This policy intention is to overcome this implementation difference, by deprefering (LocPref) routes with link-bandwidth 0 (only this routes) to prevent them becoming part of multipath, and remove link-bandwidth community so route will not be treated with WCMP behavior. + +## Config Parameter Coverage + +### Policy for community-set configuration + +* /routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set/config/ext-community-set-name +* /routing-policy/defined-sets/bgp-defined-sets/ext-community-sets/ext-community-set/config/community-member + +### Policy action configuration + +* /routing-policy/policy-definitions/policy-definition/config/name +* /routing-policy/policy-definitions/policy-definition/statements/statement/config/name +* /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/set-ext-community/reference/config/ext-community-set-refs + +### Policy for community-set match configuration + +* /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/config/community-set +* /routing-policy/policy-definitions/policy-definition/statements/statement/conditions/bgp-conditions/match-ext-community-set/config/match-set-options + +### Policy attachment point configuration + +* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/import-policy +* /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/config/export-policy +* /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/apply-policy/config/import-policy +* /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/apply-policy/config/export-policy + +## Telemetry Parameter Coverage + +* /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/ext-community-index +* /network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/neighbors/neighbor/adj-rib-in-post/routes/route/state/ext-community-index + +## Minimum DUT Required + +vRX - Virtual Router Device diff --git a/feature/bgp/policybase/otg_tests/link_bandwidth_test/metadata.textproto b/feature/bgp/policybase/otg_tests/link_bandwidth_test/metadata.textproto new file mode 100644 index 00000000000..13552ef78af --- /dev/null +++ b/feature/bgp/policybase/otg_tests/link_bandwidth_test/metadata.textproto @@ -0,0 +1,7 @@ +# proto-file: github.com/openconfig/featureprofiles/proto/metadata.proto +# proto-message: Metadata + +plan_id: "RT-7.5" +description: "BGP Policy - Set Link Bandwidth Community" +testbed: TESTBED_DUT_ATE_2LINKS +tags: TAGS_DATACENTER_EDGE diff --git a/testregistry.textproto b/testregistry.textproto index 0fa096ea182..a6cefee0f2e 100644 --- a/testregistry.textproto +++ b/testregistry.textproto @@ -73,18 +73,6 @@ test: { readme: "" exec: " " } -test: { - id: "CNTR-1" - description: "gNOI.Containerz" - readme: " " - exec: " " -} -test: { - id: "CNTR-2" - description: "Container networking" - readme: " " - exec: " " -} test: { id: "DP-1.10" description: "Mixed strict priority and WRR traffic test" @@ -496,7 +484,7 @@ test: { } test: { id: "RT-7.2" - description: "BGP Policy Community Set" + description: "BGP Policy Community Match and Import/Export Policy" readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/bgp/policybase/otg_tests/community_test/README.md" exec: " " } @@ -508,14 +496,14 @@ test: { } test: { id: "RT-7.4" - description: "BGP Policy AS Path Set and Community Set" + description: "BGP Policy AS Path and Community Match and Import/Export Policy" readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/bgp/policybase/otg_tests/aspath_and_community_test/README.md" exec: " " } test: { id: "RT-7.5" - description: "RT-7.5: BGP Link Bandwidth Community Forwarding" - readme: "" + description: "RT-7.5: BGP Policy - Set Link Bandwidth Community" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/bgp/policybase/otg_tests/link_bandwidth_test/README.md" exec: " " } test: { @@ -524,22 +512,16 @@ test: { readme: "" exec: " " } -test: { - id: "RT-7.7" - description: "RT-7.7: BGP Link Bandwidth Community - Set Bandwidth" - readme: " " - exec: " " -} test: { id: "RT-7.8" - description: "RT-7.8: BGP Policy - Ext Community Matching" - readme: " " + description: "BGP Policy Match and Set Standard Communities Import/Export Policy" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/bgp/policybase/otg_tests/comm_match_action_test/README.md" exec: " " } test: { id: "RT-7.9" - description: "RT-7.9: BGP Policy - Import/Export Policy Action Using Communities " - readme: " " + description: "BGP Import/Export Policy Action Using Extended Communities" + readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/bgp/policybase/otg_tests/extcomm_action_test/README.md" exec: " " } test: {