Skip to content

Commit f5934d2

Browse files
Fix Arista failures in telemetry_interface_last_change_test (gNMI-1.25)
Add subinterface_0_state_unsupported deviation for Arista as state telemetry is not populated on the default (index 0) subinterface (both LAG and Ethernet). The deviation is defined broadly to cover any unsupported state on subinterface 0, but in this PR it is used specifically to skip last-change validation while parent interface validation continues. Fix LAGMemberFlap and OTGLAGFlap timeout by expecting LOWER_LAYER_DOWN oper-status on Arista when the LAG goes down due to member port disable or link loss. The oper-status remains DOWN when LAG itself is shutdown.
1 parent 8887ca2 commit f5934d2

File tree

5 files changed

+77
-43
lines changed

5 files changed

+77
-43
lines changed

feature/interface/otg_tests/telemetry_interface_last_change_test/metadata.textproto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ platform_exceptions: {
2020
deviations: {
2121
interface_enabled: true
2222
fr_breakout_fix: true
23+
subinterface_0_state_unsupported: true
2324
}
2425
}

feature/interface/otg_tests/telemetry_interface_last_change_test/telemetry_interface_last_change_test.go

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,19 @@ func performLAGFlapTest(t *testing.T, dut *ondatra.DUTDevice, aggID string, dutA
156156
gnmi.Await(t, dut, aggIntfPath.OperStatus().State(), awaitTimeout, oc.Interface_OperStatus_UP)
157157

158158
// Get initial last-change values when the interface is UP.
159+
skipSubintf := deviations.Subinterface0StateUnsupported(dut)
159160
initialIntfLCVal, present := gnmi.Lookup(t, dut, aggIntfPath.LastChange().State()).Val()
160161
if !present {
161162
t.Fatalf("[%s] Failed to lookup initial LastChange for interface %s", testName, aggID)
162163
}
163-
initialSubintfLCVal, present := gnmi.Lookup(t, dut, aggIntfPath.Subinterface(0).LastChange().State()).Val()
164-
if !present {
165-
t.Fatalf("[%s] Failed to lookup initial LastChange for subinterface %s:0", testName, aggID)
164+
var initialSubintfLCVal uint64
165+
if !skipSubintf {
166+
initialSubintfLCVal, present = gnmi.Lookup(t, dut, aggIntfPath.Subinterface(0).LastChange().State()).Val()
167+
if !present {
168+
t.Fatalf("[%s] Failed to lookup initial LastChange for subinterface %s:0", testName, aggID)
169+
}
170+
t.Logf("[%s] Initial LastChange values: Interface %s: %d, Subinterface %s:0: %d", testName, aggID, initialIntfLCVal, aggID, initialSubintfLCVal)
166171
}
167-
t.Logf("[%s] Initial LastChange values: Interface %s: %d, Subinterface %s:0: %d", testName, aggID, initialIntfLCVal, aggID, initialSubintfLCVal)
168172

169173
prevIntfLC := initialIntfLCVal
170174
prevSubintfLC := initialSubintfLCVal
@@ -181,6 +185,9 @@ func performLAGFlapTest(t *testing.T, dut *ondatra.DUTDevice, aggID string, dutA
181185
if dut.Vendor() == ondatra.JUNIPER {
182186
targetOperStatus = oc.Interface_OperStatus_LOWER_LAYER_DOWN
183187
}
188+
if dut.Vendor() == ondatra.ARISTA && (testName == "LAGMemberFlap" || testName == "OTGLAGFlap") {
189+
targetOperStatus = oc.Interface_OperStatus_LOWER_LAYER_DOWN
190+
}
184191
} else { // In even-numbered iterations, enable the interface.
185192
action = "Enable"
186193
enabledState = true
@@ -200,20 +207,20 @@ func performLAGFlapTest(t *testing.T, dut *ondatra.DUTDevice, aggID string, dutA
200207
t.Errorf("[%s] Failed to lookup LastChange for interface %s after %s (state change %d)", testName, aggID, action, i)
201208
continue
202209
}
203-
currentSubintfLCVal, present := gnmi.Lookup(t, dut, aggIntfPath.Subinterface(0).LastChange().State()).Val()
204-
if !present {
205-
t.Errorf("[%s] Failed to lookup LastChange for subinterface %s:0 after %s (state change %d)", testName, aggID, action, i)
206-
continue
207-
}
208-
t.Logf("[%s] LastChange values after %s: Interface %s: %d, Subinterface %s:0: %d", testName, action, aggID, currentIntfLCVal, aggID, currentSubintfLCVal)
209-
210-
// Verify that last-change increased for both the LAG interface and its subinterface.
210+
// Verify that last-change increased for the LAG interface.
211211
validateLastChangeIncrease(t, fmt.Sprintf("%s after %s (state change %d)", testName, action, i), aggID, prevIntfLC, currentIntfLCVal)
212-
validateLastChangeIncrease(t, fmt.Sprintf("%s after %s (state change %d)", testName, action, i), fmt.Sprintf("%s:%d", aggID, 0), prevSubintfLC, currentSubintfLCVal)
213-
214-
// Store current timestamps for comparison in the next iteration.
215212
prevIntfLC = currentIntfLCVal
216-
prevSubintfLC = currentSubintfLCVal
213+
214+
if !skipSubintf {
215+
currentSubintfLCVal, present := gnmi.Lookup(t, dut, aggIntfPath.Subinterface(0).LastChange().State()).Val()
216+
if !present {
217+
t.Errorf("[%s] Failed to lookup LastChange for subinterface %s:0 after %s (state change %d)", testName, aggID, action, i)
218+
continue
219+
}
220+
t.Logf("[%s] LastChange values after %s: Interface %s: %d, Subinterface %s:0: %d", testName, action, aggID, currentIntfLCVal, aggID, currentSubintfLCVal)
221+
validateLastChangeIncrease(t, fmt.Sprintf("%s after %s (state change %d)", testName, action, i), fmt.Sprintf("%s:%d", aggID, 0), prevSubintfLC, currentSubintfLCVal)
222+
prevSubintfLC = currentSubintfLCVal
223+
}
217224
}
218225
}
219226

@@ -341,15 +348,19 @@ func TestEthernetInterfaceLastChangeState(t *testing.T) {
341348
gnmi.Await(t, dut, intfPath.OperStatus().State(), awaitTimeout, oc.Interface_OperStatus_UP)
342349

343350
// Get initial last-change values when the interface is UP.
351+
skipSubintf := deviations.Subinterface0StateUnsupported(dut)
344352
initialIntfLCVal, present := gnmi.Lookup(t, dut, intfPath.LastChange().State()).Val()
345353
if !present {
346354
t.Fatalf("[%s] Failed to lookup initial LastChange for interface %s", testName, port.Name())
347355
}
348-
initialSubintfLCVal, present := gnmi.Lookup(t, dut, intfPath.Subinterface(0).LastChange().State()).Val()
349-
if !present {
350-
t.Fatalf("[%s] Failed to lookup initial LastChange for subinterface %s:0", testName, port.Name())
356+
var initialSubintfLCVal uint64
357+
if !skipSubintf {
358+
initialSubintfLCVal, present = gnmi.Lookup(t, dut, intfPath.Subinterface(0).LastChange().State()).Val()
359+
if !present {
360+
t.Fatalf("[%s] Failed to lookup initial LastChange for subinterface %s:0", testName, port.Name())
361+
}
362+
t.Logf("[%s] Initial LastChange values: Interface %s: %d, Subinterface %s:0: %d", testName, port.Name(), initialIntfLCVal, port.Name(), initialSubintfLCVal)
351363
}
352-
t.Logf("[%s] Initial LastChange values: Interface %s: %d, Subinterface %s:0: %d", testName, port.Name(), initialIntfLCVal, port.Name(), initialSubintfLCVal)
353364

354365
prevIntfLC := initialIntfLCVal
355366
prevSubintfLC := initialSubintfLCVal
@@ -382,29 +393,28 @@ func TestEthernetInterfaceLastChangeState(t *testing.T) {
382393
t.Errorf("[%s] Failed to lookup LastChange for interface %s after %s (state change %d)", testName, port.Name(), action, i)
383394
continue
384395
}
385-
currentSubintfLCVal, present := gnmi.Lookup(t, dut, intfPath.Subinterface(0).LastChange().State()).Val()
386-
if !present {
387-
t.Errorf("[%s] Failed to lookup LastChange for subinterface %s:0 after %s (state change %d)", testName, port.Name(), action, i)
388-
continue
389-
}
390-
391-
// Verify that last-change increased.
392-
subIntfName := fmt.Sprintf("%s:%d", port.Name(), 0)
396+
// Verify that last-change increased for the interface.
393397
if currentIntfLCVal <= prevIntfLC {
394398
t.Errorf("[%s] State Change %d (%s): Interface %s LastChange timestamp did not increase, initial: %d, final: %d", testName, i, action, port.Name(), prevIntfLC, currentIntfLCVal)
395399
} else {
396400
t.Logf("[%s] State Change %d (%s): Interface %s LastChange timestamp increased as expected, initial: %d, final: %d", testName, i, action, port.Name(), prevIntfLC, currentIntfLCVal)
397401
}
402+
prevIntfLC = currentIntfLCVal
398403

399-
if currentSubintfLCVal <= prevSubintfLC {
400-
t.Errorf("[%s] State Change %d (%s): Subinterface %s LastChange timestamp did not increase, initial: %d, final: %d", testName, i, action, subIntfName, prevSubintfLC, currentSubintfLCVal)
401-
} else {
402-
t.Logf("[%s] State Change %d (%s): Subinterface %s LastChange timestamp increased as expected, initial: %d, final: %d", testName, i, action, subIntfName, prevSubintfLC, currentSubintfLCVal)
404+
if !skipSubintf {
405+
currentSubintfLCVal, present := gnmi.Lookup(t, dut, intfPath.Subinterface(0).LastChange().State()).Val()
406+
if !present {
407+
t.Errorf("[%s] Failed to lookup LastChange for subinterface %s:0 after %s (state change %d)", testName, port.Name(), action, i)
408+
continue
409+
}
410+
subIntfName := fmt.Sprintf("%s:%d", port.Name(), 0)
411+
if currentSubintfLCVal <= prevSubintfLC {
412+
t.Errorf("[%s] State Change %d (%s): Subinterface %s LastChange timestamp did not increase, initial: %d, final: %d", testName, i, action, subIntfName, prevSubintfLC, currentSubintfLCVal)
413+
} else {
414+
t.Logf("[%s] State Change %d (%s): Subinterface %s LastChange timestamp increased as expected, initial: %d, final: %d", testName, i, action, subIntfName, prevSubintfLC, currentSubintfLCVal)
415+
}
416+
prevSubintfLC = currentSubintfLCVal
403417
}
404-
405-
// Store current timestamps for the next iteration's comparison.
406-
prevIntfLC = currentIntfLCVal
407-
prevSubintfLC = currentSubintfLCVal
408418
}
409419
}
410420

internal/deviations/deviations.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,3 +2042,9 @@ func AcctzRecordsAuthzStatusDenyUnsupported(dut *ondatra.DUTDevice) bool {
20422042
func FpgaFt(dut *ondatra.DUTDevice) string {
20432043
return lookupDUTDeviations(dut).GetFpgaFt()
20442044
}
2045+
2046+
// Subinterface0StateUnsupported returns true if the device does not populate
2047+
// state on subinterface 0 that is implicitly created.
2048+
func Subinterface0StateUnsupported(dut *ondatra.DUTDevice) bool {
2049+
return lookupDUTDeviations(dut).GetSubinterface_0StateUnsupported()
2050+
}

proto/metadata.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,11 @@ message Metadata {
12311231
// Cisco: https://partnerissuetracker.corp.google.com/issues/429156503
12321232
string fpga_ft = 398;
12331233

1234+
// Device does not populate state on subinterface 0
1235+
// that is implicitly created.
1236+
// Arista: https://partnerissuetracker.corp.google.com/issues/456175792
1237+
bool subinterface_0_state_unsupported = 399;
1238+
12341239
// Reserved field numbers and identifiers.
12351240
reserved 84, 9, 28, 20, 38, 43, 90, 97, 55, 89, 19, 36, 35, 40, 113, 131, 141, 173, 234, 254, 231, 300, 241;
12361241
}

proto/metadata_go_proto/metadata.pb.go

Lines changed: 19 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)