openconfig / featureprofiles

Feature Profiles are groups of OpenConfig paths and tests which verify their behavior
Apache License 2.0
48 stars 138 forks source link

Replace being used to delete configuration in RT1.2 #389

Open singh-prem opened 2 years ago

singh-prem commented 2 years ago

Testcase RT1.2 is currently using replace for deleting configuration which is against gnmi spec.

dutConfPath := dut.Config().NetworkInstance(*deviations.DefaultNetworkInstance).Protocol(telemetry.PolicyTypes_INSTALL_PROTOCOL_TYPE_BGP, "BGP").Bgp()
dutConfPath.Replace(t, nil)

Line 395 in [f4f5615](https://github.com/openconfig/featureprofiles/commit/f4f5615e33871f5d0de67ff5a53e342c01937b8e)

dutConfPath.Replace(t, nil) GNMI spec says: replace MUST not be used as a way to delete configuration at the path specified by being supplied with a null or invalid value. For example, if the boolean b is provided a nil value instead of a boolean value, the target MUST reject this operation by returning INVALID_ARGUMENT.

https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#344-modes-of-update-replace-versus-update

dplore commented 2 years ago

THanks for catching this @singh-prem . Would you like to submit a PR to fix this?

singh-prem commented 2 years ago

sure will fix this @dplore. You could assign this to me.

singh-prem commented 2 years ago

Raised https://github.com/openconfig/featureprofiles/pull/406 to fix this