Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,29 @@ func testNoCongestionValidateFlows(t *testing.T, dut *ondatra.DUTDevice, ate *on
}
}

// Wait for ALL tagged metrics to populate first
deadline := time.Now().Add(45 * time.Second)
metricsPopulated := false
for time.Now().Before(deadline) {
allFound := true
for dscpValue := 0; dscpValue < 64; dscpValue++ {
etPath := gnmi.OTG().Flow(fmt.Sprintf("dscp-%d-%s", dscpValue, atePort2.Name)).TaggedMetricAny()
vals := gnmi.LookupAll(t, ate.OTG(), etPath.State())
if len(vals) == 0 || !vals[0].IsPresent() {
allFound = false
break
}
}
if allFound {
metricsPopulated = true
break
}
time.Sleep(2 * time.Second)
}
if !metricsPopulated {
t.Fatalf("Timed out waiting for tagged metrics to populate on the ATE")
}
Comment thread
AmrNJ marked this conversation as resolved.

for dscpValue := 0; dscpValue < 64; dscpValue++ {
etPath := gnmi.OTG().Flow(fmt.Sprintf("dscp-%d-%s", dscpValue, atePort2.Name)).TaggedMetricAny()
ets := gnmi.GetAll(t, ate.OTG(), etPath.State())
Expand Down Expand Up @@ -655,6 +678,35 @@ func testCongestionValidateFlows(t *testing.T, dut *ondatra.DUTDevice, ate *onda

var congestedFlowCount int

// Wait for ALL tagged metrics across both ports to populate first
deadline := time.Now().Add(45 * time.Second)
metricsPopulated := false
for time.Now().Before(deadline) {
allFound := true
for _, sourceAtePort := range []*attrs.Attributes{atePort2, atePort3} {
for dscpValue := 0; dscpValue < 64; dscpValue++ {
etPath := gnmi.OTG().Flow(fmt.Sprintf("dscp-%d-%s", dscpValue, sourceAtePort.Name)).TaggedMetricAny()
vals := gnmi.LookupAll(t, ate.OTG(), etPath.State())
if len(vals) == 0 || !vals[0].IsPresent() {
allFound = false
break
}
}
if !allFound {
break
}
}
if allFound {
metricsPopulated = true
break
}
time.Sleep(2 * time.Second)
}
Comment thread
AmrNJ marked this conversation as resolved.

if !metricsPopulated {
t.Fatalf("Timed out waiting for tagged metrics to populate on the ATE")
}

// These should have the majority of flows have ecn set.
for _, sourceAtePort := range []*attrs.Attributes{atePort2, atePort3} {
for dscpValue := 0; dscpValue < 48; dscpValue++ {
Expand Down Expand Up @@ -789,6 +841,35 @@ func testNC1CongestionValidateFlows(t *testing.T, dut *ondatra.DUTDevice, ate *o

var congestedFlowCount int

// Wait for ALL 48-63 tagged metrics to populate first
deadline := time.Now().Add(45 * time.Second)
metricsPopulated := false
for time.Now().Before(deadline) {
allFound := true
for _, sourceAtePort := range []*attrs.Attributes{atePort2, atePort3} {
for dscpValue := 48; dscpValue < 64; dscpValue++ {
etPath := gnmi.OTG().Flow(fmt.Sprintf("dscp-%d-%s", dscpValue, sourceAtePort.Name)).TaggedMetricAny()
vals := gnmi.LookupAll(t, ate.OTG(), etPath.State())
if len(vals) == 0 || !vals[0].IsPresent() {
allFound = false
break
}
}
if !allFound {
break
}
}
if allFound {
metricsPopulated = true
break
}
time.Sleep(2 * time.Second)
}
Comment thread
AmrNJ marked this conversation as resolved.

if !metricsPopulated {
t.Fatalf("Timed out waiting for tagged metrics to populate on the ATE")
}

for _, sourceAtePort := range []*attrs.Attributes{atePort2, atePort3} {
for dscpValue := 48; dscpValue < 64; dscpValue++ {
etPath := gnmi.OTG().Flow(fmt.Sprintf("dscp-%d-%s", dscpValue, sourceAtePort.Name)).TaggedMetricAny()
Expand Down
Loading