Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gNMI-1.10 - Changes for Vendor specific component names#652

Merged
thesrinath merged 22 commits into
openconfig:mainfrom
agvarghe-cisco:component_vendor_name
Feb 15, 2023
Merged

gNMI-1.10 - Changes for Vendor specific component names#652
thesrinath merged 22 commits into
openconfig:mainfrom
agvarghe-cisco:component_vendor_name

Conversation

@agvarghe-cisco

Copy link
Copy Markdown
Contributor

Changes for Vendor specific component names

@agvarghe-cisco agvarghe-cisco requested a review from a team as a code owner October 18, 2022 11:54
@coveralls

coveralls commented Oct 18, 2022

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 4187548594

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 57.219%

Totals Coverage Status
Change from base Build 4185323784: 0.0%
Covered Lines: 1181
Relevant Lines: 2064

💛 - Coveralls

@agvarghe-cisco agvarghe-cisco changed the title Changes for Vendor specific component names gNMI-1.10 - Changes for Vendor specific component names Oct 18, 2022
@xw-g

xw-g commented Oct 21, 2022

Copy link
Copy Markdown
Collaborator

maybe @dplore and @bstoll can help share opinions about handling vendor names?

"Supervisor": "Chassis",
"SwitchChip": "Linecard",
},
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a default component list and a vendor specific list? With this change we are restricting only to ARISTA and CISCO

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code should be refactored to find components by the openconfig defined types. For example, a NOS (network operating system) should use the appropriate type for their CONTROLLER_CARD and will use a NOS specific 'name' value for the. (routing-engine vs. supervisor, etc).

https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-platform.html#openconfig-platform-types-identities

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example code to look up component name based on component identity (type):

