diff --git a/feature/experimental/p4rt/tests/p4rt_election/p4rt_election_test.go b/feature/experimental/p4rt/tests/p4rt_election/p4rt_election_test.go index eb662944c32..39d3d29cd01 100644 --- a/feature/experimental/p4rt/tests/p4rt_election/p4rt_election_test.go +++ b/feature/experimental/p4rt/tests/p4rt_election/p4rt_election_test.go @@ -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