Skip to content

Commit

Permalink
RT-5.8: Update configureDUTLinkLocalInterface()
Browse files Browse the repository at this point in the history
Update configureDUTLinkLocalInterface() to
enable ipv4 if InterfaceEnabled deviation exists and
ipv4 is not enabled,
  • Loading branch information
yini101 committed May 3, 2024
1 parent 2ef8bf6 commit 3b9501a
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,22 @@ func configureDUTLinkLocalInterface(t *testing.T, dut *ondatra.DUTDevice) {
p1 := dut.Port(t, "port1")
srcIntf := dutSrc.NewOCInterface(p1.Name(), dut)
subInt := srcIntf.GetOrCreateSubinterface(0)
subInt4 := subInt.GetOrCreateIpv4()
if deviations.InterfaceEnabled(dut) && !deviations.IPv4MissingEnabled(dut) {
subInt4.Enabled = ygot.Bool(true)
}
subInt.GetOrCreateIpv6().Enabled = ygot.Bool(true)
subInt.GetOrCreateIpv6().GetOrCreateAddress(dutSrc.IPv6).SetType(oc.IfIp_Ipv6AddressType_LINK_LOCAL_UNICAST)
gnmi.Replace(t, dut, gnmi.OC().Interface(p1.Name()).Config(), srcIntf)

p2 := dut.Port(t, "port2")
dstIntf := dutDst.NewOCInterface(p2.Name(), dut)
dstSubInt := dstIntf.GetOrCreateSubinterface(0)
dstSubInt4 := dstSubInt.GetOrCreateIpv4()
dstSubInt.GetOrCreateIpv6().Enabled = ygot.Bool(true)
if deviations.InterfaceEnabled(dut) && !deviations.IPv4MissingEnabled(dut) {
dstSubInt4.Enabled = ygot.Bool(true)
}
dstSubInt.GetOrCreateIpv6().GetOrCreateAddress(dutDst.IPv6).SetType(oc.IfIp_Ipv6AddressType_LINK_LOCAL_UNICAST)
gnmi.Replace(t, dut, gnmi.OC().Interface(p2.Name()).Config(), dstIntf)
if deviations.ExplicitInterfaceInDefaultVRF(dut) {
Expand Down

0 comments on commit 3b9501a

Please sign in to comment.