func FindComponentsByType(t *testing.T, dut *ondatra.DUTDevice, cType oc.E_PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT) []string {
components := gnmi.GetAll[*oc.Component](t, dut, gnmi.OC().ComponentAny().State())
var s []string
for _, c := range components {
if c.GetType() == nil {
t.Logf("Component %s type is missing from telemetry", c.GetName())
continue
}
t.Logf("Component %s has type: %v", c.GetName(), c.GetType())
switch v := c.GetType().(type) {
case oc.E_PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT:
if v == cType {
s = append(s, c.GetName())
}
default:
t.Logf("Detected non-hardware component: (%T, %v)", c.GetType(), c.GetType())
}
}
return s
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dplore , Changed to using FindComponentsByType

@prinikasn prinikasn requested review from vosipchu and removed request for hariramnat January 10, 2023 17:09

@prinikasn prinikasn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the regex under subtest TestSupervisorLastRebootInfo also need to be updated?


r := regexp.MustCompile("^CPU")
supervisorMap := map[ondatra.Vendor]string{
ondatra.ARISTA: "^Supervisor[0-9]",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldnt this be "^CPU" ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a lookup for a component with identity "CPU". Supervisor is an Arista EOS name for an OpenConfig "CONTROLLER_CARD".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar discussions in #829

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CPU for CPU component

@agvarghe-cisco agvarghe-cisco requested a review from a team January 12, 2023 06:53
t.Fatalf("Get CPU list for %q: got 0, want > 0", dut.Model())
}
cpus := components.FindComponentsByType(t, dut, cpuType)
t.Logf("Found card list: %v", cpus)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. "Found CPU list" ? Since this is looking for CPU?

if len(cpus) == 0 {
t.Fatalf("Get CPU list for %q: got 0, want > 0", dut.Model())
}
cpus := components.FindComponentsByType(t, dut, cpuType)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should we keep the check for cpus length here? It seems right now if there is some error and 0 CPU found, this test will pass w/o actually testing anything (which is not ideal)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sim. applicable for all len check in other subtests

linecardType = oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_LINECARD
powerSupplyType = oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_POWER_SUPPLY
fabricType = oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC
fabricChipType = oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FRU

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't fabric chip type be "integrated circuit" ?

@agvarghe-cisco agvarghe-cisco requested review from aaronmillisor and prinikasn and removed request for aaronmillisor January 25, 2023 10:57
@xw-g xw-g requested review from Hobbydos and removed request for aaronmillisor February 7, 2023 17:16
@xw-g

xw-g commented Feb 7, 2023

Copy link
Copy Markdown
Collaborator

@MarcCharlebois can you help review it for Nokia? Thanks.

@MarcCharlebois

MarcCharlebois commented Feb 10, 2023

Copy link
Copy Markdown
Contributor

@MarcCharlebois can you help review it for Nokia? Thanks.

Perhaps not specifically to this PR, but relating to this test. In this replace, there's no value set in /components/component[name="whatevername"]/config/name, other p4rt tests handle that.

gnmi.Replace(t, dut, gnmi.OC().Component(*p4rtNodeName).IntegratedCircuit().Config(), ic)

My suggestion is to replace how the component is created and update the Replace call for the comp

func TestP4rtNodeID(t *testing.T) {
	// TODO: add p4rtNodeName to Ondatra's netutil
	dut := ondatra.DUT(t, "dut")
	d := &oc.Root{}
	comp := d.GetOrCreateComponent(*p4rtNodeName)
	comp.Name = ygot.String(*p4rtNodeName)
	ic := comp.GetOrCreateIntegratedCircuit()

			gnmi.Replace(t, dut, gnmi.OC().Component(*p4rtNodeName).Config(), comp)

If required, I can raise a PR for that - else we can take care of it in this one.

)

const (
chasisType = oc.PlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CHASSIS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix typo for chassis

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected

@guoshiuan

Copy link
Copy Markdown
Contributor

/gcbrun

@guoshiuan

Copy link
Copy Markdown
Contributor

The internal test result: b/264892365.

@thesrinath

Copy link
Copy Markdown
Contributor

/gcbrun

@thesrinath thesrinath merged commit 5e1e9ec into openconfig:main Feb 15, 2023
vbhan-cisco added a commit to agvarghe-cisco/featureprofiles that referenced this pull request Feb 21, 2023
* Changes for Vendor specific component names

* Review comments

* Review comments

* Review comments

* Changing fabric chip type as integrated circuit

* Add check for switchchip and fabricchip parent component

* Modifying parent component check

* Optimize run time

* Changes to p4rt test

* Fix Typo

---------

Co-authored-by: vbhan-cisco <[email protected]>
jasdeep-hundal added a commit to jasdeep-hundal/featureprofiles that referenced this pull request Apr 11, 2023
jasdeep-hundal added a commit to jasdeep-hundal/featureprofiles that referenced this pull request Apr 12, 2023
jasdeep-hundal added a commit that referenced this pull request Apr 19, 2023
)

* Replicate PR545/546 in OTG telemetry basic test

References:
- #545
- #546

* Replicate PR642 in OTG telemetry basic test

Reference: #642

* Replicate PR890 in OTG telemetry basic test

Reference: #890

* Replicate PR1025 in OTG telemetry basic test

Reference: #1025

* Replicate PR652 in OTG telemetry basic test

Reference: #652

* Replicate PR1196 in OTG telemetry basic test

Reference: #1196

* Replicate PR1195 in OTG telemetry basic test

Reference: #1195

* Replicate PR1211 in OTG telemetry basic test

Reference: #1211

* Replicate PR1248 in OTG telemetry basic test

Reference: #1248

* Replicate PR1212 in OTG telemetry basic test

Reference: #1212

* Replicate PR1317 in OTG telemetry basic test

Reference: #1317

* Remove extra subintf enabled bit not guarded by correct deviations
prinikasn pushed a commit that referenced this pull request Jun 30, 2023
* Changes for Vendor specific component names

* Review comments

* Review comments

* Review comments

* Changing fabric chip type as integrated circuit

* Add check for switchchip and fabricchip parent component

* Modifying parent component check

* Optimize run time

* Changes to p4rt test

* Fix Typo

---------

Co-authored-by: vbhan-cisco <[email protected]>
prinikasn pushed a commit that referenced this pull request Jun 30, 2023
)

* Replicate PR545/546 in OTG telemetry basic test

References:
- #545
- #546

* Replicate PR642 in OTG telemetry basic test

Reference: #642

* Replicate PR890 in OTG telemetry basic test

Reference: #890

* Replicate PR1025 in OTG telemetry basic test

Reference: #1025

* Replicate PR652 in OTG telemetry basic test

Reference: #652

* Replicate PR1196 in OTG telemetry basic test

Reference: #1196

* Replicate PR1195 in OTG telemetry basic test

Reference: #1195

* Replicate PR1211 in OTG telemetry basic test

Reference: #1211

* Replicate PR1248 in OTG telemetry basic test

Reference: #1248

* Replicate PR1212 in OTG telemetry basic test

Reference: #1212

* Replicate PR1317 in OTG telemetry basic test

Reference: #1317

* Remove extra subintf enabled bit not guarded by correct deviations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.