@@ -480,9 +480,6 @@ func ValidateLossMeasurement(t *testing.T, dutData []*ondatra.DUTDevice, cfg []M
480480 slmReceived1 := gnmi .Get (t , dutData [0 ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [0 ].ProfileName ).LossMeasurementState ().Counters ().SlmReceived ().State ())
481481 slmReceived2 := gnmi .Get (t , dutData [1 ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [1 ].ProfileName ).LossMeasurementState ().Counters ().SlmReceived ().State ())
482482 if slmReceived1 > 0 && slmReceived2 > 0 {
483- lastMeasurement1 = int (slmReceived1 )
484- lastMeasurement2 = int (slmReceived2 )
485-
486483 if slmReceived1 > uint64 (lastMeasurement1 ) {
487484 lastMeasurement1 = int (slmReceived1 )
488485 } else {
@@ -496,27 +493,27 @@ func ValidateLossMeasurement(t *testing.T, dutData []*ondatra.DUTDevice, cfg []M
496493 } else {
497494 t .Errorf ("slm measurement not found, got: %d, %d, expected > 1" , slmReceived1 , slmReceived2 )
498495 }
499- }
500- for i := range dutData {
501- max := gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().FarEndMaxFrameLossRatio ().State ())
502- min := gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().FarEndMinFrameLossRatio ().State ())
503- avg := gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().FarEndAverageFrameLossRatio ().State ())
496+ for i := range dutData {
497+ max := gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().FarEndMaxFrameLossRatio ().State ())
498+ min := gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().FarEndMinFrameLossRatio ().State ())
499+ avg := gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().FarEndAverageFrameLossRatio ().State ())
504500
505- if max == 0 || min == 0 || avg == 0 {
506- t .Fatal ("Could not retrieve one or more farend loss measurement values" )
507- }
501+ if max == 0 || min == 0 || avg == 0 {
502+ t .Fatal ("Could not retrieve one or more farend loss measurement values" )
503+ }
508504
509- t .Logf ("Farend loss ratio - Min: %d, Max: %d, Avg: %d\n " , min , max , avg )
505+ t .Logf ("Farend loss ratio - Min: %d, Max: %d, Avg: %d\n " , min , max , avg )
510506
511- max = gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().NearEndMaxFrameLossRatio ().State ())
512- min = gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().NearEndMinFrameLossRatio ().State ())
513- avg = gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().NearEndAverageFrameLossRatio ().State ())
507+ max = gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().NearEndMaxFrameLossRatio ().State ())
508+ min = gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().NearEndMinFrameLossRatio ().State ())
509+ avg = gnmi .Get (t , dutData [i ], gnmi .OC ().Oam ().Cfm ().PerformanceMeasurementProfile (cfg [i ].ProfileName ).LossMeasurementState ().NearEndAverageFrameLossRatio ().State ())
514510
515- if max == 0 || min == 0 || avg == 0 {
516- t .Fatal ("Could not retrieve one or more near-end loss measurement values" )
517- }
511+ if max == 0 || min == 0 || avg == 0 {
512+ t .Fatal ("Could not retrieve one or more near-end loss measurement values" )
513+ }
518514
519- t .Logf ("near end loss ratio - Min: %d, Max: %d, Avg: %d\n " , min , max , avg )
515+ t .Logf ("near end loss ratio - Min: %d, Max: %d, Avg: %d\n " , min , max , avg )
516+ }
520517 }
521518 }
522519}
0 commit comments