Skip to content

Commit

Permalink
Use fixed source MAC address for traffic in P4RT-5.1 OTG test (openco…
Browse files Browse the repository at this point in the history
  • Loading branch information
jasdeep-hundal authored and frasieroh committed Jul 27, 2023
1 parent 00efeea commit c16debb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func testPacketIn(ctx context.Context, t *testing.T, args *testArgs, isIPv4 bool
if etherType != layers.EthernetTypeIPv4 && etherType != layers.EthernetTypeIPv6 {
continue
}
if !strings.EqualFold(srcMAC, atePort1.MAC) {
if !strings.EqualFold(srcMAC, tracerouteSrcMAC) {
continue
}
if wantPacket.TTL != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
var (
p4InfoFile = flag.String("p4info_file_location", "../../wbb.p4info.pb.txt", "Path to the p4info file.")
streamName = "p4rt"
tracerouteSrcMAC = "00:01:00:02:00:03"
deviceID = uint64(1)
portId = uint32(10)
electionId = uint64(100)
Expand Down Expand Up @@ -347,7 +348,7 @@ func (traceroute *TraceroutePacketIO) GetTrafficFlow(ate *ondatra.ATEDevice, dst
flow := gosnappi.NewFlow()
flow.SetName("IP4")
ethHeader := flow.Packet().Add().Ethernet()
ethHeader.Src().SetValue(atePort1.MAC)
ethHeader.Src().SetValue(tracerouteSrcMAC)
ethHeader.Dst().SetValue(dstMac)
ipHeader := flow.Packet().Add().Ipv4()
ipHeader.Src().SetValue(atePort1.IPv4)
Expand All @@ -361,7 +362,7 @@ func (traceroute *TraceroutePacketIO) GetTrafficFlow(ate *ondatra.ATEDevice, dst
flow := gosnappi.NewFlow()
flow.SetName("IP6")
ethHeader := flow.Packet().Add().Ethernet()
ethHeader.Src().SetValue(atePort1.MAC)
ethHeader.Src().SetValue(tracerouteSrcMAC)
ethHeader.Dst().SetValue(dstMac)
ipv6Header := flow.Packet().Add().Ipv6()
ipv6Header.Src().SetValue(atePort1.IPv6)
Expand Down

0 comments on commit c16debb

Please sign in to comment.