Skip to content

Commit

Permalink
P4RT 2.1 - Script updated to add interface type to DUT (#1170)
Browse files Browse the repository at this point in the history
* update to add interface type to DUT

* updated to inline the interface type to DUT

* updating to remove extra gnmi.replace

* updating to fix field indentation match
  • Loading branch information
mitaliy authored Mar 2, 2023
1 parent ec4f386 commit 06a9369
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,17 @@ func configureDeviceId(t *testing.T, dut *ondatra.DUTDevice) {
gnmi.Replace(t, dut, gnmi.OC().Component(p4rtNode).Config(), &c)
}

// configurePortId configures p4rt port-id on the DUT.
// configurePortId configures p4rt port-id and interface type on the DUT.
func configurePortId(t *testing.T, dut *ondatra.DUTDevice) {
d := gnmi.OC()
portName := dut.Port(t, "port1").Name()
gnmi.Replace(t, dut, gnmi.OC().Interface(portName).Id().Config(), portId)
currIntf := &oc.Interface{
Name: ygot.String(portName),
Type: oc.IETFInterfaces_InterfaceType_ethernetCsmacd,
Id: &portId,
}
gnmi.Replace(t, dut, d.Interface(portName).Config(), currIntf)

}

// Create client connection
Expand Down

0 comments on commit 06a9369

Please sign in to comment.