Skip to content

Commit

Permalink
Also fix ATE version of test since script is according to test plan.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankur19 committed Jun 29, 2023
1 parent 1f7e99b commit ea809c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ func configureDUT(t *testing.T, dut *ondatra.DUTDevice, p1 *ondatra.Port, p2 *on
niConfPath := gnmi.OC().NetworkInstance("VRF-10")
niConf := configNetworkInstance("VRF-10", i2, 10)
gnmi.Replace(t, dut, niConfPath.Config(), niConf)
if deviations.InterfaceConfigVRFBeforeAddress(dut) {
gnmi.Replace(t, dut, d.Interface(p2.Name()).Config(), i2)
}

// Configure default NI and forwarding policy
t.Logf("*** Configuring default instance forwarding policy on DUT ...")
Expand All @@ -140,6 +143,10 @@ func configInterfaceDUT(i *oc.Interface, me *attrs.Attributes, subIntfIndex uint
if deviations.InterfaceEnabled(dut) {
i.Enabled = ygot.Bool(true)
}
if deviations.RequireRoutedSubinterface0(dut) {
s0 := i.GetOrCreateSubinterface(0).GetOrCreateIpv4()
s0.Enabled = ygot.Bool(true)
}

// Create subinterface.
s := i.GetOrCreateSubinterface(subIntfIndex)
Expand Down Expand Up @@ -252,9 +259,10 @@ func applyForwardingPolicy(t *testing.T, ate *ondatra.ATEDevice, ingressPort, ma

intf := d.GetOrCreateNetworkInstance(deviations.DefaultNetworkInstance(dut)).GetOrCreatePolicyForwarding().GetOrCreateInterface(ingressPort)
intf.ApplyVrfSelectionPolicy = ygot.String(matchType)
if !deviations.InterfaceRefConfigUnsupported(dut) {
intf.GetOrCreateInterfaceRef().Interface = ygot.String(ingressPort)
intf.GetOrCreateInterfaceRef().Subinterface = ygot.Uint32(0)
intf.GetOrCreateInterfaceRef().Interface = ygot.String(ingressPort)
intf.GetOrCreateInterfaceRef().Subinterface = ygot.Uint32(0)
if deviations.InterfaceRefConfigUnsupported(dut) || deviations.IntfRefConfigUnsupported(dut) {
intf.InterfaceRef = nil
}
// Configure default NI and forwarding policy.
intfConfPath := gnmi.OC().NetworkInstance(deviations.DefaultNetworkInstance(dut)).PolicyForwarding().Interface(ingressPort)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const (
ipipProtocol = 4
ipv6ipProtocol = 41
ipv4Address = "198.18.0.1/32"
flowSrcIp = "198.18.0.1"
ateDestIPv4VLAN10 = "203.0.113.0/30"
ateDestIPv4VLAN20 = "203.0.113.4/30"
ateDestIPv6 = "2001:DB8:2::/64"
Expand Down Expand Up @@ -348,7 +347,7 @@ func createFlow(name string, top gosnappi.Config, dst attrs.Attributes, innerIpT
e1 := flow.Packet().Add().Ethernet()
e1.Src().SetValue(ateSrc.MAC)
v4 := flow.Packet().Add().Ipv4()
v4.Src().SetValue(flowSrcIp)
v4.Src().SetValue(ateSrc.IPv4)
v4.Dst().SetValue(dst.IPv4)
if innerIpType == "IPv4" {
flow.Packet().Add().Ipv4()
Expand Down

0 comments on commit ea809c0

Please sign in to comment.