afts_prefix_filtering_dynamic - openconfig/featureprofiles GitHub Wiki
This test validates that the AFT filter dynamically responds to changes in the underlying prefix sets without requiring a re-binding of the policy itself. Both IPv4 and IPv6 prefix-set modifications are covered.
See AFT-6.1 for common test setup and policy definitions.
Use the test environment and routing policies described in AFT-6.1.
- Configure
POLICY-PREFIX-SET-Awhich referencesPREFIX-SET-A. - Set the global filter
ipv4-policytoPOLICY-PREFIX-SET-A. - Ensure the DUT has static routes for
198.51.100.0/24and203.0.113.0/28. - Establish a gNMI subscription and wait for
SYNC.
- Configure
POLICY-PREFIX-SET-Bwhich referencesPREFIX-SET-B. - Set the global filter
ipv6-policytoPOLICY-PREFIX-SET-B. - Ensure the DUT has static routes for
2001:DB8:2::/64and2001:DB8:2::1/128. - Establish a gNMI subscription and wait for
SYNC.
- Add a new prefix
192.0.2.0/24toPREFIX-SET-Aon the DUT. - Ensure the DUT has a RIB/AFT entry for
192.0.2.0/24. - Verify receipt of a gNMI update notification for
192.0.2.0/24.
- Remove prefix
198.51.100.0/24fromPREFIX-SET-Aon the DUT. - Verify receipt of a gNMI delete notification for
198.51.100.0/24, even though the route still exists in the DUT's RIB/AFT.
- Perform an atomic gNMI update to
PREFIX-SET-A:- Add
198.51.100.0/24back to the set. - Remove
203.0.113.0/28from the set.
- Add
- Verify receipt of an update for
198.51.100.0/24and a delete for203.0.113.0/28.
- Add a new prefix
2001:DB8:2::2/128toPREFIX-SET-Bon the DUT. - Ensure the DUT has a RIB/AFT entry for
2001:DB8:2::2/128. - Verify receipt of a gNMI update notification for
2001:DB8:2::2/128.
- Remove prefix
2001:DB8:2::/64fromPREFIX-SET-Bon the DUT. - Verify receipt of a gNMI delete notification for
2001:DB8:2::/64, even though the route still exists in the DUT's RIB/AFT.
- Perform an atomic gNMI update to
PREFIX-SET-B:- Add
2001:DB8:2::/64back to the set. - Remove
2001:DB8:2::1/128from the set.
- Add
- Verify receipt of an update for
2001:DB8:2::/64and a delete for2001:DB8:2::1/128.
paths:
# Global filter config/state paths
/network-instances/network-instance/afts/global-filter/config/ipv4-policy:
/network-instances/network-instance/afts/global-filter/config/ipv6-policy:
/network-instances/network-instance/afts/global-filter/state/ipv4-policy:
/network-instances/network-instance/afts/global-filter/state/ipv6-policy:
# Standard AFT state paths
/network-instances/network-instance/afts/ipv4-unicast/ipv4-entry/state/prefix:
/network-instances/network-instance/afts/ipv4-unicast/ipv4-entry/state/next-hop-group:
/network-instances/network-instance/afts/ipv6-unicast/ipv6-entry/state/prefix:
/network-instances/network-instance/afts/ipv6-unicast/ipv6-entry/state/next-hop-group:
/network-instances/network-instance/afts/next-hop-groups/next-hop-group/state/id:
/network-instances/network-instance/afts/next-hop-groups/next-hop-group/next-hops/next-hop/state/index:
/network-instances/network-instance/afts/next-hops/next-hop/state/index:
/network-instances/network-instance/afts/next-hops/next-hop/state/ip-address:
# Paths for configuring prefix-sets
/routing-policy/defined-sets/prefix-sets/prefix-set/config/name:
/routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/ip-prefix:
/routing-policy/defined-sets/prefix-sets/prefix-set/prefixes/prefix/config/masklength-range:
rpcs:
gnmi:
gNMI.Subscribe:
STREAM: true
ON_CHANGE: true
gNMI.Set:
REPLACE: true
UPDATE: true
DELETE: trueSee AFT-6.1 for the full
canonical OpenConfig configuration. This test uses PREFIX-SET-A,
PREFIX-SET-B, and their associated policies as defined there.
{
"routing-policy": {
"defined-sets": {
"prefix-sets": {
"prefix-set": [
{
"name": "PREFIX-SET-A",
"config": {
"name": "PREFIX-SET-A"
},
"prefixes": {
"prefix": [
{
"ip-prefix": "198.51.100.0/24",
"masklength-range": "exact",
"config": {
"ip-prefix": "198.51.100.0/24",
"masklength-range": "exact"
}
},
{
"ip-prefix": "203.0.113.0/28",
"masklength-range": "exact",
"config": {
"ip-prefix": "203.0.113.0/28",
"masklength-range": "exact"
}
},
{
"ip-prefix": "198.51.100.1/32",
"masklength-range": "exact",
"config": {
"ip-prefix": "198.51.100.1/32",
"masklength-range": "exact"
}
}
]
}
},
{
"name": "PREFIX-SET-B",
"config": {
"name": "PREFIX-SET-B"
},
"prefixes": {
"prefix": [
{
"ip-prefix": "2001:DB8:2::/64",
"masklength-range": "exact",
"config": {
"ip-prefix": "2001:DB8:2::/64",
"masklength-range": "exact"
}
},
{
"ip-prefix": "2001:DB8:2::1/128",
"masklength-range": "exact",
"config": {
"ip-prefix": "2001:DB8:2::1/128",
"masklength-range": "exact"
}
}
]
}
}
]
}
},
"policy-definitions": {
"policy-definition": [
{
"name": "POLICY-PREFIX-SET-A",
"config": {
"name": "POLICY-PREFIX-SET-A"
},
"statements": {
"statement": [
{
"name": "10",
"config": { "name": "10" },
"conditions": {
"match-prefix-set": {
"config": {
"prefix-set": "PREFIX-SET-A",
"match-set-options": "ANY"
}
}
},
"actions": {
"config": { "policy-result": "ACCEPT_ROUTE" }
}
}
]
}
},
{
"name": "POLICY-PREFIX-SET-B",
"config": {
"name": "POLICY-PREFIX-SET-B"
},
"statements": {
"statement": [
{
"name": "10",
"config": { "name": "10" },
"conditions": {
"match-prefix-set": {
"config": {
"prefix-set": "PREFIX-SET-B",
"match-set-options": "ANY"
}
}
},
"actions": {
"config": { "policy-result": "ACCEPT_ROUTE" }
}
}
]
}
}
]
}
}
}FFF (Fixed Form Factor) or MFF (Modular Form Factor).