// first check whether the entry for the given operation ID exists.
ifopsLockState.OperationID==l.opsID{
opsIDfound=true
// asserting the type of lock (RLock/WLock) from the RPC lock info response.
ifl.readLock{
ifopsLockState.LockType!=debugRLockStr{
t.Errorf("Test case %d: Expected the lock type to be \"%s\"",testNum,debugRLockStr)
}
}else{
ifopsLockState.LockType!=debugWLockStr{
t.Errorf("Test case %d: Expected the lock type to be \"%s\"",testNum,debugWLockStr)
}
}
ifopsLockState.Status!=l.expectedLockStatus{
t.Errorf("Test case %d: Expected the status of the operation to be \"%s\", got \"%s\"",testNum,l.expectedLockStatus,opsLockState.Status)
}
// all check satisfied, return here.
// Any mismatch in the earlier checks would have ended the tests due to `Fatalf`,
// control reaching here implies that all checks are satisfied.
return
}
}
// opsID not found.
// No entry for an operation with given operation ID exists.
if!opsIDfound{
t.Fatalf("Test case %d: Entry for OpsId: \"%s\" not found in <bucket>: \"%s\", <path>: \"%s\" doesn't exist in the RPC response",testNum,l.opsID,l.volume,l.path)
}
}
}
// No entry exists for given <bucket, object> pair in the RPC response.
t.Errorf("Test case %d: Entry for <bucket>: \"%s\", <object>: \"%s\" doesn't exist in the RPC response",testNum,l.volume,l.path)
}
}
// Read entire state of the locks in the system and return.
// Read entire state of the locks in the system and return.