Content-Length: 260730 | pFad | http://github.com/google/gnxi/issues/374

C1 oc_config_validate: Support set-replace operations · Issue #374 · google/gnxi · GitHub
Skip to content
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

oc_config_validate: Support set-replace operations #374

Open
xavier-contreras opened this issue May 21, 2024 · 5 comments
Open

oc_config_validate: Support set-replace operations #374

xavier-contreras opened this issue May 21, 2024 · 5 comments

Comments

@xavier-contreras
Copy link
Contributor

Currently tests are hardcoded to use set-update logic, eg:

It would be great if they could support set-replace as well.

This would particularly be useful / important for the init config -- perhaps that can be the first gap to address:

Vendors do not always implement these functions well so they are good to test, or certain bugs are triggered based on which method is used.

@JoseIgnacioTamayo
Copy link
Contributor

Ack, somehow we should also offer the possibility to validate configuration changes using SetReplace.

A little background: Set and SetGet tests have the intention to validate that small and puntual config changes happen successfully, with minimal impact to other configuration elements. SetUpdate allows to apply a configuration change without affecting other elements not mentioned in the config blob. Also, SetUpdate is used for the InitialConfig so that only the elements in the provided config are applied, leaving all other elements as they are. Using SetUpdate allows to only change what `oc_config_validate' is told to change.

If we use SetReplace for InitialConfigs, users then would need to provide a larger JSON config, possibly containing elements not related to the tests (If by accident a leaf of container is omitted, it will either be reset to default or deleted).

An approach is to create specifig Testcase Classes SetReplaceGet*, similar to SetGet* that use the SetReplace method, and for those testcases it is clear what behaviour to expect from the Target (keeping the SetGet Testcases with SetUpdate)

The objective of oc_config_validate is to validate that configuration changes with gNMI are correct. oc_config_validate does not intend to validate that gNMI implementations comply with the specification. In that sense, as there are configuration workflows that would use SetReplace specifically, I propose we add specifig Testcases and keep the current behavior for InitialConfigs (to avoid needing larger JSON blobs, or accidentally changing elements not related to the tests)

@xavier-contreras
Copy link
Contributor Author

Agreed with creating Testcase Classes like SetReplaceGet and leaving current behavior for others as is.

I still think an option to set replace the init config makes sense. Consider the following sequence of events when init is sent as update, assuming a continuous testing scenario. These tests could be telemetry, expecting certain update counts, leafs, etc.

testgroup.yaml - run at 12PM

  1. Init config with interface 1
  2. Test that validates interfaces, expecting 1
  3. Test that adds interface 2
  4. Test that validates interfaces, expecting 2

testgroup.yaml - run at 1PM

  1. Init config with interface 1
  2. Test that validates interfaces, expecting 1 <--this now fails
  3. Test that adds interface 2
  4. Test that validates interfaces, expecting 2

@JoseIgnacioTamayo
Copy link
Contributor

Ack, I see the need for controlling how the intiial config is applied.

ActionItems:

  • Option to control the initial config set method: --init-set-method, defaults to update
  • Testcases that specifically use the SetReplace method

JoseIgnacioTamayo added a commit to JoseIgnacioTamayo/gnxi that referenced this issue Jun 1, 2024
--init_set_replace

google#374

Also do small formatting improvements.
JoseIgnacioTamayo added a commit to JoseIgnacioTamayo/gnxi that referenced this issue Jun 3, 2024
--init_set_replace

google#374

Also do small formatting improvements.
mike-albano pushed a commit that referenced this issue Jun 5, 2024
* Add option to use SetReplace for init configs.

--init_set_replace

#374

Also do small formatting improvements.

* Linting and typing errors fix

* Add additional init configs to check SetReplace.

There are 2 overlapping init configs applied. When SetReplace, some Tests fail because the last init config deletes what the previous did.

* Increase oc_config_validate version to 2.6.2
@JoseIgnacioTamayo
Copy link
Contributor

I wrote the 2nd part of this Issue: #386

@JoseIgnacioTamayo
Copy link
Contributor

Closing the feature request as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/google/gnxi/issues/374

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy