-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RT-1.27: fixed failed tests #3613
base: main
Are you sure you want to change the base?
Conversation
Pull Request Functional Test Report for #3613 / 9f18c0dVirtual Devices
Hardware Devices
|
@@ -221,7 +224,7 @@ func configureDUTBGP(t *testing.T, dut *ondatra.DUTDevice) { | |||
t.Helper() | |||
|
|||
dutOcRoot := &oc.Root{} | |||
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") | |||
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "default") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo this should be a map[string]string variable lookup to enable per-vendor naming schema.
or a deviation-based lookup, similar to how the "static" protocol is currently defined (static_protocol_name
).
cc @dplore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reference to default network instance should be implemented using deviations.DefaultNetworkInstance()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dplore , just to be sure, are you suggesting the code to change like this :
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, deviations.DefaultNetworkInstance(dut))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reference to default network instance should be implemented using deviations.DefaultNetworkInstance()
I think this change is about the BGP protocol instance naming (seems that some implementations use BGP
, while other require the name default
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see, the current code is already using deviations.DefaultNetworkInstance(dut) for the network instance name. This change is about the bgp instance name. (thanks for pointing that out @LimeHat)
The OC default for this leaf is DEFAULT
. Since this test does not require using a non-default name, the device is expected to use DEFAULT
.
The need to use a name which is not DEFAULT
should be via a deviation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, still waiting to see a deviation specifically for cisco added to use this non-standard bgp protocol instance name of default
...ution/otg_tests/static_route_bgp_redistribution_test/static_route_bgp_redistribution_test.go
Show resolved
Hide resolved
Pull Request Test Coverage Report for Build 12431277691Details
💛 - Coveralls |
@singh-prem can you resolve the conflicts and also rebase the checks |
@@ -235,7 +238,7 @@ func configureDUTBGP(t *testing.T, dut *ondatra.DUTDevice) { | |||
|
|||
// setup BGP | |||
networkInstance := dutOcRoot.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)) | |||
networkInstanceProtocolBgp := networkInstance.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") | |||
networkInstanceProtocolBgp := networkInstance.GetOrCreateProtocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "default") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, introduce a deviation for the BGP instance name. The standard should be "DEFAULT"
and the deviation can be whatever you supply, specific for your NOS requirement.
@@ -320,13 +323,19 @@ func configureDUT(t *testing.T, dut *ondatra.DUTDevice) { | |||
func awaitBGPEstablished(t *testing.T, dut *ondatra.DUTDevice, neighbors []string) { | |||
for _, neighbor := range neighbors { | |||
gnmi.Await(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)). | |||
Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP"). | |||
Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "default"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, introduce a deviation for the BGP instance name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also suggest to use utility method to configure default network instance
fptest.ConfigureDefaultNetworkInstance from the cfgplugin utility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ram-mac , FYI: as noted above, this is the bgp protocol instance name, not the network-instance name. But yes, a new deviation for Cisco is needed to set the bgp protocol instance name
@@ -479,6 +489,17 @@ func configureTableConnection(t *testing.T, dut *ondatra.DUTDevice, isV4, mPropa | |||
} | |||
|
|||
batchSet.Set(t, dut) | |||
if deviations.TcMetricPropagationUnsupported(dut) { | |||
med := medZero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use switch dut.Vendor() format. See the requirements for deviations at:
featureprofiles/internal/deviations/README.md
Lines 182 to 187 in f80fb73
if deviations.RequiredOCNotSupported(t, dut) { | |
switch dut.Vendor() { | |
case ondatra.VENDOR_X: | |
configureDeviceUsingCli(t, dut, vendorXConfig) | |
} | |
} |
(This is because the CLI you are adding is specific to Cisco. Other vendors may also use this deviation, but with their own CLI)
med = medIPv6 | ||
} | ||
} | ||
setMetricViaCLI(t, dut, isV4, med, importPolicy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setMetricViaCLI(t, dut, isV4, med, importPolicy) | |
setMetricViaCiscoCLI(t, dut, isV4, med, importPolicy) |
helpers.GnmiCLIConfig(t, dut, cliConfig) | ||
} | ||
|
||
func setMetricViaCLI(t *testing.T, dut *ondatra.DUTDevice, isV4 bool, metric int, routePolicyName string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this functon to a new file in internal/cfgplugins such as tableconnections.go
Suggest renaming the function to DeviationCiscoTableConnectionsBGPtoStaticMetricPropagation
or similar.
Add a description such as:
This function is used as an alternative to /network-instances/network-instance/table-connections/table-connection/config/disable-metric-propagation
. In OC this path is set to 'false' by default, therefore enabling table-connections to propagate metrics from one protocol to another. This deviation implements CLI to perform the equivalent function.
if deviations.BgpCommunitySetRefsUnsupported(dut) { | ||
setCommunityViaCLI(t, dut, redistributeStaticPolicyName, policyStatementName, communitySetName) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use switch dut.Vendor() format. See the requirements for deviations at:
featureprofiles/internal/deviations/README.md
Lines 182 to 187 in f80fb73
if deviations.RequiredOCNotSupported(t, dut) { | |
switch dut.Vendor() { | |
case ondatra.VENDOR_X: | |
configureDeviceUsingCli(t, dut, vendorXConfig) | |
} | |
} |
(This is because the CLI you are adding is specific to Cisco. Other vendors may also use this deviation, but with their own CLI)
if deviations.TcAttributePropagationUnsupported(dut) { | ||
setAttributeViaCLI(t, dut, redistributeStaticPolicyNameV6, "statement-v6", "prefix-set-v6", medIPv6, "igp") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use switch dut.Vendor() format. See the requirements for deviations at:
featureprofiles/internal/deviations/README.md
Lines 182 to 187 in f80fb73
if deviations.RequiredOCNotSupported(t, dut) { | |
switch dut.Vendor() { | |
case ondatra.VENDOR_X: | |
configureDeviceUsingCli(t, dut, vendorXConfig) | |
} | |
} |
(This is because the CLI you are adding is specific to Cisco. Other vendors may also use this deviation, but with their own CLI)
time.Sleep(15 * time.Second) | ||
|
||
_, ok := gnmi.WatchAll(t, ate.OTG(), gnmi.OTG().BgpPeer(bgpPeerName).UnicastIpv4PrefixAny().State(), | ||
time.Minute, func(v *ygnmi.Value[*otgtelemetry.BgpPeer_UnicastIpv4Prefix]) bool { | ||
return v.IsPresent() | ||
}).Await(t) | ||
|
||
if !ok { | ||
t.Errorf("No BGP prefixes learnt") | ||
} | ||
|
||
bgpPrefixes := gnmi.GetAll(t, ate.OTG(), gnmi.OTG().BgpPeer(bgpPeerName).UnicastIpv4PrefixAny().State()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using sleep instead of gnmi Watch Await is an anti-pattern. Why does gnmi Await not work on Cisco? Please remove this.
time.Sleep(5 * time.Second) | ||
time.Sleep(15 * time.Second) | ||
|
||
bgpPrefixes := gnmi.GetAll[*otgtelemetry.BgpPeer_UnicastIpv6Prefix](t, ate.OTG(), gnmi.OTG().BgpPeer(bgpPeerName).UnicastIpv6PrefixAny().State()) | ||
bgpPrefixEntries := gnmi.LookupAll[*otgtelemetry.BgpPeer_UnicastIpv6Prefix](t, ate.OTG(), gnmi.OTG().BgpPeer(bgpPeerName).UnicastIpv6PrefixAny().State()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be refactored to use gnmi watch await
@@ -827,6 +866,57 @@ func redistributeIPv4PrefixRoutePolicy(t *testing.T, dut *ondatra.DUTDevice, ate | |||
verifyTraffic(t, ate, otgConfig) | |||
} | |||
|
|||
func setAttributeViaCLI(t *testing.T, dut *ondatra.DUTDevice, policyName string, statement string, prefixSetName string, setMed int, origin string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this function to a new file in internal/cfgplugins in bgp_policy.go
Suggest renaming the function to DeviationCiscoRoutingPolicyBGPActionSetMed
or similar.
Add a description such as:
This function is used as an alternative to /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med. This deviation implements CLI to perform the equivalent function.
There are some other changes for the same test - #3444 |
@@ -221,7 +224,7 @@ func configureDUTBGP(t *testing.T, dut *ondatra.DUTDevice) { | |||
t.Helper() | |||
|
|||
dutOcRoot := &oc.Root{} | |||
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP") | |||
bgpPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "default") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, still waiting to see a deviation specifically for cisco added to use this non-standard bgp protocol instance name of default
@@ -320,13 +323,19 @@ func configureDUT(t *testing.T, dut *ondatra.DUTDevice) { | |||
func awaitBGPEstablished(t *testing.T, dut *ondatra.DUTDevice, neighbors []string) { | |||
for _, neighbor := range neighbors { | |||
gnmi.Await(t, dut, gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)). | |||
Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP"). | |||
Protocol(oc.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "default"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ram-mac , FYI: as noted above, this is the bgp protocol instance name, not the network-instance name. But yes, a new deviation for Cisco is needed to set the bgp protocol instance name
We'll have to review these PR's one at a time unfortunately. I am giving this PR (#3613) priority for review first. After #3613 is merged, then #3444 will need to merge to mater and resolve and conflicts |
This PR contains following: