diff --git a/test/e2e/dra/test-driver/app/kubeletplugin.go b/test/e2e/dra/test-driver/app/kubeletplugin.go index 66df9885fd4..2656a45e10d 100644 --- a/test/e2e/dra/test-driver/app/kubeletplugin.go +++ b/test/e2e/dra/test-driver/app/kubeletplugin.go @@ -23,6 +23,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "sync" "github.com/google/go-cmp/cmp" @@ -545,3 +546,14 @@ func (ex *ExamplePlugin) GetGRPCCalls() []GRPCCall { calls = append(calls, ex.gRPCCalls...) return calls } + +// CountCalls counts GRPC calls with the given method suffix. +func (ex *ExamplePlugin) CountCalls(methodSuffix string) int { + count := 0 + for _, call := range ex.GetGRPCCalls() { + if strings.HasSuffix(call.FullMethod, methodSuffix) { + count += 1 + } + } + return count +}