Skip to content

Commit

Permalink
verify generator/reflector interface oper-state is TESTING (openconfi…
Browse files Browse the repository at this point in the history
  • Loading branch information
self-maurya authored Oct 27, 2023
1 parent 5280fa3 commit 5f1f8cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ between 2 DUTs.
its teardown.
* TeardownDuration: The amount time required to bring the interface
back to pre-test state.
* [TODO: issue#2244] verify generator interface oper-state is 'TESTING'
* Verify generator interface oper-state is 'TESTING'
* Set another device as the FAR_END (reflector) device for Packet Based Link
Qual.
* Issue gnoi.LinkQualification Create RPC to the device and provide
Expand All @@ -72,7 +72,7 @@ between 2 DUTs.
* EndpointType: Qualification_end set as FAR_END.
* RPCSyncedTiming:
* Reflector timers should be same as the ones on the generator.
* [TODO: issue#2244] verify reflector interface oper-state is 'TESTING'
* Verify reflector interface oper-state is 'TESTING'
* Get the result by issuing gnoi.LinkQualification Get RPC to gather the
result of link qualification. Provide the following parameter:
* Id: The identifier used above on the NEAR_END side.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,19 @@ func TestLinkQualification(t *testing.T) {
if listResp.GetResults()[j].GetState() != plqpb.QualificationState_QUALIFICATION_STATE_COMPLETED {
testDone = false
}
if listResp.GetResults()[j].GetState() == plqpb.QualificationState_QUALIFICATION_STATE_RUNNING {
if client == gnoiClient1 {
t.Logf("Checking link under qualificaton (generator) interface oper-status (dut: %v, dp: %v)", dut1.Name(), dp1.Name())
if got, want := gnmi.Get(t, dut1, gnmi.OC().Interface(dp1.Name()).OperStatus().State()), oc.Interface_OperStatus_TESTING; got != want {
t.Errorf("Interface(%v) oper-status: got %v, want %v", dp1.Name(), got, oc.Interface_OperStatus_TESTING)
}
} else if client == gnoiClient2 {
t.Logf("Checking link under qualificaton (reflector) interface oper-status (dut: %v, dp: %v)", dut2.Name(), dp2.Name())
if got, want := gnmi.Get(t, dut2, gnmi.OC().Interface(dp2.Name()).OperStatus().State()), oc.Interface_OperStatus_TESTING; got != want {
t.Errorf("Interface(%v) oper-status: got %v, want %v", dp2.Name(), got, oc.Interface_OperStatus_TESTING)
}
}
}
}
if len(listResp.GetResults()) == 0 {
testDone = false
Expand Down

0 comments on commit 5f1f8cc

Please sign in to comment.