Skip to content

Commit

Permalink
Arista specific fixes for basic_static_route_support_test (openconfig…
Browse files Browse the repository at this point in the history
…#2834)

* Arista specific fixes for basic_static_route_support_test

* fix flow stats logic
  • Loading branch information
Ankur19 authored Mar 21, 2024
1 parent 6df6471 commit 75f8980
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func interfaceConfig(t *testing.T, dut1 *ondatra.DUTDevice, dp *ondatra.Port, fr
}

func verifyCDValue(t *testing.T, dut1 *ondatra.DUTDevice, pStream *samplestream.SampleStream[float64], sensorName string, status portState) float64 {
CDSample := pStream.Next(t)
CDSample := pStream.Next()
if CDSample == nil {
t.Fatalf("CD telemetry %s was not streamed in the most recent subscription interval", sensorName)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#### Test to validate static route metric

* Configure metric of ipv4-route-b and ipv6-route-b to 1000
* Configure metric of ipv4-route-b and ipv6-route-b to 100
* /network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/metric
* Validate that the metric is set correctly
* /network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/metric
Expand All @@ -69,7 +69,7 @@

#### Test to validate static route preference

* Configure preference of ipv4-route-a and ipv6-route-a to 200
* Configure preference of ipv4-route-a and ipv6-route-a to 50
* /network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/preference
* Validate that the preference is set correctly
* /network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/state/preference
Expand All @@ -90,9 +90,9 @@

#### Test to validate IPv6 static route with IPv4 next-hop

* Remove metric of 1000 from ipv4-route-b and ipv6-route-b
* Remove metric of 100 from ipv4-route-b and ipv6-route-b
* /network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/metric
* Remove preference of 200 from ipv4-route-a and ipv6-route-a
* Remove preference of 50 from ipv4-route-a and ipv6-route-a
* /network-instances/network-instance/protocols/protocol/static-routes/static/next-hops/next-hop/config/preference
* Change the IPv6 next-hop of the ipv6-route-a with the next hop set to the
IPv4 address of ATE port-1
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ platform_exceptions: {
missing_isis_interface_afi_safi_enable: true
isis_require_same_l1_metric_with_l2_metric: true
ipv6_static_route_with_ipv4_next_hop_requires_static_arp: true
set_metric_as_preference: true
missing_static_route_next_hop_metric_telemetry: true
unsupported_static_route_next_hop_recurse: true
missing_static_route_drop_next_hop_telemetry: true
}
}
tags: TAGS_DATACENTER_EDGE
21 changes: 21 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,3 +853,24 @@ func IPv6StaticRouteWithIPv4NextHopRequiresStaticARP(dut *ondatra.DUTDevice) boo
func PfRequireSequentialOrderPbrRules(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetPfRequireSequentialOrderPbrRules()
}

// MissingStaticRouteNextHopMetricTelemetry returns true for devices missing
// static route next-hop metric telemetry.
// Arista: https://partnerissuetracker.corp.google.com/issues/321010782
func MissingStaticRouteNextHopMetricTelemetry(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetMissingStaticRouteNextHopMetricTelemetry()
}

// UnsupportedStaticRouteNextHopRecurse returns true for devices that don't support recursive
// resolution of static route next hop.
// Arista: https://partnerissuetracker.corp.google.com/issues/314449182
func UnsupportedStaticRouteNextHopRecurse(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetUnsupportedStaticRouteNextHopRecurse()
}

// MissingStaticRouteDropNextHopTelemetry returns true for devices missing
// static route telemetry with DROP next hop.
// Arista: https://partnerissuetracker.corp.google.com/issues/330619816
func MissingStaticRouteDropNextHopTelemetry(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetMissingStaticRouteDropNextHopTelemetry()
}
4 changes: 2 additions & 2 deletions internal/otgutils/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ func GetFlowStats(t testing.TB, otg *otg.OTG, flowName string, timeout time.Dura
}
txPkts := gnmi.Get(t, otg, gnmi.OTG().Flow(flowName).Counters().OutPkts().State())

rxPkts, ok := gnmi.Watch(t, otg, gnmi.OTG().Flow(flowName).Counters().InPkts().State(), timeout, func(val *ygnmi.Value[uint64]) bool {
rxPkts, _ := gnmi.Watch(t, otg, gnmi.OTG().Flow(flowName).Counters().InPkts().State(), timeout, func(val *ygnmi.Value[uint64]) bool {
rxPackets, present := val.Val()
return present && rxPackets == txPkts
}).Await(t)
if !ok {
if rxPkts == nil {
return txPkts, 0
}
rx, _ := rxPkts.Val()
Expand Down
9 changes: 9 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,15 @@ message Metadata {
bool ipv6_static_route_with_ipv4_next_hop_requires_static_arp = 158;
// Device requires policy-forwarding rules to be in sequential order in the gNMI set-request.
bool pf_require_sequential_order_pbr_rules = 159;
// Device telemetry missing next hop metric value.
// Arista: https://partnerissuetracker.corp.google.com/issues/321010782
bool missing_static_route_next_hop_metric_telemetry = 160;
// Device does not support recursive resolution of static route next hop.
// Arista: https://partnerissuetracker.corp.google.com/issues/314449182
bool unsupported_static_route_next_hop_recurse = 161;
// Device missing telemetry for static route that has DROP next hop.
// Arista: https://partnerissuetracker.corp.google.com/issues/330619816
bool missing_static_route_drop_next_hop_telemetry = 162;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19;
Expand Down
134 changes: 91 additions & 43 deletions proto/metadata_go_proto/metadata.pb.go

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

0 comments on commit 75f8980

Please sign in to comment.