Skip to content

Commit

Permalink
Remove ttl deviation code (openconfig#3751)
Browse files Browse the repository at this point in the history
* remove ttl deviation code

* removed unsed dut variable

---------

Co-authored-by: Pramod Maurya <[email protected]>
  • Loading branch information
xw-g and self-maurya authored Feb 7, 2025
1 parent 6e572e2 commit bc105a4
Show file tree
Hide file tree
Showing 8 changed files with 1,207 additions and 1,210 deletions.
8 changes: 3 additions & 5 deletions feature/gribi/otg_tests/basic_encap_test/basic_encap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,9 @@ func validatePacketCapture(t *testing.T, args *testArgs, otgPortNames []string,
t.Errorf("Dscp value mismatch, got %d, want %d", got, pa.dscp)
break
}
if !deviations.TTLCopyUnsupported(args.dut) {
if got := uint32(v4Packet.TTL); got != pa.ttl {
t.Errorf("TTL mismatch, got: %d, want: %d", got, pa.ttl)
break
}
if got := uint32(v4Packet.TTL); got != pa.ttl {
t.Errorf("TTL mismatch, got: %d, want: %d", got, pa.ttl)
break
}
if v4Packet.DstIP.String() == tunnelDstIP1 {
tunnel1Pkts++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1620,17 +1620,14 @@ func captureAndValidatePackets(t *testing.T, args *testArgs, packetVal *packetVa

func validateTrafficTTL(t *testing.T, packetSource *gopacket.PacketSource) {
t.Helper()
dut := ondatra.DUT(t, "dut")
var packetCheckCount uint32 = 0
for packet := range packetSource.Packets() {
ipLayer := packet.Layer(layers.LayerTypeIPv4)
if ipLayer != nil && packetCheckCount <= 3 {
packetCheckCount++
ipPacket, _ := ipLayer.(*layers.IPv4)
if !deviations.TTLCopyUnsupported(dut) {
if ipPacket.TTL != correspondingTTL {
t.Errorf("IP TTL value is altered to: %d", ipPacket.TTL)
}
if ipPacket.TTL != correspondingTTL {
t.Errorf("IP TTL value is altered to: %d", ipPacket.TTL)
}
innerPacket := gopacket.NewPacket(ipPacket.Payload, ipPacket.NextLayerType(), gopacket.Default)
ipInnerLayer := innerPacket.Layer(layers.LayerTypeIPv4)
Expand Down
5 changes: 0 additions & 5 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,6 @@ func SkipPbfWithDecapEncapVrf(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetSkipPbfWithDecapEncapVrf()
}

// TTLCopyUnsupported returns true for devices which does not support TTL copy.
func TTLCopyUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetTtlCopyUnsupported()
}

// GribiDecapMixedPlenUnsupported returns true if devices does not support
// programming with mixed prefix length.
func GribiDecapMixedPlenUnsupported(dut *ondatra.DUTDevice) bool {
Expand Down
3 changes: 0 additions & 3 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,6 @@ message Metadata {
// Skip tests with decap encap vrf as PBF action
// Nokia: partnerissuetracker.corp.google.com/issues/323251581
bool skip_pbf_with_decap_encap_vrf = 141;
// Devices which does not support copying TTL.
// Juniper: b/307258544
bool ttl_copy_unsupported = 142;
// Devices does not support mixed prefix length in gribi.
// Juniper: b/307824407
bool gribi_decap_mixed_plen_unsupported = 143;
Expand Down
1,709 changes: 808 additions & 901 deletions proto/metadata_go_proto/metadata.pb.go

Large diffs are not rendered by default.

49 changes: 16 additions & 33 deletions proto/nosimage_go_proto/nosimage.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bc105a4

Please sign in to comment.